Skip to main content

Product to cart -> new item instead of increasing

More
14 years 9 months ago #34280 by Hans987
Hi,

when a customer puts a product to cart, which is already in the cart, hika increases the quantity of that product.
Is it possible to avoid this and to create a new cart item instead ?


Cheers!
Hans

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

More
14 years 9 months ago #34310 by nicolas
Hi,

There is no option for that.
It could be done with a custom item field (that you would create via the menu Display>Custom fields in the Business edition), a customization of the "show" file of the "product" view via the menu Display->Views so that the custom field is always initialized to something else, and some CSS to hide that custom item field.
As the field would be different each time the user add the product, it would be on a different line of the cart.

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

More
14 years 8 months ago - 14 years 8 months ago #34528 by Hans987
unfortunately, I can't get it work.

Instead, would it be possible to disable the cart button, so the user can see, that the product is already in the cart?

example, if unclear:
www.fontshop.com/
Last edit: 14 years 8 months ago by Hans987.

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

More
14 years 8 months ago - 14 years 8 months ago #34568 by nicolas
Yes, that could be done by editing the file "quantity" of the view "product" via the menu Display->Views.

Something like that at the beginning:
Code:
$cartClass =& hikashop_get('class.cart'); $cart = $cartClass->loadFullCart(); $already = false; if(!empty($cart->products)){ foreach($cart->products as $product){ if($product->product_id==$this->row->product_id) $already = true; } } if($already) return;
Last edit: 14 years 8 months ago by nicolas.

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

More
14 years 8 months ago #34643 by Hans987
yeah, works!

Thanks!

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

Time to create page: 0.154 seconds
Powered by Kunena Forum