Wonder if anyone can explain this bug I've found...

You add a product to the cart (quantity of 1)
You then add the product again (lets say quantity of 2 this time)

You'd expect to see 1 row in the cart of the one product with 3 as the quantity.

Instead I get 2 rows. (See screenshot attached)

Can anyone explain and propose a fix for me?

Thanks!
Karen.

CommentFileSizeAuthor
#3 cart.png.jpeg47.92 KBaeremeev
multiple-products-cart.jpg54.26 KBkarengrey
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rszrama’s picture

Category: bug » support
Status: Active » Closed (works as designed)

Combining like items in the cart is the default behavior, but if you use line item fields and the customer supplies different value when adding to the cart, different line items would be used. Additionally, there's a configuration option for the Add to Cart form display formatter that lets you turn off automatic combination.

karengrey’s picture

Ok i'll check it out, cheers!

aeremeev’s picture

FileSize
47.92 KB

Hi,

I m facing the same problem. Each time I add the same product to the cart it appears as a separate line-item in the cart.

The "Attempt to combine like products on the same line item in the cart." is ON and my product is an MP3 file with no customization options, but the items are not combined into one.

Did anyone figure this out?

Thanks!

torgosPizza’s picture

Very strange. I'm seeing this behavior too - it was working correctly in a previous version of Commerce, but now identical items are not being combined in the cart.

Any ideas?

torgosPizza’s picture

Version: 7.x-1.5 » 7.x-1.8
Status: Closed (works as designed) » Active

Setting to active since this is the 2nd report within the last month on this issue.

Running through the process in XDebug, somewhere between drupal_get_form() and drupal_build_form(), the value in $form_state['build_info']['args'][0]->dat]['context']['add_to_cart_combine'] becomes FALSE. I don't know why in the hell it's happening though, because my product reference field is set to Combine like items in the cart. I can flip between the values returned by get_form and build_form and see that in the former it's TRUE, and the latter it's FALSE.

@Ryan, any idea what could be causing this? It doesn't appear to be a cached form, and it's definitely not a settings issue. Any pointers on where to look for where this value might be changing could be helpful.

Thanks!

torgosPizza’s picture

Status: Active » Closed (works as designed)

Turns out it's a Commerce File 2.x thing. I'll file a bug there. Crisis averted.

rszrama’s picture

Hah, thanks for following it through. I was scratching my head and prepping to dig in tomorrow. : P

Pramod E’s picture

Issue summary: View changes

Hi, @karengreen

Kindly help me how did you implemented the single productid with multiple products and price as am also facing the similar issue in other perspective which is:-

I have a view, in which i have add a customised link which will redirect onto a form with prefilled values ....with one text box as blank where the user will be entering the value.....

Now i would like to implement is:

if i click the submit button then it should open the same form with prefilled values and with an empty textbox.

kruser’s picture

@torgosPizza I didn't see this in the Commerce File queue and I'm using Commerce File 2.x with the same situation. Can you post a link to it?

andrebonfanti’s picture