michaelz Posted November 28, 2012 Share Posted November 28, 2012 (edited) Ik heb zojuist de nieuwe Prestashop 1.5.2 geinstalleerd en wil graag zowel inclusief BTW als exclusief BTW prijzen laten zien bij mijn producten. De configuratie hiervan laat enkel het een of het ander toe. Iemand enig idee hierover hoe ik dit kan realiseren? Edited November 28, 2012 by michaelz (see edit history) Link to comment Share on other sites More sharing options...
scorpionsworld Posted November 28, 2012 Share Posted November 28, 2012 Ik heb zojuist de nieuwe Prestashop 1.5.2 geinstalleerd en wil graag zowel inclusief BTW als exclusief BTW prijzen laten zien bij mijn producten. De configuratie hiervan laat enkel het een of het ander toe. Iemand enig idee hierover hoe ik dit kan realiseren? Door de templates aan te passen. Bijvoorbeeld product.tpl <div class="price"> {if !$priceDisplay || $priceDisplay == 2} {assign var='productPrice' value=$product->getPrice(true, $smarty.const.NULL, $priceDisplayPrecision)} {assign var='productPriceWithoutRedution' value=$product->getPriceWithoutReduct(false, $smarty.const.NULL)} {elseif $priceDisplay == 1} {assign var='productPrice' value=$product->getPrice(false, $smarty.const.NULL, $priceDisplayPrecision)} {assign var='productPriceWithoutRedution' value=$product->getPriceWithoutReduct(true, $smarty.const.NULL)} {/if} <p class="our_price_display"> {if $priceDisplay >= 0 && $priceDisplay <= 2} <span id="our_price_display">{convertPrice price=$productPrice}</span> <!--{if $tax_enabled && ((isset($display_tax_label) && $display_tax_label == 1) OR !isset($display_tax_label))} {if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if} {/if}--> {/if} </p> {if $product->on_sale} <img src="{$img_dir}onsale_{$lang_iso}.gif" alt="{l s='On sale'}" class="on_sale_img"/> <span class="on_sale">{l s='On sale!'}</span> {elseif $product->specificPrice AND $product->specificPrice.reduction AND $productPriceWithoutRedution > $productPrice} <span class="discount">{l s='Reduced price!'}</span> {/if} {if $priceDisplay == 2} <br /> <span id="pretaxe_price"><span id="pretaxe_price_display">{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}</span> {l s='tax excl.'}</span> {/if} </div> Veranderen in: <div class="price"> {assign var='productPriceInc' value=$product->getPrice(true, $smarty.const.NULL, $priceDisplayPrecision)} {assign var='productPriceIncWithoutRedution' value=$product->getPriceWithoutReduct(false, $smarty.const.NULL)} {assign var='productPriceExc' value=$product->getPrice(false, $smarty.const.NULL, $priceDisplayPrecision)} {assign var='productPriceExcWithoutRedution' value=$product->getPriceWithoutReduct(true, $smarty.const.NULL)} <p class="our_price_display"> <span id="our_price_display">{convertPrice price=$productPriceExc}</span> {if $tax_enabled && ((isset($display_tax_label) && $display_tax_label == 1) OR !isset($display_tax_label))}{l s='tax excl.'}{/if} <span id="our_price_display">{convertPrice price=$productPriceInc}</span> {if $tax_enabled && ((isset($display_tax_label) && $display_tax_label == 1) OR !isset($display_tax_label))}{l s='tax incl.'}{/if} </p> {if $product->on_sale} <img src="{$img_dir}onsale_{$lang_iso}.gif" alt="{l s='On sale'}" class="on_sale_img"/> <span class="on_sale">{l s='On sale!'}</span> {elseif $product->specificPrice AND $product->specificPrice.reduction AND $productPriceWithoutRedution > $productPrice} <span class="discount">{l s='Reduced price!'}</span> {/if} <br /> <span id="pretaxe_price"><span id="pretaxe_price_display">{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}</span> {l s='tax excl.'}</span> <span id="protaxe_price"><span id="protaxe_price_display">{convertPrice price=$product->getPrice(true, $smarty.const.NULL)}</span> {l s='tax incl.'}</span> {/if} </div> 1 Link to comment Share on other sites More sharing options...
michaelz Posted November 28, 2012 Author Share Posted November 28, 2012 Na wat pielen heb ik het werkend gekregen. Heel erg bedankt, dit was precies het duwtje wat ik nodig had. De if/else constructie aan het einde heb ik aangepast zodat de pagina nu wel laad. Voor de volledigheid mijn uiteindelijke code (ik kan wel programmeren, maar dit "taaltje" ken ik niet, dus geen idee hoe de if/else constructie kon met een elseif. <div class="price"> {assign var='productPriceInc' value=$product->getPrice(true, $smarty.const.NULL, $priceDisplayPrecision)} {assign var='productPriceWithoutRedutionInc' value=$product->getPriceWithoutReduct(false, $smarty.const.NULL)} {assign var='productPriceEx' value=$product->getPrice(false, $smarty.const.NULL, $priceDisplayPrecision)} {assign var='productPriceWithoutRedutionEx' value=$product->getPriceWithoutReduct(true, $smarty.const.NULL)} <p class="our_price_display"> <span id="our_price_display">{convertPrice price=$productPriceEx}</span> {if $tax_enabled && ((isset($display_tax_label) && $display_tax_label == 1) OR !isset($display_tax_label))}{l s='tax excl.'}{/if}<BR><BR> <span id="our_price_display">{convertPrice price=$productPriceInc}</span> {if $tax_enabled && ((isset($display_tax_label) && $display_tax_label == 1) OR !isset($display_tax_label))}{l s='tax incl.'}{/if} </p> {if $product->on_sale} <img src="{$img_dir}onsale_{$lang_iso}.gif" alt="{l s='On sale'}" class="on_sale_img"/> <span class="on_sale">{l s='On sale!'}</span> {else} {if $product->specificPrice AND $product->specificPrice.reduction AND $productPriceWithoutRedution > $productPrice} <span class="discount">{l s='Reduced price!'}</span> {/if} <br /> <span id="pretaxe_price"><span id="pretaxe_price_display">{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}</span> {l s='tax excl.'}</span> <span id="protaxe_price"><span id="protaxe_price_display">{convertPrice price=$product->getPrice(true, $smarty.const.NULL)}</span> {l s='tax incl.'}</span> {/if} </div> Link to comment Share on other sites More sharing options...
scorpionsworld Posted November 28, 2012 Share Posted November 28, 2012 Na wat pielen heb ik het werkend gekregen. Heel erg bedankt, dit was precies het duwtje wat ik nodig had. De if/else constructie aan het einde heb ik aangepast zodat de pagina nu wel laad. Voor de volledigheid mijn uiteindelijke code (ik kan wel programmeren, maar dit "taaltje" ken ik niet, dus geen idee hoe de if/else constructie kon met een elseif. Zie voor meer info over smarty programmeren http://www.smarty.net/docs/en/smarty.for.designers.tpl Zou je nog wel even [sOLVED] in de topictitel willen zetten? Dit doe je door je eerste post te editen in Full editor modus. 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