kerlin Posted July 16, 2017 Share Posted July 16, 2017 Bonjour, sur les fiches produits, j'aimerais afficher : A partir de : - prix TTC - prix HTA car le site est à destination des particuliers et des professionnels.Ayant fait des recherches, j'ai vu (pour de précédentes version) que c'était dans product.tpl au niveau de <div class="price"> <p class="our_price_display" itemprop="offers" itemscope itemtype="https://schema.org/Offer">{strip} {if $product->quantity > 0}<link itemprop="availability" href="https://schema.org/InStock"/>{/if} {if $priceDisplay >= 0 && $priceDisplay <= 2} <span id="our_price_display" itemprop="price" content="{$productPrice}">{convertPrice price=$productPrice |floatval} </span> {if $tax_enabled && ((isset($display_tax_label) && $display_tax_label == 1) || !isset($display_tax_label))} {if $priceDisplay == 1} {l s='tax excl.'}{else} {l s='tax incl.'}{/if} Mais le code dans les autres n'est pas exactement le même.Quelqu'un aurait-il une idée pour mon cas de figure ?Merci d'avance PS : ce serait aussi pour les produits en liste. Link to comment Share on other sites More sharing options...
doekia Posted July 16, 2017 Share Posted July 16, 2017 C'est toujours dans product.tpl Les variable ont très peu changées. C'est $product->getPrice(false) pour le prix HT Link to comment Share on other sites More sharing options...
kerlin Posted July 16, 2017 Author Share Posted July 16, 2017 Bonjour Doekia et merci pour ta réponse.Ce que je souhaite, c'est que les 2 prix s'affichent, celui avec et celui sans TVA. CEla le fait avec ce que tu me dis ? Merci Link to comment Share on other sites More sharing options...
doekia Posted July 16, 2017 Share Posted July 16, 2017 Non avec ce que je dis ça ne fait rien du tout. La preuve, là, rien ne s'affiche. Par contre si tu écris dans ton code ce que je dis il y a des chances Link to comment Share on other sites More sharing options...
kerlin Posted July 16, 2017 Author Share Posted July 16, 2017 Ca c'est sûr, ici, ça ne le fait pas ;-) Mais tu le mets où dans le code que j'ai indiqué ? (qui est celui de de la version que j'utilise) Ch'suis pas blonde, promis ! Merci de ton aide ! Link to comment Share on other sites More sharing options...
abress Posted July 17, 2017 Share Posted July 17, 2017 (edited) Moi aussi le même problème, en version 1.6.1.7, les taxes ne s'affichent pas en page d'accueil, ni sur les meilleures ventes ou populaires ou par liste. Uniquement dans les détails des produits. Je vais tenter de modifier le code. Edited July 17, 2017 by abress (see edit history) Link to comment Share on other sites More sharing options...
kerlin Posted July 19, 2017 Author Share Posted July 19, 2017 Bonsoir, j'ai réussi à afficher le prix HT en plus du TTC en ajoutant ceci (que j'ai recopié de je ne sais plus où mais cela fonctionne) <span id="pretaxe_price"><span id="pretaxe_price_display">{convertPrice price=$product->getPrice(false, $smarty.const.NULL, 2)}</span> {l s='tax excl.'}</span><br /> {if $priceDisplay == 2}<br /> <span id="pretaxe_price">{strip} <span id="pretaxe_price_display">{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}</span> {l s='tax excl.'} {/strip}</span> Je souhaite maintenant, quand il y a une promo, afficher l'ancien prix HT barré, le % de réduction et le nouveau prix HT. POur le prix TTC, cela s'affiche correctement.Je pense que le code qui gère l'affichage de l'ancien prix et de la réduction pour le prix TTC est <p id="reduction_amount" {if $productPriceWithoutReduction <= 0 || !$product->specificPrice || $product->specificPrice.reduction_type != 'amount' || $product->specificPrice.reduction|floatval ==0} style="display:none"{/if}>{strip} <span id="reduction_amount_display"> {if $product->specificPrice && $product->specificPrice.reduction_type == 'amount' && $product->specificPrice.reduction|floatval !=0} -{convertPrice price=$productPriceWithoutReduction|floatval-$productPrice|floatval} {/if} </span> {/strip}</p> <p id="old_price"{if (!$product->specificPrice || !$product->specificPrice.reduction)} class="hidden"{/if}>{strip} {if $priceDisplay >= 0 && $priceDisplay <= 2} {hook h="displayProductPriceBlock" product=$product type="old_price"} <span id="old_price_display"><span class="price">{if $productPriceWithoutReduction > $productPrice}{convertPrice price=$productPriceWithoutReduction|floatval}{/if}</span>{if $productPriceWithoutReduction > $productPrice && $tax_enabled && $display_tax_label == 1} {if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}{/if}</span> {/if} {/strip}</p> <p id="reduction_percent" {if $productPriceWithoutReduction <= 0 || !$product->specificPrice || $product->specificPrice.reduction_type != 'percentage'} style="display:none;"{/if}>{strip} {if $product->specificPrice && $product->specificPrice.reduction_type == 'percentage'}-{$product->specificPrice.reduction*100}%{/if} </span> {/strip}</p> Que dois-je changer là-dedans pour que ce soit le prix HT qui soit pris en compte ?Merci d'avance. 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