fredekac Posted December 5, 2012 Share Posted December 5, 2012 Bonjour à tous, En fait, j'ai un produit qui se vend par lot à 99% de temps (1% à l'unité) mais beaucoup de personnes se trompent, il prennent 10x l'article au lieu de prendre 1 lot de 10 --> ce n'est pas le même prix ! J'ai à peu près 10% des commandes qui se fait par quantité au lieu par lot... c'est trop. Le produit en question : http://doggy-diffusion.fr/piles-et-batteries/32-piles-4lr44.html Du coup, j'ai des personnes qui me mail, téléphone en pré ou post commande pour me dire que le prix ne correspond pas. Du coup, je suis sollicité alors qu'il n'y à pas lieu, en plus je ne sais même pas quelle est la proportion de clients qui rebroussent chemin en ne voyant pas le bon tarif s'appliquer. Pourmoi, cette proportion reste conséquente. Retirer cette fonction quantité me serait très très utile, mais j'en ai besoins sur les autres produit ! Si quelqu'un connait une astuce ce serait sympa car rien de ce que j'ai trouvé sur mes recherches pourrait me contenter. Link to comment Share on other sites More sharing options...
Stéphane Chonez Posted December 7, 2012 Share Posted December 7, 2012 Bonjour, en mettant une condition sur le produit autour du bloc quantité... il faut connaitre l'id du produit et ne pas afficher le bloc si c'est le bon produit {if $product.id_product != XX} <p id="quantity_wanted_p"{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} /> </p> {/if} Link to comment Share on other sites More sharing options...
fredekac Posted December 7, 2012 Author Share Posted December 7, 2012 Merci Stéphane, J'y suis un peu novice donc si je comprends bien, je dois trouver dans le fichier la ligne qui correspond à mon produit (ici : 32-piles-4lr44, donc "32") et mettre "product->quantity <= 0. Où dois-je coller tout ton code ? Dans quel fichier je trouves cela ? Merci beaucoup de ton aide, ça va en intéresser d'autres, je le sens ! Link to comment Share on other sites More sharing options...
Stéphane Chonez Posted December 7, 2012 Share Posted December 7, 2012 dans le fichier product.tpl de ton thème.... repère ça : <p id="quantity_wanted_p"{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} /> </p> et rajoute autour le {if ..} {/if} comme ceci : {if $product.id_product != 32} <p id="quantity_wanted_p"{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} /> </p> {/if} en gros si le produit est différent du produit avec l'id 32 on affiche la quantité sinon le bloc quantité ne s'affiche pas ! Link to comment Share on other sites More sharing options...
fredekac Posted December 7, 2012 Author Share Posted December 7, 2012 Il y a quelque chose que j'ai du mal faire, toute mes quantités ont disparues et tout ce qui suis en bas de mes fiches produits, regardes le produit concerné ici ou un autre au hasard ici : J'ai mis dans le product.tpl de mon thème : <!-- quantity wanted --> {if $product.id_product != 32} <p id="quantity_wanted_p"{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} /> </p> {/if} Je n'ai que rajouter les deux lignes : {if $product.id_product != 32} {/if} Link to comment Share on other sites More sharing options...
Stéphane Chonez Posted December 7, 2012 Share Posted December 7, 2012 excuse j'suis allé un peu vite en besogne car il existe une condition dans le code existant qui permet de mettre le bloc en "display:none;" sous diverses conditions... <p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) OR $virtual OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}> donc il faut rajouter 'notre condition' si on affiche la fiche produit de l'objet numéro 32 ! comme ceci <p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) OR $virtual OR !$product->available_for_order OR $PS_CATALOG_MODE OR $product->id == 32} style="display: none;"{/if}> ça devrait être mieux ;-) Link to comment Share on other sites More sharing options...
fredekac Posted December 7, 2012 Author Share Posted December 7, 2012 Ca ne fonctionne toujours pas. Mon code complet est le suivant : <!-- quantity wanted --> {if $product.id_product != 32} <p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) OR $virtual OR !$product->available_for_order OR $PS_CATALOG_MODE OR $product->id == 32} 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> {/if} D'où pourrait provenir l'erreur ? Link to comment Share on other sites More sharing options...
Stéphane Chonez Posted December 7, 2012 Share Posted December 7, 2012 par contre avec la seconde méthode retire {if $product.id_product != 32} ... {/if} désolé j'ai pas reprécisé ;-) Link to comment Share on other sites More sharing options...
fredekac Posted December 7, 2012 Author Share Posted December 7, 2012 Mon catalogue est revenu mais la quantité du produit en question est toujours là ! Mon code : <!-- quantity wanted --> <p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) OR $virtual OR !$product->available_for_order OR $PS_CATALOG_MODE OR $product->id == 32} 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> Link to comment Share on other sites More sharing options...
Stéphane Chonez Posted December 7, 2012 Share Posted December 7, 2012 bizare, je viens de faire le test chez moi et ça fonctionne ! cache vidé ? (BO > Préfrences > performances ) Link to comment Share on other sites More sharing options...
fredekac Posted December 7, 2012 Author Share Posted December 7, 2012 oui, j'ai désactivé le cache et forcé la compilation (depuis le début des tests) D'où cela proviendrait-il ? De mon thème ? Link to comment Share on other sites More sharing options...
Stéphane Chonez Posted December 7, 2012 Share Posted December 7, 2012 vérifiér si tu travail sur le bon fichier du bon thème!! Link to comment Share on other sites More sharing options...
fredekac Posted December 7, 2012 Author Share Posted December 7, 2012 Oui, c'est le bon fichier du bon thème sinon ça n'aurait pas modifier les fiches produit tout à l'heure ! 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