Jump to content

Zobrazení ceny s a bez DPH


vasekcekal

Recommended Posts

Zdravím,
řešil jsem problém zobrazení cen s a bez DPH. Pro ty, kteří by si to taky chtěli udělat stačí provést toto:

V product-list.tpl tohle:

{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}


přepsat na tohle:

{convertPrice price=$product.price} {l s='incl. tax'}

{convertPrice price=$product.price_tax_exc} {l s='excl. tax'}


Tímto se docílí, že ve výpisu v kategoriích se budou zobrazovat ceny s i bez daně.

Dále product.tpl

               {if !$priceDisplay || $priceDisplay == 2}
{convertPrice price=$product->getPrice(true, $smarty.const.NULL)}
                       {if $tax_enabled}{l s='tax incl.'}{/if}
               {/if}
               {if $priceDisplay == 1}
{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}
                       {if $tax_enabled}{l s='tax excl.'}{/if}


přepsat na:

               {if !$priceDisplay || $priceDisplay == 2}
{convertPrice price=$product->getPrice(true, $smarty.const.NULL)}
                       {if $tax_enabled}{l s='tax incl.'}{/if}
               {/if}

               {if !$priceDisplay || $priceDisplay == 2}
{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}
                       {if $tax_enabled}{l s='tax excl.'}{/if}
               {/if} 


A v detailu produktu se bude zobrazovat cena s i bez DPH.

Na homepage v featured products upravíte soubor modules/homefeatured/homefeatured.tpl

{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}

upravíme na:

{convertPrice price=$product.price} {l s='s DPH'}
{convertPrice price=$product.price_tax_exc} {l s='bez DPH'}


A nyní na hlavní stránce v doporučených produktech se budou také zobrazovat ceny s i bez DPH :)

Jen je třeba v homefeatured a product-list vhodně naformátvat text, aby se to tam nějak nepralo, ale to všude. Myslím tím jako překlad/velikost/popř. i barvu

Pokud používáte velkoobchod, kde je to řešeno pomocí Dealer D1, D2 a D3 tak to s nimi překvapivě také funguje :)

Testuju, upravuji a připravuji k použití nový shop, tak obsah nic moc, ale v praxi to můžete vidět zde www.test.atv-rakovnik.cz

EDIT:
Stejným způsobem jsem přidal cenu např. i do bloku novinek - blocknewproducts.tpl. Má to široké využití, lze použít téměř všude.




     {convertPrice price=$product.price} {l s='s DPH'}

     {convertPrice price=$product.price_tax_exc} {l s='bez DPH'}





Snad jsem někomu pomohl :)

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

Snad jsem někomu pomohl :)


Pomohl a velmi! Díky!!!

(ještě bych potřeboval rozlousknout, jak do jazykových proměnných v modulu dostat anglický text 'tax incl.' a pak zprovoznit český překlad pro českou verzi, ale to snad najdu jinde... Snadná a logická cesta totiž nějak nezabrala :-)
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
  • 3 weeks later...

Ahoj, provedl jsem podle tohoto návodu úpravu, aby se zobrazovala i cena bez DPH, ale mám s ní takový problém.
Standartně funguje bezproblému, ale pokud pokud u produktu použiju kombinace, a použiju funkci zvýšení ceny, na základě kombinace, tak se ve výpisu zvýší jen cena s DPH a cena bez DPH zůstává původní, což je problém.
Neví někdo jak na to?
Zde je odkaz na konkrétní produkt:http://infrapanely-it.cz/topeni-z-prirodniho-kamene/43-topeni-z-kamene-nhp-1500w.html

Předem díky moc za radu.

Janny

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 year later...

Zdravím...

kdo poradí jak můžu odstranit slovíčka s DPH a bez DPH z administrace objednávky zákazníka...

Již jsem měl tu čest s finančním úřadem kde bylo udání že díky těm slovíčkům, že prý když nejsem plátce, tak nesmí být u žádných mojich cen.

V translations jsem si vše upravil, ale efekt žádný...

 

 

Děkuji moc za rady

 

web.jpg

Link to comment
Share on other sites

  • 10 months later...
  • 7 months later...

