Jump to content

סימן מטבע במערכת פילטור


Recommended Posts

הי,

בעמוד קטגוריה במערכת הפילטור בניווט הצדדי של האתר יש אפשרות לסנן את הנתונים על פי מחיר.

הבעיה היא שאיפה שרשום טווח זה מופיע בצורה הבאה: 

ש"ח320 - ש"ח100

 

לא הצלחתי למצוא איך אני משנה את זה.

אפילו נכנסתי לקבצי tpl של הבלוק ועדיין לא מצאתי איך לשנות את זה.

 

אודה לעזרה.

Link to comment
Share on other sites

  • 3 weeks later...

I couldn't find an easy fix for that but I did find a working solution for now.

My idea is to keep the text (טווח) as RTL and the amount + symbol as LTR, now you need to fix it in the filter it self and also in the enabled filter list after you select.

 

 

Edit file '/js/tools.js' and look for 'formatCurrency' function, this function will return the amount + symbol based on you currency format you selected in the BO.

In my case I selected Format = 4 (0,000.00X) so look for 'if (currenctFormat == 4) and change the line underneath from:

 

return (formatNumber(price, priceDisplayPrecision, ',', '.') + blank + currencySign);

 

To:

 

return (currencySign + blank + formatNumber(price, priceDisplayPrecision, ',', '.'));

 

This will give us the symbol on the left side of the amount (in LTR).

 

Next you need to edit /themes/default-bootstrap/modules/blocklayered/blocklayered.tpl and look for:

 

<li>
    <a href="#" data-rel="layered_{$filter.type}_slider" title="{l s='Cancel' mod='blocklayered'}"></a>
    {if $filter.format == 1}
        {l s='%1$s: %2$s - %3$s'|sprintf:$filter.name:{displayPrice price=$filter.values[0]}:{displayPrice price=$filter.values[1]}|escape:'html':'UTF-8' mod='blocklayered'}
    {else}
        {l s='%1$s: %2$s %4$s - %3$s %4$s'|sprintf:$filter.name:$filter.values[0]:$filter.values[1]:$filter.unit|escape:'html':'UTF-8' mod='blocklayered'}
    {/if}
</li>
 
And change to:
 
<li class="range-slider">
    <a href="#" data-rel="layered_{$filter.type}_slider" title="{l s='Cancel' mod='blocklayered'}"></a>
    {if $filter.format == 1}
        {l s='%1$s: %2$s - %3$s'|sprintf:$filter.name:{displayPrice price=$filter.values[0]}:{displayPrice price=$filter.values[1]}|escape:'html':'UTF-8' mod='blocklayered'}
    {else}
        {l s='%1$s: '|sprintf:$filter.name|escape:'html':'UTF-8' mod='blocklayered'}<span>{l s='%3$s%1$s - %3$s%2$s'|sprintf:$filter.values[0]:$filter.values[1]:$filter.unit|escape:'html':'UTF-8' mod='blocklayered'}</span>
    {/if}
</li>

 

And the last part is the add some css for the new classes we created, so edit 'themes/default-bootstrap/css/rtl.css' and add at the bottom:

 

/* Block layered */
.range-slider span, #layered_price_range {
    direction: ltr !important;
    display: inline-block;
}
 
#enabled_filters li a {
    float: left;
}
 
This is working for me so try it and let me know if you have any issues.
Good luck
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...