monsoonconsulting/magento2-hyva-ajax-add-to-cart

Cannot add product from category page

Aquive opened this issue · 1 comments

Describe the bug
Adding product from product page works as expected. When adding a product from category page there is an error. The product is added after a reload though.

Flash message shows: There was a problem adding your item to the cart.
Browser console shows: POST https://<domain>/nl/checkout/cart/add/uenc/%25uenc%25/product/1000816/ 400

EDIT:

I compared the post header for product page (working) to category page (not working). There is a difference in the path. In the working one it has an encoded part. Like this:

:path: /nl/checkout/cart/add/uenc/aHR0cHM6Ly9mYXN0LmhvcmVjYS5zaG9wL25sL3ZsZWVzaGFhay1ydnMtODB4LTRtbS04NTIwODQ%2C/product/1118513/

The not working one has the following path:

:path: /nl/checkout/cart/add/uenc/%25uenc%25/product/1118513/

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'product listing page (category page)'
  2. Click on 'add to cart' for any product
  3. See errors

Expected behavior
Adding the product to cart without reload, without error flash message and without console errors

Device Info (please complete the following information):

  • Device: Desktop
  • OS: Manjaro Linux
  • Browser: Chrome

Magento version
Magento ver. 2.4.5

Hyva Versions
Hyvä Default Theme: 1.1.17
Hyvä Theme Module: 1.1.17

Hello @Aquive, as discussed via Slack. This issue was not related to the module.