Hide options with price 0 from cart, checkout, etc

  • Posts: 6
  • Thank you received: 0
8 years 6 months ago #241205

-- 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.

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
8 years 6 months ago #241209

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:

$this->values[] = JHTML::_('select.option', 0,JText::_('HIKASHOP_NO'));
before the line:
$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.

  • Posts: 6
  • Thank you received: 0
8 years 6 months ago #241262

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.

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
8 years 6 months ago #241284

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.055 seconds
Powered by Kunena Forum