arnaud2A Posted January 21, 2014 Share Posted January 21, 2014 Bonjour à tous, J'utilise Prestashop pour un site btob permettant à mes clients de faire des demandes de devis. Je l'utilise donc en mode catalogue avec un module de demande de devis. En revanche, en mode catalogue, la case permettant de choisir la quantité de produits disparait. J'aimerais qu'elle soit aussi présente en mode catalogue, de manière à ce que le client puisse choisir, dans la page produit: les quantités, options, etc... avant d'envoyer sa demande de devis. Savez vous comment faire celà? Merci d'avance et bonne journée, Arnaud Link to comment Share on other sites More sharing options...
Szed Posted January 21, 2014 Share Posted January 21, 2014 Si vous inspecter votre code, vous verrez que le champ quantité est dans le formulaire #add_to_cart, qui prend une classe "hidden" si l'on est en mode catalogue. Cette classe cache l'ensemble du formulaire et tout ce qu'il contient Il vous faudrait la copier/coller pour la mettre dans le formulaire qui contient le bouton "devis" (par ailleurs, comment faites vous cela pour la demande de devis ?). Link to comment Share on other sites More sharing options...
CodeShaker Posted January 21, 2014 Share Posted January 21, 2014 Bonjour, Sur Prestashop 1.5.6.1 et thème de base à partir de la ligne 339 du fichier /themes/default/product.tpl. Remplacer ceci : <!-- quantity wanted --> <p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) OR $virtual OR !$product->available_for_order} style="display: none;"{/if}> <label>{l s='Quantity:'}</label> <input type="text" name="qty" id="quantity_wanted" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 1}{$product->minimal_quantity}{else}1{/if}{/if}" size="2" maxlength="3" {if $product->minimal_quantity > 1}onkeyup="checkMinimalQuantity({$product->minimal_quantity});"{/if} /> </p> <!-- minimal quantity wanted --> <p id="minimal_quantity_wanted_p"{if $product->minimal_quantity <= 1 OR !$product->available_for_order} style="display: none;"{/if}> {l s='This product is not sold individually. You must select at least'} <b id="minimal_quantity_label">{$product->minimal_quantity}</b> {l s='quantity for this product.'} </p> {if $product->minimal_quantity > 1} <script type="text/javascript"> checkMinimalQuantity(); </script> {/if} Par ceci : <!-- quantity wanted --> <p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) OR $virtual OR !$product->available_for_order} style="display: none;"{/if}> <label>{l s='Quantity:'}</label> <input type="text" name="qty" id="quantity_wanted" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 1}{$product->minimal_quantity}{else}1{/if}{/if}" size="2" maxlength="3" {if $product->minimal_quantity > 1}onkeyup="checkMinimalQuantity({$product->minimal_quantity});"{/if} /> </p> <!-- minimal quantity wanted --> <p id="minimal_quantity_wanted_p"{if $product->minimal_quantity <= 1 OR !$product->available_for_order} style="display: none;"{/if}> {l s='This product is not sold individually. You must select at least'} <b id="minimal_quantity_label">{$product->minimal_quantity}</b> {l s='quantity for this product.'} </p> {if $product->minimal_quantity > 1} <script type="text/javascript"> checkMinimalQuantity(); </script> {/if} Link to comment Share on other sites More sharing options...
arnaud2A Posted January 21, 2014 Author Share Posted January 21, 2014 Bonjour, Sur Prestashop 1.5.6.1 et thème de base à partir de la ligne 339 du fichier /themes/default/product.tpl. Remplacer ceci : <!-- quantity wanted --> <p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) OR $virtual OR !$product->available_for_order} style="display: none;"{/if}> <label>{l s='Quantity:'}</label> <input type="text" name="qty" id="quantity_wanted" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 1}{$product->minimal_quantity}{else}1{/if}{/if}" size="2" maxlength="3" {if $product->minimal_quantity > 1}onkeyup="checkMinimalQuantity({$product->minimal_quantity});"{/if} /> </p> <!-- minimal quantity wanted --> <p id="minimal_quantity_wanted_p"{if $product->minimal_quantity <= 1 OR !$product->available_for_order} style="display: none;"{/if}> {l s='This product is not sold individually. You must select at least'} <b id="minimal_quantity_label">{$product->minimal_quantity}</b> {l s='quantity for this product.'} </p> {if $product->minimal_quantity > 1} <script type="text/javascript"> checkMinimalQuantity(); </script> {/if} Par ceci : <!-- quantity wanted --> <p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) OR $virtual OR !$product->available_for_order} style="display: none;"{/if}> <label>{l s='Quantity:'}</label> <input type="text" name="qty" id="quantity_wanted" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 1}{$product->minimal_quantity}{else}1{/if}{/if}" size="2" maxlength="3" {if $product->minimal_quantity > 1}onkeyup="checkMinimalQuantity({$product->minimal_quantity});"{/if} /> </p> <!-- minimal quantity wanted --> <p id="minimal_quantity_wanted_p"{if $product->minimal_quantity <= 1 OR !$product->available_for_order} style="display: none;"{/if}> {l s='This product is not sold individually. You must select at least'} <b id="minimal_quantity_label">{$product->minimal_quantity}</b> {l s='quantity for this product.'} </p> {if $product->minimal_quantity > 1} <script type="text/javascript"> checkMinimalQuantity(); </script> {/if} Merci thech4n, Je n'utilise pas le thème par défaut et suis passé en version 1.5.6.2. Dans le fichier product.tpl de mon thème, le code est le suivant: <!-- quantity wanted --> <p id="quantity_wanted_p" class="clearfix"{if (!$allow_oosp && $product->quantity <= 0) OR $virtual OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}> <label>{l s='Quantity:'}</label> <input type="text" name="qty" id="quantity_wanted" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 1}{$product->minimal_quantity}{else}1{/if}{/if}" size="2" maxlength="3" {if $product->minimal_quantity > 1}onkeyup="checkMinimalQuantity({$product->minimal_quantity});"{/if} /> <span id="q_modify"> <span id="q_up">quantity up</span> <span id="q_down">quantity down</span> </span> </p> <!-- minimal quantity wanted --> <p id="minimal_quantity_wanted_p"{if $product->minimal_quantity <= 1 OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}> {l s='This product is not sold individually. You must select at least'} <b id="minimal_quantity_label">{$product->minimal_quantity}</b> {l s='quantity for this product.'} </p> {if $product->minimal_quantity > 1} <script type="text/javascript"> checkMinimalQuantity(); </script> {/if} Qu'est ce que je dois changer dans ces codes? Merci et bonne journée! Arnaud Link to comment Share on other sites More sharing options...
CodeShaker Posted January 21, 2014 Share Posted January 21, 2014 Dans ce bout de code, dans ce cas, supprimer " OR $PS_CATALOG_MODE" aux deux endroits auquels ceci est présent. Link to comment Share on other sites More sharing options...
arnaud2A Posted January 21, 2014 Author Share Posted January 21, 2014 Dans ce bout de code, dans ce cas, supprimer " OR $PS_CATALOG_MODE" aux deux endroits auquels ceci est présent. Un grand merci thech4n, ça fonctionne parfaitement! Un autre point.... désolé.... Il y a des minimum de commande par produit. (par ex: la quantité minimum de commande est de 25 produits.........) Egalement, ça ne s'affiche pas en mode catalogue. Connais tu la solution pour l'afficher? Un grand merci, Arnaud Link to comment Share on other sites More sharing options...
CodeShaker Posted January 21, 2014 Share Posted January 21, 2014 Avez-vous bien supprimer les deux " OR $PS_CATALOG_MODE"? Le premier fait disparaitre le champs quantité et le deuxième l'annonce de minimum de commande. 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