Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified Add-to-card form and token function on homepage #443

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/js/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ $(() => {

// @TODO: Fix this on core.js side inside a major version of PrestaShop instead of minor
// For reference: https://github.com/PrestaShop/hummingbird/pull/418#discussion_r1061938669
document.querySelectorAll<HTMLInputElement>('[name="token"]').forEach((el) => {
document.querySelectorAll<HTMLInputElement>('#add_to_card_hp [name="token"]').forEach((el) => {
el.value = prestashop.static_token;
});

Expand Down
2 changes: 1 addition & 1 deletion templates/catalog/_partials/miniatures/product.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
</div>

{if $product.add_to_cart_url}
<form action="{$urls.pages.cart}" method="post" class="d-flex align-items-center mt-3">
<form action="{$urls.pages.cart}" method="post" class="d-flex align-items-center mt-3" id="add_to_card_hp">
<input type="hidden" value="{$product.id_product}" name="id_product">
<input type="hidden" name="token" value="{$static_token}" />
<div class="quantity-button js-quantity-button">
Expand Down