You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Into-Cart Action on category-page results in wrong API call:
checkout/cart/add/uenc/%25uenc%25/product/1394/
To Reproduce
Steps to reproduce the behavior:
Go to category page
Click on into-cart-button
See error in console / network
Magento version
Magento ver. 2.4.7-p1
Hyva Versions
Hyvä Default Theme: ver. 1.3.9 (latest)
Solving
The error comes from
vendor\monsoonconsulting\magento2-hyva-ajax-add-to-cart\view\frontend\templates\hyva\script\addtocart.phtml
line 31: e.preventDefault();
This line deactivates the functionality in hyvä file:
vendor\hyva-themes\magento2-theme-module\src\view\frontend\templates\page\js\set-uenc.phtml
So this line of code in set-uenc.phtml is never called:
event.target.action.replace('%25uenc%25', hyva.getUenc())
and the result is, that the form URL is the wrong from above:
checkout/cart/add/uenc/%25uenc%25/product/1394/
So solve the issue, the following line must be included in
vendor\monsoonconsulting\magento2-hyva-ajax-add-to-cart\view\frontend\templates\hyva\script\addtocart.phtml:
Describe the bug
Into-Cart Action on category-page results in wrong API call:
checkout/cart/add/uenc/%25uenc%25/product/1394/
To Reproduce
Steps to reproduce the behavior:
Magento version
Magento ver. 2.4.7-p1
Hyva Versions
Hyvä Default Theme: ver. 1.3.9 (latest)
Solving
The error comes from
vendor\monsoonconsulting\magento2-hyva-ajax-add-to-cart\view\frontend\templates\hyva\script\addtocart.phtml
line 31: e.preventDefault();
This line deactivates the functionality in hyvä file:
vendor\hyva-themes\magento2-theme-module\src\view\frontend\templates\page\js\set-uenc.phtml
So this line of code in set-uenc.phtml is never called:
event.target.action.replace('%25uenc%25', hyva.getUenc())
and the result is, that the form URL is the wrong from above:
checkout/cart/add/uenc/%25uenc%25/product/1394/
So solve the issue, the following line must be included in
vendor\monsoonconsulting\magento2-hyva-ajax-add-to-cart\view\frontend\templates\hyva\script\addtocart.phtml:
e.target.action = e.target.action.replace('%25uenc%25', hyva.getUenc());
It must be inserted before:
e.preventDefault();
The text was updated successfully, but these errors were encountered: