Jump to content

Masquer "Quantité" sur les produits et dans le panier


Recommended Posts

Bonjour,

je souhaiterai masquer "Quantité" sur mes produits et dans le panier > voir dans l'image.
J'ai un thème différent que "Classic" du Prestashop et je suis sur le thème que j'ai acheté c'est "CartZilla".

👉 Pouvez-vous m'aider s'il vous plait à changer les code de mon "produc-add-to-cart.tpl" ?

Dans le fichier que j'ai de mon thème qui est dans /themes/votre_theme/templates/catalog/_partials/product-add-to-cart.tpl

j'ai :

------------------------------------------------------------------------------------------------------------------

{**
 * Since 2021 PrestaSafe
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License 3.0 (AFL-3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/AFL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to [email protected] so we can send you a copy immediately.
 *
 * @author    PrestaSafe <[email protected]>
 * @copyright Since 2020 PrestaSafe
 * @license   https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
 * International Registered Trademark & Property of PrestaSafe
 *}
 <div class="product-add-to-cart mb-grid-gutter">
 {if isset($configuration.is_catalog) && !$configuration.is_catalog}
   {block name='product_minimal_quantity'}
     {if $product.minimal_quantity > 1}
       <p class="product-minimal-quantity font-size-sm">{l s='The minimum purchase order quantity for the product is %quantity%.' d='Shop.Theme.Checkout' sprintf=['%quantity%' => $product.minimal_quantity]}</p>
     {/if}
   {/block}

   {block name='product_quantity'}
     <div class="product-quantity">
     {if $product.delivery_in_stock}
       <div class="alert alert-warning mt-4 mb-4"><strong>{$product.delivery_in_stock|escape:'htmlall':'UTF-8'}</strong></div>
     {/if}
       <div class="d-flex align-items-center">
         <div class="qty mr-3">
           <input class="form-control" type="number" name="qty" id="quantity_wanted" value="{$product.quantity_wanted|escape:'htmlall':'UTF-8'}" min="{$product.minimal_quantity|escape:'htmlall':'UTF-8'}" aria-label="{l s='Quantity' d='Shop.Theme.Actions'}" style="width: 5rem;">
         </div>
         <div class="add w-100">
           <button class="btn btn-primary btn-block add-to-cart" type="submit" data-button-action="add-to-cart" {if !$product.add_to_cart_url}disabled{/if}><i class="czi-cart font-size-lg mr-2"></i>{l s='Add to cart' d='Shop.Theme.Actions'}</button>
         </div>
       </div>
       {hook h='displayProductActions' product=$product}
     </div>
   {/block}

   {block name='product_availability'}
     <div id="product-availability" class="font-weight-medium font-size-sm text-right text-{if $product.availability == 'available'}success{elseif $product.availability == 'last_remaining_items'}warning{else}danger{/if} mt-2">
       {if $product.show_availability && $product.availability_message}
         <span>{$product.availability_message|escape:'htmlall':'UTF-8'}</span>
       {/if}
     </div>
   {/block}
 {/if}
</div>

2- Add-Quantité.jpg

Link to comment
Share on other sites

Bonjour,

En remplaçant :

<input class="form-control" type="number" name="qty" id="quantity_wanted" value="{$product.quantity_wanted|escape:'htmlall':'UTF-8'}" min="{$product.minimal_quantity|escape:'htmlall':'UTF-8'}" aria-label="{l s='Quantity' d='Shop.Theme.Actions'}" style="width: 5rem;">

Par :

<input class="form-control" type="hidden" name="qty" id="quantity_wanted" value="{$product.quantity_wanted|escape:'htmlall':'UTF-8'}" min="{$product.minimal_quantity|escape:'htmlall':'UTF-8'}" aria-label="{l s='Quantity' d='Shop.Theme.Actions'}" style="width: 5rem;">

Cela devrait fonctionner.

Link to comment
Share on other sites

Il y a 5 heures, Eolia a dit :

en css :

.product-add-to-cart .product-quantity {display:none;}

Autrement vous ne verrez plus l'input mais quand même le mot "Quantité"

Bonjour,

Euh... pouvez-vous m'expliquer de que je dois faire, car je ne comprends pas ?

Merci

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...