Tak jsem po trošce tápání a za pomoci kamaráda rozchodil zobrazování cen včetně i bez DPH ve verzi 1.6.0.6, základní theme po instalaci (bootstrap)

 

1) úpravy souboru themes/default-bootstrap/product-list.tpl

 

původní kód:

<span itemprop="price" class="price product-price">{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span>

nový kód:

<span itemprop="price" class="price product-price">{convertPrice price=$product.price}{l s='incl. tax'}</span>
<span itemprop="price" class="price product-price">{convertPrice price=$product.price_tax_exc} {l s='excl. tax'}</span>

původní kód 2:

<span itemprop="price" class="price product-price">{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span>

nový kód 2:

<span itemprop="price" class="price product-price">{convertPrice price=$product.price}{l s='incl. tax'}</span>
<span itemprop="price" class="price product-price">{convertPrice price=$product.price_tax_exc} {l s='excl. tax'}</span>

2) úpravy souboru themes/default-bootstrap/product.tpl

 

původní kód:

<!-- prices -->
							<div class="price">
								<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 id="reduction_percent" {if !$product->specificPrice || $product->specificPrice.reduction_type != 'percentage'} style="display:none;"{/if}>
									<span id="reduction_percent_display">
										{if $product->specificPrice && $product->specificPrice.reduction_type == 'percentage'}-{$product->specificPrice.reduction*100}%{/if}
									</span>
								</p>
								<p id="old_price"{if (!$product->specificPrice || !$product->specificPrice.reduction) && $group_reduction == 0} class="hidden"{/if}>
									{if $priceDisplay >= 0 && $priceDisplay <= 2}
										<span id="old_price_display">{if $productPriceWithoutReduction > $productPrice}{convertPrice price=$productPriceWithoutReduction}{/if}</span>
										<!-- {if $tax_enabled && $display_tax_label == 1}{if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}{/if} -->
									{/if}
								</p>
								{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> <!-- end prices -->

Nový kód:

<!-- prices -->
							<div class="price">
								<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">
								
										<span id="pretaxe_price">
										<span id="pretaxe_price_display">{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}</span>
										{l s='tax excl.'}
									</span>
								</p>
								<p id="reduction_percent" {if !$product->specificPrice || $product->specificPrice.reduction_type != 'percentage'} style="display:none;"{/if}>
									<span id="reduction_percent_display">
										{if $product->specificPrice && $product->specificPrice.reduction_type == 'percentage'}-{$product->specificPrice.reduction*100}%{/if}
									</span>
								</p>
								<p id="old_price"{if (!$product->specificPrice || !$product->specificPrice.reduction) && $group_reduction == 0} class="hidden"{/if}>
									{if $priceDisplay >= 0 && $priceDisplay <= 2}
										<span id="old_price_display">{if $productPriceWithoutReduction > $productPrice}{convertPrice price=$productPriceWithoutReduction}{/if}</span>
										{if $tax_enabled && $display_tax_label == 1}{if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}{/if}
									{/if}
								</p>
								{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> <!-- end prices -->

A je to...

Link to comment
Share on other sites

  • 1 month later...

Chtěl bych poprosit o radu, pomoc cokoliv, jelikož poslední zmíněný kód pro prestashop 1.6.0.6 pro product.tpl nefunguje. Po změně kódu je stav takový, že mi to udává dvě ceny a obě stejné bez DPH. V případě kombinace to vypočítá dph z částky bez DPH, takže výsledek je, že mám u kombinace cenu bez DPH a vypočítanou cenu z ceny bez DPH - takže nesmysl. Zkoušel jsem všemožně upravovat, ale výsledku jsem se nedopátral. V backofficu presty jsem zkoušel vypínat ceny s dph a bez dph a nemá to vliv na nic. Prosím o radu, děkuji.

Link to comment
Share on other sites

  • 2 weeks later...
  • 4 months later...

Tak jsem po trošce tápání a za pomoci kamaráda rozchodil zobrazování cen včetně i bez DPH ve verzi 1.6.0.6, základní theme po instalaci (bootstrap)

 

1) úpravy souboru themes/default-bootstrap/product-list.tpl

 

původní kód:

<span itemprop="price" class="price product-price">{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span>

nový kód:

<span itemprop="price" class="price product-price">{convertPrice price=$product.price}{l s='incl. tax'}</span>
<span itemprop="price" class="price product-price">{convertPrice price=$product.price_tax_exc} {l s='excl. tax'}</span>

původní kód 2:

<span itemprop="price" class="price product-price">{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span>

nový kód 2:

<span itemprop="price" class="price product-price">{convertPrice price=$product.price}{l s='incl. tax'}</span>
<span itemprop="price" class="price product-price">{convertPrice price=$product.price_tax_exc} {l s='excl. tax'}</span>

2) úpravy souboru themes/default-bootstrap/product.tpl

 

původní kód:

<!-- prices -->
							<div class="price">
								<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 id="reduction_percent" {if !$product->specificPrice || $product->specificPrice.reduction_type != 'percentage'} style="display:none;"{/if}>
									<span id="reduction_percent_display">
										{if $product->specificPrice && $product->specificPrice.reduction_type == 'percentage'}-{$product->specificPrice.reduction*100}%{/if}
									</span>
								</p>
								<p id="old_price"{if (!$product->specificPrice || !$product->specificPrice.reduction) && $group_reduction == 0} class="hidden"{/if}>
									{if $priceDisplay >= 0 && $priceDisplay <= 2}
										<span id="old_price_display">{if $productPriceWithoutReduction > $productPrice}{convertPrice price=$productPriceWithoutReduction}{/if}</span>
										<!-- {if $tax_enabled && $display_tax_label == 1}{if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}{/if} -->
									{/if}
								</p>
								{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> <!-- end prices -->

Nový kód:

<!-- prices -->
							<div class="price">
								<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">
								
										<span id="pretaxe_price">
										<span id="pretaxe_price_display">{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}</span>
										{l s='tax excl.'}
									</span>
								</p>
								<p id="reduction_percent" {if !$product->specificPrice || $product->specificPrice.reduction_type != 'percentage'} style="display:none;"{/if}>
									<span id="reduction_percent_display">
										{if $product->specificPrice && $product->specificPrice.reduction_type == 'percentage'}-{$product->specificPrice.reduction*100}%{/if}
									</span>
								</p>
								<p id="old_price"{if (!$product->specificPrice || !$product->specificPrice.reduction) && $group_reduction == 0} class="hidden"{/if}>
									{if $priceDisplay >= 0 && $priceDisplay <= 2}
										<span id="old_price_display">{if $productPriceWithoutReduction > $productPrice}{convertPrice price=$productPriceWithoutReduction}{/if}</span>
										{if $tax_enabled && $display_tax_label == 1}{if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}{/if}
									{/if}
								</p>
								{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> <!-- end prices -->

A je to...

 

Super, ale ve verzi PS 1.6.0.9 mi to nefungje s kombinacemi. Je to proto že se cena neaktualizuje v js.

Po upravě product.js ve /theme/nazev_theme/js/ to funguje správně.

Do funkce function updatePrice() pod (u mě to je na řádku 657)

$('#our_price_display').text(formatCurrency(priceWithDiscountsDisplay * currencyRate, currencyFormat, currencySign, currencyBlank));

přidáme:

$('#our_price_displaybezdane').text(formatCurrency(basePriceWithoutTax * currencyRate, currencyFormat, currencySign, currencyBlank));

A ještě jsem upravil čast kodu od Mortmil, jen jsem ve <span>, ktery zobrazuje cenu bez dph změnil ID na our_price_displaybezdane (může napsat vlatni ID, ale musi se změnit taky v přidanem kodu pro product.js)

<p class="our_price_display bezdane" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
                        
                              	<span id="" class="bezdane">
                              	<span id="our_price_displaybezdane">{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}</span>
                              		{l s='tax excl.'}
                           		</span>
</p>

Snad pomůže. :)

 

PS: JS může být v každé šabloně jiný a tohle nemusí funguvat. Jde o to, že je třeba najít funkci v js pro update ceny a přidat funkci pro update naší nově vytvořené ceny.

Edited by Strky (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...