PDA

View Full Version : Little fix for currency position in -> my_packages.tpl



Steffen Buschkemper
September 25, 2012, 06:11 PM
Hi @ all,

I have found a little bug in templates/your_template/tpl/controllers/my_packages.tpl

find code @ line 14



<div class="price">{if $pack_info.Price > 0}{$config.system_currency}{$pack_info.Price}{else }{$lang.free}{/if}</div>


and change with the follow



{if $config.system_currency_position == 'before'}
<div class="price">{if $pack_info.Price > 0}{$config.system_currency} {$pack_info.Price}{else}{$lang.free}{/if}</div>
{/if}
{if $config.system_currency_position == 'after'}
<div class="price">{if $pack_info.Price > 0}{$pack_info.Price} {$config.system_currency}{else}{$lang.free}{/if}</div>
{/if}



find code @ line 109 (or 118)



<div class="price">{if isset($plan.Listings_remains)}&rarr;{else}{if $plan.Price > 0}{$config.system_currency}{$plan.Price}{else}{$la ng.free}{/if}{/if}</div>


and change with the follow



{if $config.system_currency_position == 'before'}
<div class="price">{if isset($plan.Listings_remains)}&rarr;{else}{if $plan.Price > 0}{$config.system_currency} {$plan.Price}{else}{$lang.free}{/if}{/if}</div>
{/if}
{if $config.system_currency_position == 'after'}
<div class="price">{if isset($plan.Listings_remains)}&rarr;{else}{if $plan.Price > 0}{$plan.Price} {$config.system_currency}{else}{$lang.free}{/if}{/if}</div>
{/if}


find code @ line 272



<td valign="top" class="price"><div>{if $package.Price > 0}{$config.system_currency} {$package.Price}{else}{$lang.free}{/if}</div></td>


and change with the follow



<td valign="top" class="price">
{if $config.system_currency_position == 'before'}
<div>{if $package.Price > 0}{$config.system_currency} {$package.Price}{else}{$lang.free}{/if}</div>
{/if}
{if $config.system_currency_position == 'after'}
<div>{if $package.Price > 0}{$package.Price} {$config.system_currency} {else}{$lang.free}{/if}</div>
{/if}
</td>


The currency position setting (before, after) now also works for packages.

Best regards
Steffen

Petrache Nicolae
September 26, 2012, 02:24 PM
thanks for sharing

Vladimir
September 27, 2012, 04:34 AM
Hello,

I can offer a more universal solution (in case your variable $config.system_currency will be empty):

1.


<div class="price">
{if $pack_info.Price > 0}
{if $config.system_currency_position == 'before'}{$config.system_currency}{/if}
{$pack_info.Price}
{if $config.system_currency_position == 'after'}{$config.system_currency}{/if}
{else}
{$lang.free}
{/if}
</div>


2.


<div class="price">
{if isset($plan.Listings_remains)}&rarr;{else}
{if $plan.Price > 0}
{if $config.system_currency_position == 'before'}{$config.system_currency}{/if}
{$plan.Price}
{if $config.system_currency_position == 'after'}{$config.system_currency}{/if}
{else}
{$lang.free}
{/if}
{/if}
</div>


3.


<td valign="top" class="price">
<div>
{if $package.Price > 0}
{if $config.system_currency_position == 'before'}{$config.system_currency}{/if}
{$package.Price}
{if $config.system_currency_position == 'after'}{$config.system_currency}{/if}
{else}
{$lang.free}
{/if}
</div>
</td>

Steffen Buschkemper
September 27, 2012, 01:48 PM
Thank you Victor for this optimized code!

Best regards
Steffen

Andreas_M
September 30, 2012, 11:26 AM
Hello,


what solution should I choose?
Vladimirs is also for my_packages.tpl?

Got the same missing currency by adding a rate into the booking system. After editing some rates, the currency symbol appears normally behind the amount.

best regards
Andreas

Steffen Buschkemper
September 30, 2012, 07:08 PM
Hello,

I can offer a more universal solution (in case your variable $config.system_currency will be empty):

1.


<div class="price">
{if $pack_info.Price > 0}
{if $config.system_currency_position == 'before'}{$config.system_currency}{/if}
{$pack_info.Price}
{if $config.system_currency_position == 'after'}{$config.system_currency}{/if}
{else}
{$lang.free}
{/if}
</div>


2.


<div class="price">
{if isset($plan.Listings_remains)}→{else}
{if $plan.Price > 0}
{if $config.system_currency_position == 'before'}{$config.system_currency}{/if}
{$plan.Price}
{if $config.system_currency_position == 'after'}{$config.system_currency}{/if}
{else}
{$lang.free}
{/if}
{/if}
</div>


3.


<td valign="top" class="price">
<div>
{if $package.Price > 0}
{if $config.system_currency_position == 'before'}{$config.system_currency}{/if}
{$package.Price}
{if $config.system_currency_position == 'after'}{$config.system_currency}{/if}
{else}
{$lang.free}
{/if}
</div>
</td>


Hallo Andreas,

genau diese Aenderungen machen, meine waren nicht optimal.
Sollte auch bei dir so sein.
Die betreffenden zeilen unten mit denen von oben tauschen:
zu 1.


<div class="price">{if $pack_info.Price > 0}{$config.system_currency}{$pack_info.Price}{else }{$lang.free}{/if}</div>

zu 2.


<div class="price">{if isset($plan.Listings_remains)}&rarr;{else}{if $plan.Price > 0}{$config.system_currency}{$plan.Price}{else}{$la ng.free}{/if}{/if}</div>

zu 3.


<td valign="top" class="price"><div>{if $package.Price > 0}{$config.system_currency} {$package.Price}{else}{$lang.free}{/if}</div></td>


Now english:
For booking i will check for a solution.
But the booking system has more bugs.