Jump to content

Cart shows stock quantity instead of number put in cart


Recommended Posts

After updating from 1.2.5. to 1.3 I have a problem
When a customer puts someting in the cart everything goes in the cart. In the top right corner (the cart) it shows how many items he did put in to the cart, i.e. 3 x Eider.
Now comes the problem / error: When he goes to the cart (button: cart) it shows at the quantity / number not " 3 " but it shows how much I have in stock (10).

I put a screendump with the problem!

Can anyone help me with this?

Extra info:
I think the problem is in this part of the code in order.php:

// for compatibility with 1.2 themes
foreach($summary['products'] AS $key => $product)
$summary['products'][$key]['quantity'] = $product['cart_quantity'];
$smarty->assign($summary);
$token = Tools::getToken(false);
$smarty->assign(array(
'token_cart' => $token,
'isVirtualCart' => $cart->isVirtualCart(),
'productNumber' => $cart->nbProducts(),
'voucherAllowed' => Configuration::get('PS_VOUCHERS'),
'HOOK_SHOPPING_CART' => Module::hookExec('shoppingCart', $summary),
'HOOK_SHOPPING_CART_EXTRA' => Module::hookExec('shoppingCartExtra', $summary),
'shippingCost' => $cart->getOrderTotal(true, 5),
'shippingCostTaxExc' => $cart->getOrderTotal(false, 5),
'customizedDatas' => $customizedDatas,
'CUSTOMIZE_FILE' => _CUSTOMIZE_FILE_,
'CUSTOMIZE_TEXTFIELD' => _CUSTOMIZE_TEXTFIELD_,
'lastProductAdded' => $cart->getLastProduct()
));

19787_lFGsXgmuHhAf9caE1sGi_t

Link to comment
Share on other sites

This is EXACTLY why you should not upgrade to anything other than a STABLE version.

I sure hope you did not do it on a production site, and if you did, I hope you either have a backup, or someone to help fix bugs.

I'm sorry I cannot offer any more help, hopefully this will be yet another warning to people with live shops who think it's a good idea to upgrade to an alpha version.

Link to comment
Share on other sites

:-)

I fixed the problem....I get it ... STABLE stands for no errors anymore....but there were more problems in 1.2.5 then there are in 1.3...so I needed the update...
But do you want to know what i've changed?



Yes please, what did you change. I have the same problem as you.

Please respond!

Have a nice day :-)
Link to comment
Share on other sites

  • 2 weeks later...
  • 3 months later...

For those of you who still want to know how to fix this, I simply uploaded the original order.php from my 1.3 install. It happened to me when attempting to get a USPS module to work. Hope this helps! And as always, when you try to fix stuff always keep a backup of your original files.

CHEERS!

Link to comment
Share on other sites

  • 2 months later...

I had this problem on the "Stable Version" as well, it is due to POOR VARIABLE DOCUMENTATION.

HOW TO FIX STOCK QUANTITY BEING DISPLAYED INSTEAD OF CART QUANTITY:
open prestashop\themes\yourtheme\shopping-cart-product-line.tpl

Change:

{$product.quantity-$quantityDisplayed}



Into:

{$product.cart_quantity-$quantityDisplayed}



Hope this helps, this is a very annoying bug.

  • Like 1
Link to comment
Share on other sites

  • 11 months later...
  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...