Display price with/without Tax in different categories

  • Posts: 75
  • Thank you received: 1
6 years 4 days ago #304892

-- HikaShop version -- : 4.0.2
-- Joomla version -- : 3.9.4
-- PHP version -- : 7.3.3
-- Browser(s) name and version -- : Chrome 72.0.3626.121
-- Error-message(debug-mod must be tuned on) -- : no error - trying to display price with/without Tax in different categories

We need to display the message "(exc. VAT)" after each price displayed on the site [e.g. £10.21 (exc. VAT) ]
however we now have a range of products which have zero tax, and with these we want to display "(VAT Free)" next to the price [e.g. £10.21 (VAT Free) ]

In principle it seems a simple thing to do but it's proving difficult. Is there a simple way to display prices like this?

Last edit: 6 years 4 days ago by spotstv.

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

  • Posts: 83483
  • Thank you received: 13506
  • MODERATOR
6 years 3 days ago #304893

Hi,

You'll probably first want to have a custom field of the table "product" and of the type "simple dropdown" with two values: (exc. VAT) and (VAT Free).
Then, in each product, you can select the value you want in that custom field.
You'll then have to edit the file "listing_price" of the view "product" via the menu Display>Views.
That's the view file which display the prices of the products on the listings and the product pages.
There, at the end, you can use such code:
<?php echo $this->row->XXX; ?>
where XXX is the column name fo your custom product field.
That way, it will add the text of the custom field at the end of the price.

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

Time to create page: 0.058 seconds
Powered by Kunena Forum