CSS for price with and without tax

  • Posts: 1053
  • Thank you received: 11
  • Hikashop Business
1 day 15 hours ago #364153

-- HikaShop version -- : 5.1.1

Hi!

How can i use seperate CSS for both prices? Price with tax and price without?
Right now it looks the same, same font size, color etc so i want to make them different. Problem is that the class span.hikashop_product_price.hikashop_product_price_0 applys to both prices.

Thank you

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 82682
  • Thank you received: 13334
  • MODERATOR
1 day 11 hours ago #364154

Hi,

You have these translations around the price without taxes:

PRICE_BEFORE_TAX=" ("
PRICE_AFTER_TAX=" excl VAT) "
So you could use translation overrides to add an HTML element around it.
For example:
PRICE_BEFORE_TAX=" <span class='price_without_tax'>("
PRICE_AFTER_TAX=" excl VAT)</span> "
So you can use .hikashop_product_price .price_without_tax to target the price without taxes.
For example:
/* price with taxes will be red */
.hikashop_product_price{ color: red; }
/* price without taxes will be blue */
.hikashop_product_price .price_without_tax{ color: blue; }

More information on translation overrides:
www.hikashop.com/download/languages.html#modify

Last edit: 1 day 15 hours ago by nicolas.
The following user(s) said Thank You: verzevoul

Please Log in or Create an account to join the conversation.

  • Posts: 1053
  • Thank you received: 11
  • Hikashop Business
17 hours 2 minutes ago #364163

That worked thank you!
Can i change what price to display first? I would like for the without tax price to display 1st and then with tax.
For example: 700 (990 include VAT)

Thank you

Please Log in or Create an account to join the conversation.

  • Posts: 4714
  • Thank you received: 638
  • MODERATOR
11 hours 7 minutes ago #364168

Hello,

This will require an override view (learn here how to process), for your needs you have to create your override from the product/listing_price.
And swap the codes that manage the different versions of prices.

Regards

Last edit: 15 hours 10 minutes ago by Philip.

Please Log in or Create an account to join the conversation.

Time to create page: 0.059 seconds
Powered by Kunena Forum