pbpo Posted September 18, 2014 Share Posted September 18, 2014 Witajcie, jest pewien problem. W BO można określić jakie ceny są wyświetlane dla odwiedzających, klientów, czy po prostu wchodzących. W kartach produktu potrzebowałem dwóch cen (netto i brutto) więc w pliku product.tpl wykonałem to w ten sposób: <p class="our_price_display" itemprop="offers" itemscope itemtype="http://schema.org/Offer"> {if $product->quantity > 0}<link itemprop="availability" href="http://schema.org/InStock"/>{/if} {if $priceDisplay >= 0 && $priceDisplay <= 2} <span id="our_price_display" itemprop="price">{convertPrice price=$productPrice}</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} {/if} <meta itemprop="priceCurrency" content="{$currency->iso_code}" /> {/if} </p> <p class="our_price_display" itemprop="offers" itemscope itemtype="http://schema.org/Offer"> {if $priceDisplay >= 0 && $priceDisplay <= 2} <span id="pretaxe_price"> <span id="pretaxe_price_display">{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}</span> {l s='tax excl.'} </span> {/if} </p> Wszystko ładnie śmiga, ale potrzebuję by na liście produktów (w kategoriach) cena która jest wyświetlana ,była ceną netto, a nie brutto. jak zmusić ten kawałek kodu poniżej by wyświetlał cenę netto tak jak to się dzieje w karcie produktu ? {if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)} <span itemprop="price" class="price product-price"> {if !$priceDisplay} {convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc} {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} {/if} {/if} </span> Sprawa jest pilna, a ja już po prostu nie mam pomysłów. Próbowałem wpisać {if}'a który był w product.tpl dzięki któremu cena się wyświetlała, ale to nie dość, że nie dawało nic to rozwalało układ strony. próbowałem usunąć {else} tak by wyświetlał tylko jedną cene... owszem wyświetlał.. ale tylko cenę brutto.... Link to comment Share on other sites More sharing options...
pbpo Posted September 18, 2014 Author Share Posted September 18, 2014 (edited) Temat można zamknąć.zmodyfikowałem kod. Linia kodu : {if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)} <span itemprop="price" class="price product-price"> {if !$priceDisplay} {convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc} {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} {/if} {/if} </span> {/if} Została zamieniona na : {if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)} <span itemprop="price" class="price product-price"> {if !$priceDisplay || $priceDisplay == 2} {convertPrice price=$product.price_tax_exc}{if $priceDisplay == 2} {l s='Tax exc.'}{/if} {/if} </span> {/if} Efekt można zobaczyć pod linkiem: http://flirdlastrazy.pl/3-kamery-termowizyjne Pierwotnie tam wyświetlana była cena brutto. Edited September 18, 2014 by pbpo (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts