Skip to content

Commit

Permalink
Revert "Merge pull request PrestaShop#418 from NeOMakinG/addtocart-pr…
Browse files Browse the repository at this point in the history
…oduct-list"

This reverts commit 8b69e0c, reversing
changes made to f6e7702.
  • Loading branch information
sudo-do committed Jan 28, 2023
1 parent 9aa972c commit b0c3ec6
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 31 deletions.
6 changes: 0 additions & 6 deletions src/js/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ initEmitter();
$(() => {
const {prestashop, Theme: {events}} = window;

// @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) => {
el.value = prestashop.static_token;
});

initProductBehavior();
initQuickview();
initCheckout();
Expand Down
24 changes: 0 additions & 24 deletions templates/catalog/_partials/miniatures/product.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -168,30 +168,6 @@
{/block}
</div>

{if $product.add_to_cart_url}
<form action="{$urls.pages.cart}" method="post" class="d-flex align-items-center mt-3">
<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">
{include file='components/qty-input.tpl'
attributes=[
"id"=>"quantity_wanted_{$product.id_product}",
"value"=>"1",
"min"=>"{if $product.quantity_wanted}{$product.minimal_quantity}{else}1{/if}"
]
marginHelper="mb-0"
}
</div>
<button data-button-action="add-to-cart" class="btn btn-primary ms-3">
<i class="material-icons">&#xe854;</i>
<span class="visually-hidden">{l s='Add to cart' d='Shop.Theme.Actions'}</span>
</button>
</form>
{else}
<a href="{$product.url}" class="btn btn-outline-primary mt-3">
{l s='See details' d='Shop.Theme.Actions'}
</a>
{/if}
</div>
</div>
{/block}
Expand Down
2 changes: 1 addition & 1 deletion templates/components/qty-input.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{assign var="append" value=["button"=>"increment", "icon"=>$increment_icon, "confirm_icon"=>$submit_icon]}
{/if}

<div class="input-group flex-nowrap{if isset($marginHelper)} {$marginHelper}{else} mb-3{/if}">
<div class="input-group flex-nowrap mb-3">
<button class="btn {$prepend.button} js-{$prepend.button}-button" type="button">
<i class="material-icons">&#x{$prepend.icon};</i>
<i class="material-icons confirmation d-none">&#x{$prepend.confirm_icon};</i>
Expand Down

0 comments on commit b0c3ec6

Please sign in to comment.