Quantity doesn't increment after clicking 'add to cart'

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
9 years ago
Hello,


Whenever I add an item to the shopping cart. The quantity displayed on the top menu (SHOPPING CART(0)) is not updated. I was expecting that the quantity would be incremented. What can I do to solve this bug?

These are the steps to reproduce the bug:
1. Shopping Cart is emply
2. Choose a product and Click Add to Cart
3. CURRENT BEHAVIOR: ON the top menu Shopping Cart(0)
4. EXPECTED BEHAVIOR: ON the top menu Shopping Cart(1)

NOTES:
If I refresh the page, now it displays 'Shopping Cart(1)'

Thanks.
9 years ago
It works just fine out of the box. Please check it out on the official demo site . So I presume you customized source code some wrong way so it broke the default behavior

P.S. Moved from "bug reports" to "development" forum
9 years ago
Hello Andrei,

The bug only happens if you don't have required fields to proceed with the 'Add to Cart' operation.

In that case, whenever you click on 'Add To Cart' on the catalog, it doesn't open the product page because it doesn't need to, however I would expect the incrementation of the Quantity in the header.

But, on way to solve this, is to always have required fields. Maybe, the situation that I am testing won't happen. So, maybe, my question isn't so important.

By the way, I am working on version 3.30.

Thanks,
Daniela.
9 years ago
Please provide a complete list of steps to reproduce it on our demo site
9 years ago
Hello,
You are correct, my changes have introduced this bug. I cannot reproduce this bug on the downloaded version 3.30.
Thanks,
Daniela.
9 years ago
Andrei

I am testing 3.4 and the add to cart buttons for home page products and products in categories do not work. The add to cart button on the product details page does work. I see you have two implementations

Does not work

<input type="button" value="@(Model.ProductPrice.AvailableForPreOrder ? T("ShoppingCart.PreOrder") : T("ShoppingCart.AddToCart"))" class="button-2 product-box-add-to-cart-button" onclick="AjaxCart.addproducttocart_catalog('@addtocartlink');return false;" />


Works

var dataDictAddToCart = new ViewDataDictionary();
                  dataDictAddToCart.TemplateInfo.HtmlFieldPrefix = string.Format("addtocart_{0}", Model.Id);
                  @Html.Partial("_AddToCart", Model.AddToCart, dataDictAddToCart)


I have gone to your demo site and the same problem occurs.

I am using Windows 8.1 and have tested it with Internet Explorer 11 and the latest Chrome Version 37.0.2062.120 m

neither of these browsers add a product on your demo site using


<input type="button" value="@(Model.ProductPrice.AvailableForPreOrder ? T("ShoppingCart.PreOrder") : T("ShoppingCart.AddToCart"))" class="button-2 product-box-add-to-cart-button" onclick="AjaxCart.addproducttocart_catalog('@addtocartlink');return false;" />
.
9 years ago
Andrei,

On dev server I am using:

Windows 8.1
Visual Studio 2013
ASP.NET 4.5 (MVC 5.0)
Microsoft .NET Framework 4.5.1
Fresh out of the box install (no mods at all)
9 years ago
Clicking on your demo featured products add to cart button does not add it to the cart. It takes you to the product details page. Same as on my dev server for Featured Products, Home Page products and Products in categories all of which are using _ProductBox and


<input type="button" value="@(Model.ProductPrice.AvailableForPreOrder ? T("ShoppingCart.PreOrder") : T("ShoppingCart.AddToCart"))" class="button-2 product-box-add-to-cart-button" onclick="AjaxCart.addproducttocart_catalog('@addtocartlink');return false;" />
9 years ago
RE: "...does not add it to the cart. It takes you to the product details page ..."

It depends on the product.  In the demo home page, try both HP Pavilion and  Build your own computer.  The latter has attributes (HDD, OS, etc.), so it goes to the product page to allow the customer to select them.
9 years ago
On the demo page clicking on either of those products takes me to the product details page and does not add it to the cart.

Are you using internet explorer 11 and the newest chrome like I am?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.