Skip to main content

add 'from' before cheapest price display

More
11 years 3 weeks ago #214124 by Bower
-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.2.4
-- PHP version -- : 5.3.3
-- Browser(s) name and version -- : firefox 40.0.3

I have products without variants and products with variants.
I am currently displaying the price as 'cheapest price' but I would like to display the word 'From' before the price but only for the products with variants.
I managed to override the PRICE_BEGINNING constant in the language file but this shows for all products.
Could you help me with the piece of code I need to add to listing_price.php so I can get it to show only for products with variants?

Thanks

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

More
11 years 3 weeks ago #214128 by Mohamed Thelji
Hello,
In your case the solution will be to directly edit the "listing_price" file of the "product" view of your front-end template via "Hikashop->Display->Views", You'll have to check that your product have variants and then display the "From" text but some development skills will be required.
You'll find more information about your product through the "$this->row" PHP variable.

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

More
11 years 2 weeks ago #214609 by Bower
I'm finding this really tricky as there doesn't seem to be any indication in the product row (in the database) to tell me that the product has variants.

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

More
11 years 2 weeks ago - 11 years 2 weeks ago #214630 by Mohamed Thelji
Hello,
The "$this->row->has_options" will tell you if your product have a variant/option/item custom field.
So in your case a solution can be to edit the "listing_price" file of the "Product" view of your front-end template via "Hikashop->Display->Views", and change the line :
Code:
echo JText::_('PRICE_BEGINNING');
By :
Code:
if(isset($this->row->has_options)) echo 'From '; echo JText::_('PRICE_BEGINNING');
Last edit: 11 years 2 weeks ago by Mohamed Thelji.

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

Time to create page: 0.225 seconds
Powered by Kunena Forum