Skip to main content

Hide options with price 0 from cart, checkout, etc

10 years 6 months ago #241205 by vincentducate
-- HikaShop version -- : 2.6.1
-- Joomla version -- : 3.5.1

How can I hide product options with price 0 in the cart, checkout, etc

I'll give an example.

A webshop customer orders a cabinet. As an option he can have some holes drilled to put some cables through. So he can select the number of holes he wants eg none, 1 hole, 2 holes,.... If he selects none, the option shouldn't appear in the checkout.

Regards,
Vincent

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

10 years 5 months ago #241209 by nicolas
Hi,

If an option product doesn't have any characteristic, if you select no, the option won't appear in the checkout/cart.
So I suppose that your optionproduct has a characteristic with several values. And in that case, the system doesn't add a "no" choice and only display the choices based on the variants of the product, and it doesn't which one is the one you don't want to display, if there is one.
So the solution instead, is to remove that choice (by removing the variant from the option product), and add the code:
Code:
$this->values[] = JHTML::_('select.option', 0,JText::_('HIKASHOP_NO'));
before the line:
Code:
$defaultValue=array();
in the file "option" of the view "product" via the menu Display>Views so that this extra "no" choice will act as the no choice when the product doesn't have any characteristic.

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

10 years 5 months ago #241262 by vincentducate
This works fine.
Is it also possible to set 'NO' as the default variant because now it's taking the first one in the list as the default.

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

10 years 5 months ago #241284 by nicolas
Sure. Change the code:
(int)$value
to:
''
in that same view file and that should do it.

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

Time to create page: 0.061 seconds
Powered by Kunena Forum