Embalim
Members-
Posts
18 -
Joined
-
Last visited
Embalim's Achievements
-
UPDATE : J'ai résolu le problème en supprimant tout simplement le fichier order.php (que j'ai du ajouté par inadvertance ) et dans l'option "désactiver toutes les surcharges" > NON
-
Hello ! J'ai un soucis depuis un moment concernant l'ajout au panier. Je m'explique : Depuis le back office, lorsque j'active toutes les surcharges (paramètres avancées > performances > mode debug > surchages : NON), notamment celles de mon thème je rencontre ce problème : Si je désactive les surcharges tout fonctionne mais certains paramètres de modules sont défectueux, comme le hover aux images ou le module de recherche... Au lieu de bidouiller chaque module je voulais savoir si il y avait une solution à l'origine de ce problème. Il me semble pas que le fichier order.php soit mauvais : La ligne 14 en question : "return $id_order_max+1;" <?php class Order extends OrderCore { /** * Gennerate a unique reference for orders generated with the same cart id * This references, is usefull for check payment * * @return String */ public static function generateReference() { $id_order_max = 8880 return $id_order_max+1; } } Configuration : Prestashop 1.6.1.10 Merci à vous !!
-
Cumuler pourcentage de réduction sur dégressivités
Embalim replied to Embalim's topic in PrestaShop pour les développeurs
Update : J'ai essayé de mettre un prix fixe sur chaque quantité (en prix spécifique) et d'ajouter un pourcentage de réduction à partir de 1 mais rien n'y fait ... J'ai également réalisé la même opération sur des produits vendus par lot de 1 donc l'incrémentation basique de Prestashop mais même résultat... Pouvez-vous m'aider ? Merci -
Bonjour, Je rencontre un problème actuellement sur un cumul de pourcentage de réduction et dégressivités. Je m'explique : Je vends des produits disponibles par lot ! Exemple : par 6, 12, 18, 24 etc J'ai appliqué une réduction (en euro) via les prix spécifiques, à partir de 12, 18, 24 ! Exemple : Prix pour 6 (de base) : 15,91€ A partir de 12 : -3,18€ A partir de 18 : -4,77€ Etc. Je précise que j'ai modifié l'incrémentation de ce produit pour démarrer à 6 puis multiple de 6 : 12, 18, 24 Or, quand je veux appliquer un pourcentage de réduction sur toutes les quantités dispo, le pourcentage se fait que sur le prix de base et non sur les dégressivités ! J'ai mis en place 20% de réduction à partir de 1 quantité. Exemple : Pour 6 : 15,91€ x 20% x 6 (quantité) = 76.37€ (C'est ok !) Pour 12 : 15.91 - 3.18€ (la dégressivité) x 20% x 12 (quantité) : 122.21€ (c'est le résultat que je souhaite !) Mais j'obtiens : 152.76€ soit : 15.91 - 3.18 x 12 Il ne prends donc pas en compte les 20% de réduction. Il va appliquer directement la réduction en euros (uniquement) à partir de 12. J'ai essayé de mettre 20% de réduction à partir de 7 mais ça ne fonctionne pas. J'espère que j'ai été clair Merci ! Version Prestashop : 1.6.1.10
-
Passage à la ligne dans le block top menu
Embalim replied to fab59000's topic in PrestaShop pour les développeurs
Hum ok ! Je ne connais pas plus loin le fonctionnement de Prestashop après donc ça va être compliqué pour moi ^^ Peut-être qu'il faut mettre le <br> à un autre endroit dans le code... ou ce n'est pas le bon fichier.tpl lol Je laisse la place à quelqu'un de plus expérimenté Bon courage ! -
Passage à la ligne dans le block top menu
Embalim replied to fab59000's topic in PrestaShop pour les développeurs
A quoi correspond la première ligne ? dans quel fichier est-elle ? BD ? c'est à dire ? Je pense que tu devras faire les modifications dans ton CSS... Après, sans voir ton site, j'ai du mal à visualiser ^^ -
Passage à la ligne dans le block top menu
Embalim replied to fab59000's topic in PrestaShop pour les développeurs
Je ne saisis pas clairement ta demande Fab... Modifie directement le fichier.tpl avec des <br> là ou tu en as besoin. -
Passage à la ligne dans le block top menu
Embalim replied to fab59000's topic in PrestaShop pour les développeurs
Essaye d'ajouter les balises <br> directement dans le fichier TPL et non depuis le back office. Si ça ne fonctionne pas il me faudrait le lien vers ton site -
Passage à la ligne dans le block top menu
Embalim replied to fab59000's topic in PrestaShop pour les développeurs
Hello Fab, Je ne vois pas trop à quoi ressemble tes libellés mais tu peux essayer ceci : A chaque fin de ligne de code (où se situe ton libellé) tu ajoutes cette balise : </br> ou <br>, c'est un saut de ligne Ou alors tu modifies ton CSS pour changer les tailles de tes <div>. -
Bonjour, Je souhaite supprimer le lien d'ajout au panier dans la liste des produits disponibles pour rediriger vers la fiche produit uniquement. Ensuite sur la fiche produit, il sera possible d'ajouter au panier avec le lien d'ajout classique. J'ai procédé par étape : Modification traduction dans le BO : Ajouter au panier > Voir le produit Modification du lien d'ajout au panier vers fiche produit sur le bouton "Voir le produit" dans product-list : a class="title_font button_cart button ajax_add_to_cart_button btn btn-default" href="{$link->getProductLink($product)|escape:'html':'UTF-8'}" Or, c'est là que l'Ajax rentre en compte...le lien est bon mais je ne suis pas redirigé vers la fiche produit ... le produit est directement ajouté au panier.. J'ai essayé de désactiver l'Ajax dans le module Bloc Panier mais évidemment maintenant je n'ai plus aucune animation et un renvoi direct vers le tunnel de commande lorsqu'on clique sur ajouter au panier. Donc ma question serait : Est-il possible de supprimer l'Ajax uniquement sur la page product-list ? N'hésitez pas à demander si vous avez besoin Merci !! PS : j'ai modifié la classe du lien en supprimant "ajax_add_to_cart_button" et ça fonctionne mais le CSS est complètement modifié.... un autre moyen peut-être ?
-
Transfert client WooCommerce vers Prestashop
Embalim replied to Embalim's topic in PrestaShop pour les développeurs
Hello Johan, Merci pour ces 2 propositions Je pense utiliser la première (plus simple pour moi lol) ! Avec une petite méthode explicative, c'est plié ! Merci !! -
Hello, Je souhaite migrer mon site actuel sous Wordpress / WooCommerce vers un Prestashop. J'ai déjà récupéré les contenus, photos, clients via des exports puis imports sur Presta. Toutefois, concernant les mots de passe clients j'ai un souci... Est-il possible de récupérer chaque mot de passe client depuis WooCommerce et de les attribuer au bon compte client sur Prestashop ? J'ai lu plusieurs sujets précisant que les mots de passe sur Wordpress et Prestashop étaient cryptés différemment... Mais existe-il une solution tout de même ? Merci
-
How to increment product quantity of 10 units
Embalim replied to ilclaudio's topic in Configuring and using PrestaShop
Hello, Just to let you know (if it can help someone) Here is my solution (can be improve of course) : Product.tpl : Just after <div class="product_attributes clearfix"> First, I declare my variables Then "if" condition with differents increments per 10, 20, 25, 50 (as you want) And finally the "else" for just an increment of one {if !$PS_CATALOG_MODE} {assign cat37 [['id_category' => 37]]} {assign cat38 [['id_category' => 38]]} {assign cat39 [['id_category' => 39]]} {assign cat40 [['id_category' => 40]]} {assign cat41 [['id_category' => 41]]} {if Product::idIsOnCategoryId($smarty.get.id_product, $cat37)} <p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}> <label for="quantity_wanted">{l s='Quantity'}</label> <input type="text" min="10" name="qty" id="quantity_wanted" class="text" disabled="disabled" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 10}{$product->minimal_quantity}{else}10{/if}{/if}" /> <a href="#" data-field-qty="qty" class="btn btn-default button-minus product_quantity_down_10"> <span><i class="icon-minus"></i></span> </a> <a href="#" data-field-qty="qty" class="btn btn-default button-minus product_quantity_up_10"> <span><i class="icon-plus"></i></span> </a> </p> {elseif Product::idIsOnCategoryId($smarty.get.id_product, $cat38)} <p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}> <label for="quantity_wanted">{l s='Quantity'}</label> <input type="text" min="20" name="qty" id="quantity_wanted" class="text" disabled="disabled" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 20}{$product->minimal_quantity}{else}20{/if}{/if}" /> <a href="#" data-field-qty="qty" class="btn btn-default button-minus product_quantity_down_20"> <span><i class="icon-minus"></i></span> </a> <a href="#" data-field-qty="qty" class="btn btn-default button-minus product_quantity_up_20"> <span><i class="icon-plus"></i></span> </a> </p> {elseif Product::idIsOnCategoryId($smarty.get.id_product, $cat39)} <p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}> <label for="quantity_wanted">{l s='Quantity'}</label> <input type="text" min="25" name="qty" id="quantity_wanted" class="text" disabled="disabled" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 25}{$product->minimal_quantity}{else}25{/if}{/if}"/> <a href="#" data-field-qty="qty" class="btn btn-default button-minus product_quantity_down_25"> <span><i class="icon-minus"></i></span> </a> <a href="#" data-field-qty="qty" class="btn btn-default button-minus product_quantity_up_25"> <span><i class="icon-plus"></i></span> </a> </p> {elseif Product::idIsOnCategoryId($smarty.get.id_product, $cat41)} <p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}> <label for="quantity_wanted">{l s='Quantity'}</label> <input type="text" min="6" name="qty" id="quantity_wanted" class="text" disabled="disabled" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 6}{$product->minimal_quantity}{else}6{/if}{/if}" /> <a href="#" data-field-qty="qty" class="btn btn-default button-minus product_quantity_down_6"> <span><i class="icon-minus"></i></span> </a> <a href="#" data-field-qty="qty" class="btn btn-default button-minus product_quantity_up_6"> <span><i class="icon-plus"></i></span> </a> </p> {elseif Product::idIsOnCategoryId($smarty.get.id_product, $cat40)} <p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}> <label for="quantity_wanted">{l s='Quantity'}</label> <input type="text" min="50" name="qty" id="quantity_wanted" class="text" disabled="disabled" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 50}{$product->minimal_quantity}{else}50{/if}{/if}" /> <a href="#" data-field-qty="qty" class="btn btn-default button-minus product_quantity_down_50"> <span><i class="icon-minus"></i></span> </a> <a href="#" data-field-qty="qty" class="btn btn-default button-minus product_quantity_up_50"> <span><i class="icon-plus"></i></span> </a> </p> {else} <p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}> <label for="quantity_wanted">{l s='Quantity'}</label> <input type="number" min="1" name="qty" id="quantity_wanted" disabled="disabled" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 1}{$product->minimal_quantity}{else}1{/if}{/if}" /> <a href="#" data-field-qty="qty" class="btn btn-default button-minus product_quantity_down"> <span><i class="icon-minus"></i></span> </a> <a href="#" data-field-qty="qty" class="btn btn-default button-plus product_quantity_up"> <span><i class="icon-plus"></i></span> </a> <span class="clearfix"></span> </p> {/if} {/if} Product.js : Just under the comment : // The button to increment the product value You already have the script for 1 quantity and then you duplicate for 10, 20, 25, 50 (as you want) $(document).on('click', '.product_quantity_up_10', function(e){ e.preventDefault(); fieldName = $(this).data('field-qty'); var currentVal = parseInt($('input[name='+fieldName+']').val()); if (!allowBuyWhenOutOfStock && quantityAvailable > 0) quantityAvailableT = quantityAvailable; else quantityAvailableT = 100000000; if (!isNaN(currentVal) && currentVal < quantityAvailableT) $('input[name='+fieldName+']').val(currentVal + 10).trigger('keyup'); else $('input[name='+fieldName+']').val(quantityAvailableT); $('#quantity_wanted').change(); }); // The button to decrement the product value $(document).on('click', '.product_quantity_down_10', function(e){ e.preventDefault(); fieldName = $(this).data('field-qty'); var currentVal = parseInt($('input[name='+fieldName+']').val()); if (!isNaN(currentVal) && currentVal > 1 && currentVal > 10) $('input[name='+fieldName+']').val(currentVal - 10).trigger('keyup'); else $('input[name='+fieldName+']').val(10); $('#quantity_wanted').change(); }); $(document).on('click', '.product_quantity_up_20', function(e){ e.preventDefault(); fieldName = $(this).data('field-qty'); var currentVal = parseInt($('input[name='+fieldName+']').val()); if (!allowBuyWhenOutOfStock && quantityAvailable > 0) quantityAvailableT = quantityAvailable; else quantityAvailableT = 100000000; if (!isNaN(currentVal) && currentVal < quantityAvailableT) $('input[name='+fieldName+']').val(currentVal + 20).trigger('keyup'); else $('input[name='+fieldName+']').val(quantityAvailableT); $('#quantity_wanted').change(); }); // The button to decrement the product value $(document).on('click', '.product_quantity_down_20', function(e){ e.preventDefault(); fieldName = $(this).data('field-qty'); var currentVal = parseInt($('input[name='+fieldName+']').val()); if (!isNaN(currentVal) && currentVal > 1 && currentVal > 20) $('input[name='+fieldName+']').val(currentVal - 20).trigger('keyup'); else $('input[name='+fieldName+']').val(20); $('#quantity_wanted').change(); }); $(document).on('click', '.product_quantity_up_25', function(e){ e.preventDefault(); fieldName = $(this).data('field-qty'); var currentVal = parseInt($('input[name='+fieldName+']').val()); if (!allowBuyWhenOutOfStock && quantityAvailable > 0) quantityAvailableT = quantityAvailable; else quantityAvailableT = 100000000; if (!isNaN(currentVal) && currentVal < quantityAvailableT) $('input[name='+fieldName+']').val(currentVal + 25).trigger('keyup'); else $('input[name='+fieldName+']').val(quantityAvailableT); $('#quantity_wanted').change(); }); // The button to decrement the product value $(document).on('click', '.product_quantity_down_25', function(e){ e.preventDefault(); fieldName = $(this).data('field-qty'); var currentVal = parseInt($('input[name='+fieldName+']').val()); if (!isNaN(currentVal) && currentVal > 1 && currentVal > 25) $('input[name='+fieldName+']').val(currentVal - 25).trigger('keyup'); else $('input[name='+fieldName+']').val(25); $('#quantity_wanted').change(); }); $(document).on('click', '.product_quantity_up_50', function(e){ e.preventDefault(); fieldName = $(this).data('field-qty'); var currentVal = parseInt($('input[name='+fieldName+']').val()); if (!allowBuyWhenOutOfStock && quantityAvailable > 0) quantityAvailableT = quantityAvailable; else quantityAvailableT = 100000000; if (!isNaN(currentVal) && currentVal < quantityAvailableT) $('input[name='+fieldName+']').val(currentVal + 50).trigger('keyup'); else $('input[name='+fieldName+']').val(quantityAvailableT); $('#quantity_wanted').change(); }); // The button to decrement the product value $(document).on('click', '.product_quantity_down_50', function(e){ e.preventDefault(); fieldName = $(this).data('field-qty'); var currentVal = parseInt($('input[name='+fieldName+']').val()); if (!isNaN(currentVal) && currentVal > 1 && currentVal > 50) $('input[name='+fieldName+']').val(currentVal - 50).trigger('keyup'); else $('input[name='+fieldName+']').val(50); $('#quantity_wanted').change(); }); $(document).on('click', '.product_quantity_up_6', function(e){ e.preventDefault(); fieldName = $(this).data('field-qty'); var currentVal = parseInt($('input[name='+fieldName+']').val()); if (!allowBuyWhenOutOfStock && quantityAvailable > 0) quantityAvailableT = quantityAvailable; else quantityAvailableT = 100000000; if (!isNaN(currentVal) && currentVal < quantityAvailableT) $('input[name='+fieldName+']').val(currentVal + 6).trigger('keyup'); else $('input[name='+fieldName+']').val(quantityAvailableT); $('#quantity_wanted').change(); }); // The button to decrement the product value $(document).on('click', '.product_quantity_down_6', function(e){ e.preventDefault(); fieldName = $(this).data('field-qty'); var currentVal = parseInt($('input[name='+fieldName+']').val()); if (!isNaN(currentVal) && currentVal > 1 && currentVal > 6) $('input[name='+fieldName+']').val(currentVal - 6).trigger('keyup'); else $('input[name='+fieldName+']').val(6); $('#quantity_wanted').change(); }); -
How to increment product quantity of 10 units
Embalim replied to ilclaudio's topic in Configuring and using PrestaShop
Hello, Thanks for your help ! I succeed yesterday adding this part of code : {assign cat37 [['id_category' => 37]]} {if Product::idIsOnCategoryId($smarty.get.id_product, $cat37)} <label for="quantity_wanted">{l s='Quantity'}</label> <input type="text" min="10" name="qty" id="quantity_wanted" class="text" disabled="disabled" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 10}{$product->minimal_quantity}{else}10{/if}{/if}" /> <a href="#" data-field-qty="qty" class="btn btn-default button-minus product_quantity_down_10"> <span><i class="icon-minus"></i></span> </a> <a href="#" data-field-qty="qty" class="btn btn-default button-minus product_quantity_up_10"> <span><i class="icon-plus"></i></span> </a> {/if} {else} <p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}> <label for="quantity_wanted">{l s='Quantity'}</label> <input type="number" min="1" 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}" /> <a href="#" data-field-qty="qty" class="btn btn-default button-minus product_quantity_down"> <span><i class="icon-minus"></i></span> </a> <a href="#" data-field-qty="qty" class="btn btn-default button-plus product_quantity_up"> <span><i class="icon-plus"></i></span> </a> <span class="clearfix"></span> </p> I let in place the original code for any quantity but I add a condition before ! Then I add to product.js the code you wrote : $(document).on('click', '.product_quantity_up_10', function(e){ e.preventDefault(); fieldName = $(this).data('field-qty'); var currentVal = parseInt($('input[name='+fieldName+']').val()); if (!allowBuyWhenOutOfStock && quantityAvailable > 0) quantityAvailableT = quantityAvailable; else quantityAvailableT = 100000000; if (!isNaN(currentVal) && currentVal < quantityAvailableT) $('input[name='+fieldName+']').val(currentVal + 10).trigger('keyup'); else $('input[name='+fieldName+']').val(quantityAvailableT); $('#quantity_wanted').change(); }); // The button to decrement the product value $(document).on('click', '.product_quantity_down_10', function(e){ e.preventDefault(); fieldName = $(this).data('field-qty'); var currentVal = parseInt($('input[name='+fieldName+']').val()); if (!isNaN(currentVal) && currentVal > 1 && currentVal > 10) $('input[name='+fieldName+']').val(currentVal - 10).trigger('keyup'); else $('input[name='+fieldName+']').val(10); $('#quantity_wanted').change(); }); All was good but when a product doesn't belong to a specific category (for specific incrementation), the "else" code doesn't worked ... : http://hpics.li/54f8930 Can you help me for that ? what's wrong ? I delete my code and add the original product.tpl .... but still doesn't work (also clear cache...) -
How to increment product quantity of 10 units
Embalim replied to ilclaudio's topic in Configuring and using PrestaShop
Hey claudio, Thanks ! I understand the process But where did you add this part of code in product.tpl ? Did you remove the other one ? For product.js I added the code just below the other one for 1 quantity incrementation. (with the right called class)