Close

2.80 Add To Cart problem

david.hirst
11 years ago
#1967 Quote
Avatar
  • 16
Hi, I'm new to nopcommerce and to this forum so I don't know whether this problem is a bug or a lack of experience in properly installing and setting things up.

I have the 2.80 store basically running okay with the Fashion theme installed. I have added some categories and have now added a single product in one of the categories (I chose not to put any sample data into this installation). If on the "category" view page I try to click the "Add to cart" button I get an error message popup (more later). However, if I click on the product image and go to the product page, when I click on the "Add to cart" button the "Just added to your basket" popup appears and I can click on "go to cart" and there the product is in the shopping cart all configured with the default choice of product specifications. So, it looks like there's no fundamental problem with either the product setup or the shopping cart.

The error I get when trying to add to the basket from the category page is " Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'. " I would be happy to cut-and-paste the full error message from the log file if anyone requires it but its very long and I don't want to abuse or overload this forum as I'm new around here and don't know the forum etiquette. Can anyone help? I realise this may not even be a "Theme" problem, but I don't yet know how much core store behaviour is replaced by the theme.

I realise that one "solution" may be to remove the "Add to cart" button from the category page, and in all honesty, I wasn't expecting one to be there as the product really does require configuring before purchase, even if just to be aware of and confirm the default options and I'll probably end up doing that and have to work out what code and where to tweak it. But there may just be a bug in the Fashion Theme that I have stumbled across ...

Thanks for reading this.

Boyko
11 years ago
#1970 Quote
Avatar
  • 1570
david.hirst wrote:
Hi, I'm new to nopcommerce and to this forum so I don't know whether this problem is a bug or a lack of experience in properly installing and setting things up.



Hi David,

Welcome to our Forums!

This sounds like a bug in the Ajax Cart plugin. We just released a new version of the Fashion theme and the plugins that come with it. You can find more information about the release here. Please follow the update instruction to update the theme and we are pretty sure the problem is fixed in the new version of the Ajax Cart.

Please let us know if you still have this issue after the update.
By the way could you check if you have in the Shopping Cart settings in the administration the "Display Cart after adding product" set? If so, then please disable it.

Best Regards,
Nop-Templates Support Team
Regards,
Nop-Templates.com Team
david.hirst
11 years ago
#1973 Quote
Avatar
  • 16
Hi Boyko,

Thanks, I've just downloaded and removed/replaced all the SevenSpikes. plugins in the plugins folder and restarted IIS. I have also added a space to the global.asax file. I haven't replaced anything in the "themes" folder. With the plugins replaced, I still get the same problem unfortunately.
Boyko
11 years ago
#1974 Quote
Avatar
  • 1570
david.hirst wrote:
Hi Boyko,

Thanks, I've just downloaded and removed/replaced all the SevenSpikes. plugins in the plugins folder and restarted IIS. I have also added a space to the global.asax file. I haven't replaced anything in the "themes" folder. With the plugins replaced, I still get the same problem unfortunately.


Hi David,

You should have replaced the theme folder as well as the plugins are now integrated as widgets i.e the Ajax cart plugin.
Could you send us an email to support at nop-templates.com with a link to your web site, so that we can investigate?

Thanks
Regards,
Nop-Templates.com Team
david.hirst
11 years ago
#1975 Quote
Avatar
  • 16
... quick update ... further to my last post, I've started going through the admin panel and turning things off and back on and so on, and now add to cart on the category pages takes me through to the product page ... so it looks like it is now working. I'll come back and possibly post further comment after testing more!
david.hirst
11 years ago
#1976 Quote
Avatar
  • 16
oops - cross-post. I'll update the themes folder as well then. I know I've made some layout tweaks in there so I'll be careful :-)
Boyko
11 years ago
#1977 Quote
Avatar
  • 1570
david.hirst wrote:
oops - cross-post. I'll update the themes folder as well then. I know I've made some layout tweaks in there so I'll be careful :-)


Hi David,

You can use BeyondCompare to merge your changes back. It is a great tool and it allows you to compare files in Folders as well.

Thanks
Regards,
Nop-Templates.com Team
david.hirst
11 years ago
#1978 Quote
Avatar
  • 16
I have now also updated the Fashion theme, restarted IIS and done repeated testing. Basically, it is still broken in the way originally posted. Testing has revealed that if I turn "Enable Nop Ajax Cart" off in the Nop Ajax Cart plugin settings of the admin panel then on the category page, the "Add To Cart" button simply transfers me to the product page but when it is turned on (and the Ajax Cart activated) clicking the "Add To Basket" button causes a popup error message to appear so this is evidence that it is the Ajax Cart plugin that is failing.

Further, if the Ajax cart is enabled, but I disable "Enable Nop Ajax Cart on Catalog Pages" no "Add To Cart" button appears at all on the category page which is how I think I originally expected the page to behave. So, the fix for me is to disable "Ajax Cart on Catalog Pages" but I am aware there is probably still a bug in the Ajax Cart code that you may want to fix. I am only running the site on my development system (PC) so I cannot offer you access to it, but if there's anything else I can do to help diagnose the problem please let me know.
david.hirst
11 years ago
#1989 Quote
Avatar
  • 16
Well, after quite a bit more testing I've got the Ajax cart working on the category page on my site. I won't bore you with how I worked out the problem, but here's what I had to do: I had created a new product page layout in the Themes/Fashion/Views/Catalog folder which was initially a copy of the "ProductTemplate.VariantsInGrid.cshtml" but I had made some minor layout tweaks. In the "ProductTemplate" Table in the DB this template had been assigned an Id of 5, even though there were only Ids 1 and 2 also in use. When I manualy remvoved the additional entry and re-seeded the table with DBCC CHECKIDENT('ProductTemplateCustomer', RESEED, 2) I could then add a new entry for my new template and it received the Id of 3. The Ajax cart then started working. Is there a bug such that the Ajax cart fails on the category page if the product templates do not have sequential Ids in the ProdcutTemplate table?
Boyko
11 years ago
#1990 Quote
Avatar
  • 1570
david.hirst wrote:
Is there a bug such that the Ajax cart fails on the category page if the product templates do not have sequential Ids in the ProdcutTemplate table?


Hi David,

I don't think so. We use the same template that is used on the product page. Probably the problem is that the new template does not exist in the Ajax Cart plugin.
There are two predefined templates that match the two existing templates:
SevenSpikes.Nop.Plugins.AjaxCart\Views\NopAjaxCartCatalog\ProductTemplate.SingleVariant.cshtml
SevenSpikes.Nop.Plugins.AjaxCart\Views\NopAjaxCartCatalog\ProductTemplate.VariantsInGrid.cshtml

So if you add a new templates you might need to copy one of the templates and name it to match your new template. Probably that has been the case or it might also be a caching issues as once we get the templates id of the product it is being cached and will use the same template id till you don't restart the web site. This is so as we don't change the product templates so often and improves performance. Actually nopCommerce caches the product templates as well.

Hope this helps!

Thanks
Regards,
Nop-Templates.com Team