The confirmation message (Cart quantity updated to N) always displays the quantity (N) of the first item if there are multiple items in the cart.

In other words, if I update the quantity of the second item to X, the confirmation message will refer to the first item's quantity N. I hope this is clear...

Comments

the_g_bomb’s picture

Confirmed

If 2 items are in the cart change the second item quantity and click update quantity. The quantity of the first item is displayed in the message.

This comes from around line 707 in the amazon_store.module

When the $result is returned the 0 index CartItem is used to update the message display message.

Changing the line to this should fix it.

<?php
  foreach ($results->Cart->CartItems->CartItem as $cartitem) {
    if ($cartitem->CartItemId == $cartItemId) $actual_quantity = $quantity > 0 ? (int)$cartitem->Quantity : $quantity;
  }
?>

I will create a patch that will check each CartItem to see if that is the cartitem that has been updated, then set the message as required.

the_g_bomb’s picture

StatusFileSize
new911 bytes

Hope this helps

rfay’s picture

Status: Active » Needs review
rfay’s picture

+++ amazon_store.module	10 Oct 2010 10:53:53 -0000
@@ -704,7 +704,9 @@
+    if ($cartitem->CartItemId == $cartItemId) $actual_quantity = $quantity > 0 ? (int)$cartitem->Quantity : $quantity;

Same issue here - please don't use one-line conditionals.

Powered by Dreditor.

rfay’s picture

Thanks for the excellent work. Committed (with that one change) to DRUPAL-6--2:
http://drupal.org/cvs?commit=437446

rfay’s picture

Version: 6.x-2.0-rc1 » 7.x-1.x-dev
rfay’s picture

StatusFileSize
new1.07 KB
rfay’s picture

Status: Needs review » Fixed

Committed to HEAD: http://drupal.org/cvs?commit=437492

Thanks so much!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.