Lolinesi Posted May 8, 2017 Share Posted May 8, 2017 Bonjour à tous, Je suis sur Prestashop 1.6.1.8 en local pour le moment. Je souhaiterai mettre le bouton ajouter au panier sur la page product-list (affichage en Liste). J'ai réussi à le faire mais lorsque l'on clique sur le bouton ajouter au panier, j'ai le message d'erreur suivant qui s'affiche dans une pop up : "Product not found. This Product is no available." Par contre, lorsque je clique sur le bouton "ajouter au panier"de la fiche produit, tout fonctionne. Je remercie par avance ceux qui pourront m'apporter leurs idées et j'espère même la solution Dans cette attente, je vous souhaite une excellente journée. Link to comment Share on other sites More sharing options...
Eolia Posted May 8, 2017 Share Posted May 8, 2017 C'est natif dans le thème par défaut. Si le bouton ne s'affiche pas c'est que vous avez décoché l'option "Afficher le bouton "ajouter au panier" lorsque le produit a des attributs" dans les préférences -> produit (Afficher ou masquer le bouton "Ajouter au panier" sur les pages catégories des produits qui ont des attributs pour forcer les clients à voir le détail du produit.) Link to comment Share on other sites More sharing options...
Lolinesi Posted May 8, 2017 Author Share Posted May 8, 2017 Bonjour Eolia, Merci pour ta réponse. Cette option est bien cochée dans le back-office (vois pièce jointe). Merci pour ton aide. Link to comment Share on other sites More sharing options...
Eolia Posted May 8, 2017 Share Posted May 8, 2017 Avez-vous bien ce code dans votre product-list.tpl ? {if ($product.id_product_attribute == 0 || (isset($add_prod_display) && ($add_prod_display == 1))) && $product.available_for_order && !isset($restricted_country_mode) && $product.customizable != 2 && !$PS_CATALOG_MODE} {if (!isset($product.customization_required) || !$product.customization_required) && ($product.allow_oosp || $product.quantity > 0)} {capture}add=1&id_product={$product.id_product|intval}{if isset($product.id_product_attribute) && $product.id_product_attribute}&ipa={$product.id_product_attribute|intval}{/if}{if isset($static_token)}&token={$static_token}{/if}{/capture} <a class="button ajax_add_to_cart_button btn btn-default" href="{$link->getPageLink('cart', true, NULL, $smarty.capture.default, false)|escape:'html':'UTF-8'}" rel="nofollow" title="{l s='Add to cart'}" data-id-product-attribute="{$product.id_product_attribute|intval}" data-id-product="{$product.id_product|intval}" data-minimal_quantity="{if isset($product.product_attribute_minimal_quantity) && $product.product_attribute_minimal_quantity >= 1}{$product.product_attribute_minimal_quantity|intval}{else}{$product.minimal_quantity|intval}{/if}"> <span>{l s='Add to cart'}</span> </a> {else} <span class="button ajax_add_to_cart_button btn btn-default disabled"> <span>{l s='Add to cart'}</span> </span> {/if} {/if} Link to comment Share on other sites More sharing options...
doekia Posted May 8, 2017 Share Posted May 8, 2017 Encore un theme bancale on dirait. Probablement qu'en duplicant la section du bouton tu as omis de convertir les $product->id en $product.id_product Link to comment Share on other sites More sharing options...
Lolinesi Posted May 8, 2017 Author Share Posted May 8, 2017 Merci pour vos réponses. Dans le code de mon product-list.tpl, il manquait ce code : {if ($product.id_product_attribute == 0 || (isset($add_prod_display) && ($add_prod_display == 1))) && $product.available_for_order && !isset($restricted_country_mode) && $product.customizable != 2 && !$PS_CATALOG_MODE} {if (!isset($product.customization_required) || !$product.customization_required) && ($product.allow_oosp || $product.quantity > 0)} {capture}add=1&id_product={$product.id_product|intval}{if isset($product.id_product_attribute) && $product.id_product_attribute}&ipa={$product.id_product_attribute|intval}{/if}{if isset($static_token)}&token={$static_token}{/if}{/capture} <a class="button ajax_add_to_cart_button btn btn-default" href="{$link->getPageLink('cart', true, NULL, $smarty.capture.default, false)|escape:'html':'UTF-8'}" rel="nofollow" title="{l s='Add to cart'}" data-id-product-attribute="{$product.id_product_attribute|intval}" data-id-product="{$product.id_product|intval}" data-minimal_quantity="{if isset($product.product_attribute_minimal_quantity) && $product.product_attribute_minimal_quantity >= 1}{$product.product_attribute_minimal_quantity|intval}{else}{$product.minimal_quantity|intval}{/if}"> <span>{l s='Add to cart'}</span> </a> {else} <span class="button ajax_add_to_cart_button btn btn-default disabled"> <span>{l s='Add to cart'}</span> </span> {/if} {/if} Merci beaucoup pour votre aide. Très belle journée à vous. Link to comment Share on other sites More sharing options...
Lolinesi Posted May 8, 2017 Author Share Posted May 8, 2017 Je me permets de poster ici une nouvelle demande. Je souhaiterai que mes prix s'affichent en HT d'abord puis en TTC. J'ai bien trouvé quelques infos mais cela ne fonctionne pas. Si je peux profiter de votre expertise, je vous remercie par avance Bonne journée Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now