Jump to content

Cena na dotaz - úprava product.tpl


goatee2905

Recommended Posts

Dobrý den, Prestu 1.3.7 používám jen jako katalog zboží s cenami.

 

Chtěl bych, aby se u zboží, které má cenu 0 Kč, zobrazoval místo ceny údaj "CENA NA DOTAZ".

U výpisu zboží (product-list.tpl) se mi to povedlo takto:

 

  {if $product.price == 0}
<tr>
<td style="height: 50px">
<div><span class="price" style="display: inline;">Cena na dotaz</span></div>
</td>
</tr>

  {else}
<tr>
<td style="height: 50px">
{if !$priceDisplay || $priceDisplay == 2}<div><span class="price" style="display: inline;">{convertPrice price=$product.price}</span>{if $priceDisplay == 2} {l s='+Tx'}{/if}</div>{/if}
{if $priceDisplay}<div><span class="price" style="display: inline;">{convertPrice price=$product.price_tax_exc}</span>{if $priceDisplay == 2} {l s='-Tx'}{/if}</div>{/if}</td>
</tr>
  {/if}

 

Ale nevím si rady u product.tpl. Zkouším postupovat stejně, ale skončí to tím, že je zbytek stránky od ceny totálně rozhozený. Protože nejsem v PHP zběhlý, prosím o radu.

 

Část souboru product.tpl:

 

	<!-- PRICES -->

		<p class="price" style="text-align: center">
			{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->reduction_price != 0 || $product->reduction_percent != 0) && ($product->reduction_from == $product->reduction_to OR ($smarty.now|date_format:'%Y-%m-%d' <= $product->reduction_to && $smarty.now|date_format:'%Y-%m-%d' >= $product->reduction_from))}
				<span class="discount" >{l s='Price lowered!'}</span>
			{/if}
			<br />
			<span style="color: #646464">
			{if !$priceDisplay || $priceDisplay == 2}  
				<span style="color: #d53f43; display: block; font-size: 17px;">{convertPrice price=$product->getPrice(true, $smarty.const.NULL, 2)}</span>
					{l s='včetně DPH'}  
			{/if}
			{if $priceDisplay == 1}
				<span class="price" style="display: inline;">{convertPrice price=$product->getPrice(false, $smarty.const.NULL, 2)}</span>
					{l s='tax excl.'}
			{/if}
			</span>
			{if $priceDisplay == 2}
				<br />
				<span id="pretaxe_price"><span id="pretaxe_price_display">{convertPrice price=$product->getPrice(false, $smarty.const.NULL, 2)}</span> {l s='tax excl.'}</span>
			{/if}
			<br />
		</p>
		{if ($product->reduction_price != 0 || $product->reduction_percent != 0) && ($product->reduction_from == $product->reduction_to OR ($smarty.now|date_format:'%Y-%m-%d' <= $product->reduction_to && $smarty.now|date_format:'%Y-%m-%d' >= $product->reduction_from))}
			<p id="old_price"><span class="bold">
			{if !$priceDisplay || $priceDisplay == 2}
				<span id="old_price_display">{convertPrice price=$product->getPriceWithoutReduct()}</span>

			{/if}
			{if $priceDisplay == 1}
				<span id="old_price_display">{convertPrice price=$product->getPriceWithoutReduct(true)}</span>

			{/if}
			</span>
			</p>
		{/if}
		{if $product->reduction_percent != 0 && ($product->reduction_from == $product->reduction_to OR ($smarty.now|date_format:'%Y-%m-%d' <= $product->reduction_to && $smarty.now|date_format:'%Y-%m-%d' >= $product->reduction_from))}
			<p id="reduction_percent">{l s='(price reduced by'} <span id="reduction_percent_display">{$product->reduction_percent|floatval}</span> %{l s=')'}</p>
		{/if}
		{if $packItems|@count}
			<p class="pack_price">{l s='instead of'} <span style="text-decoration: line-through;">{convertPrice price=$product->getNoPackPrice()}</span></p>
			<br class="clear" />
		{/if}
		{if $product->ecotax != 0}
			<p class="price-ecotax">{l s='include'} <span id="ecotax_price_display">{convertPrice price=$product->ecotax}</span> {l s='for green tax'}</p>
		{/if}

Link to comment
Share on other sites

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...