Product to cart -> new item instead of increasing

  • Posts: 57
  • Thank you received: 2
12 years 10 months ago #34280

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.

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
12 years 10 months ago #34310

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.

  • Posts: 57
  • Thank you received: 2
12 years 10 months ago #34528

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/

Attachments:
Last edit: 12 years 10 months ago by Hans987.

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

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
12 years 10 months ago #34568

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:

$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: 12 years 10 months ago by nicolas.

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

  • Posts: 57
  • Thank you received: 2
12 years 10 months ago #34643

yeah, works!

Thanks!

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

Time to create page: 0.065 seconds
Powered by Kunena Forum