Product options remaining after product removed

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

-- HikaShop version -- : 3.3.0
-- Joomla version -- : 3.8.5
-- PHP version -- : 5.6.20

When the option "Group options with product" is on "No", if you remove the main product from cart, the options remain so it is possible to order options without the product they are associated to.
Is it possible to configure the shop so that the options are removed at the same time as the product ?
I know that "Group options with product" allows that, but it doesn't suits my needs because then you can't change the quantity of the options.

Thanks in advance for your help.

Regards,

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

  • Posts: 82868
  • Thank you received: 13375
  • MODERATOR
6 years 8 months ago #290177

Hi,

It's done like that on purpose. Normally, when you have that option turned off, it means that you want to allow customers to be able to purchase the options separately from the main product.

In that case, I would recommend to keep that option turned on, and modify the view displaying the cart on the checkout to have it display the products as if they were not grouped.
www.hikashop.com/support/documentation/1...-display.html#layout

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

  • Posts: 3
  • Thank you received: 0
6 years 7 months ago #290276

Thank you for your answer.
I have followed your advice, turned the option on and created a template override for product/cart.php.
I've commented the code below (line 145 and 380) :

/* if($group && !empty($product->cart_product_option_parent_id))
		continue; */

Now, the options are separated from the product and are removed from cart when the product is removed.
Unfortunately, it is impossible to remove the options independently. I neither can change their quantity.

Do you have any idea for fixing this ?

Last edit: 6 years 7 months ago by ccambie.

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

  • Posts: 82868
  • Thank you received: 13375
  • MODERATOR
6 years 7 months ago #290277

That would be a lot more complex.
It would require modifying the code in administrator/components/com_hikashop/classes/cart.php
It's a lot more involved.
Maybe removing that code in there would help:

if(!empty($cart->cart_products[ $p['id'] ]->cart_product_option_parent_id)) {
					$p['id'] = 0;
					continue;
				}
This might also need to be modified:
if($pid == $p['id'] || empty($cart_product->cart_product_option_parent_id) || $cart_product->cart_product_option_parent_id != $p['id'])
						continue;
It would require some debugging / testing.

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

  • Posts: 3
  • Thank you received: 0
6 years 7 months ago #290372

Thank you for your answer.
Yet we decided not to hack the component.
May this feature be implemented in a future version ?

Regards,

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

  • Posts: 82868
  • Thank you received: 13375
  • MODERATOR
6 years 7 months ago #290406

Hi,

We don't plan in adding that for now.
Besides you, no one reported such need so far. Maybe we could reconsider in the future if more people were interesting in supporting that.

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

Time to create page: 0.049 seconds
Powered by Kunena Forum