Jump to content

Prestashop 1.6 Theme RTL


Recommended Posts

Hi,
 
I was checking out Prestashop to replace my current site. I really loved the new 1.6 theme and noticed that it is not RTL by default, so I made it.
 
The first thing I noticed after installing Hebrew was that the rtl.css file is loaded in the middle of the other css files. I started adding "!important" attributes but then I decided to make it more elegant by adding it again, this time, put it as the last file:
  

I've made all the style changes in the rtl.css file, so that changing to LTR language keeps the same basic look (overwrite the original one in the css folder). The file is not well commented, but the various sections align each module.
I added a mirrored version of sprite-rtl.png: "default-bootstrap/img/jquery/uniform/sprite-rtl.png"

 

Update (13 Oct 2015):

Currently tested on 1.6.1.1, simply clone into your theme folder.

Github: https://github.com/nashcontrol/prestashop-default-bootstrap-rtl

 

Backward compatibility is not guaranteed.
 
That's it. Enjoy.

@nashcontrol

post-742964-0-05551200-1400248461_thumb.jpg

post-742964-0-98221500-1400248462_thumb.jpg

post-742964-0-96884700-1400248464_thumb.jpg

post-742964-0-85038600-1400248466_thumb.jpg

post-742964-0-25339200-1400248468_thumb.jpg

post-742964-0-14253200-1400248471_thumb.jpg

Edited by nashcontrol (see edit history)
  • Like 3
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
  • 2 weeks later...
  • 2 weeks later...

thanks !! 

 

could you help me about couple of things ?

 

we want to switch out shop to prestaShop.

but, we seems to have 2 major problems :

 

mport product with hebrew - we didn't succeed to import products with hebrew in the title or in the description .  you can look in the link :

 

http://buyvisualstudio.co.il/presta/microsoft-exchange/157383-Exchange-Server-Standard-2013-OLP-NL-312-04261.html

 

prices -  in our old website , we have 4,000 items 

part of the product have price in shekel - ILS

and big part of the products have cot price in USD .

our old website , take the USD price , turn it into ILS and add VAT tax.

we do not want to save the price in ILS - But we want to show the price in ILS  to our customers

how can we do that in presta ?. 

Link to comment
Share on other sites

  • 4 weeks later...

Hi,

 

I was checking out Prestashop to replace my current site. I really loved the new 1.6 theme and noticed that it is not RTL by default, so I made it.

 

The first thing I noticed after installing Hebrew was that the rtl.css file is loaded in the middle of the other css files. I started adding "!important" attributes but then I decided to make it more elegant by adding it again, this time, put it as the last file:

 

I added the RTL check In the beginning of header.php:

{***Language check***}
{$is_rtl = false}
{foreach from=$languages key=k item=language name="languages"}
  {if $language.iso_code == $lang_iso}
    {if $language.is_rtl == 1}
			{$is_rtl = true}
	{/if}
  {/if}
{/foreach}

Then, I linked the rtl.css file again, just after the usual css files, along with an RTL version of Bootstrap (ratnic's fork).

https://github.com/ratnic/bootstrap-rtl

 

{if ($is_rtl)}
<link rel="stylesheet" type="text/css" href="{$css_dir}bootstrap_lib/bootstrap-rtl.min.css" />
<link rel="stylesheet" type="text/css" href="{$css_dir}rtl.css" />
{/if}

 

I've made all the style changes in the rtl.css file, so that changing to LTR language keeps the same basic look. The file is not well commented, but the various sections align each module.

 

Notice:

I added a mirrored version of sprite-rtl.png: "default-bootstrap-RTL/img/jquery/uniform/sprite-rtl.png"

I modified blocklayered to support RTL: "default-bootstrap-RTL/js/modules/blocklayered/blocklayered.js", as well as "default-bootstrap-RTL/modules/blocklayered/blocklayered.tpl"

 

Update:

Currently tested on 1.6.0.8, simply copy&paste.

Backward compatibility is not guaranteed.

 

That's it. Enjoy.

 

@nashcontrol

@Nashcontroll

What ver of Presta your modification is tested and working 100% ?  Your Attached zip include all changes and modification in this post?

Link to comment
Share on other sites

  • 3 weeks later...
  • 4 weeks later...

Hi all, thank you Nashcontrol for the RTL fix, but i still have a problem with the currency. when i change the currnecy to what it should be = X00,000.00 it still shows the symbol at the right side and not the left. it was ok before updating the bootstrap files.

anyone here had that problem and fixed it or is it just me?

 

thank you!

Link to comment
Share on other sites

  • 5 months later...

Thank you nash, i don't know what u mean by resetting, it is not an option in prestashop BO, i just deleted and reinstalled it.

It didn't work, at the main page i see the currency in the right place but at the cart block and cart page and product page and other modules such as recent viewed and new and more the currency format is displayed on the right side of the price.

 

i'm using prestashop 1.6.0.11

 

another thing, the images with the arrows are twisted to the wrong side, the outward arrows are facing inwards and vice versa. you know something about that?

 

and the cart page is not RTL inside the columns, how can i fix that?

 

 

Thank you,

 

Wolf

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

The correct currency format should be: 0,000.00X

About the arrows, if you talking about the fontawesome arrow icons, you can either change in tpl files (right/left) or update via css (content: '...').

If you don't use multi lang site I suggest change in tpl files.

Link to comment
Share on other sites

Hi Yaniv, when i change the currency format the blocks i complained about stay the same, and the blocks that were fine before get twisted. so it's not the way, i think something in the css file of nash isn't working.

 

I'm a beginner in prestashop and with almost no coding experience, but i am a quick learner so if you could please direct me closer to what tpl files i need to edit would be great.

Do you mean the module tpl files inside the theme folder or what?

 

and can you explain how to rtl the columns in the cart page?

 

Thank you in advance.

 

Wolf

Link to comment
Share on other sites

Hi,

 

Can you post a link to the site?

The tpl's depends on where are you looking to change arrows.

theme tpl's are controller pages and module tpl's are related to each hooked module.

 

about the currency make sure you add space between symbol and price.

Link to comment
Share on other sites

  • 1 month later...

Hi,

 

I'm facing one issue here, I have 3 Languages Website, only those RTL (Hebrew) facing issue with the Arrows in the Buttons (Green and Gray buttons) - All the Arrows still displayed as in English so it's in the Wrong Direction.

 

Can you advise here where is the problem exactly?

 

Thanks...

 

Rabi

Link to comment
Share on other sites

Those arrows are font awesome icons.

You can either do it in the templates by adding if statement for language (is_rtl) and changing the arrows direction (chevron-left/chevron-right)

Or with css by changed the content in the specific font (might cause problems in other pages if you don't catch specific page).

 

It will be easier to help you if you will provide link to the site.

Link to comment
Share on other sites

Hi rabiaah,

 

This is a known issue in prestashop 1.6.0.14, the chevron icons' display property was changed.

 

I've updated the github repository with the required change.

 

quick fix (line 2316), add display:inline-block;

 

.icon-phone:before,.icon-chevron-right:before,.icon-chevron-left:before,.icon-truck:before,.icon-credit-card:before {
display:inline-block;
-webkit-transform: scale(-1, 1);
-moz-transform: scale(-1, 1);
-ms-transform: scale(-1, 1);
-o-transform: scale(-1, 1);
transform: scale(-1, 1); }

btw, to fix the add-to-cart notification with the bad item number, you should change the blockcart module translation in hebrew:

$_MODULE['<{blockcart}prestashop>blockcart_e5694b7726ceaf2f057e5f06cf86209e']

 

Link to comment
Share on other sites

Hey NashControl,

 

If you ever decide to submit it as SCCS,

can you split it into partials as a single _file.css per model, and one rtl.scss that combine them all?

this way it will be much easier to maintain and modify?

 

also this way it can be done in incremental steps.

 

Thank you any way.

 

Lyo 

Link to comment
Share on other sites

  • 2 weeks later...

hi 

have problem with the RTL issue. cannot find the original path.

default-bootstrap/img/jquery/uniform/

this path doesnt exist in my site.

where exactly i should put the relevant files?

 

i'm using version 1.6.0.14

 

thnx

Link to comment
Share on other sites

Hi,

 

I'm facing one more issue regarding the RTL, Please see Attachment, Write a Comment popup is not RTL and the Stars CSS not valid.

 

Can you check and Advice please?

 

 

 

 

Thanks,

 

Rabia

 

post-358593-0-13836400-1430576302_thumb.png

Link to comment
Share on other sites

  • 2 weeks later...

Hello There, I have some problem with currency symbol display, the symbol ₪‎ is on the right side. how do I change it to display on the left side

like this ₪‎123.90

 

I delete shekel currency and set again :( didn't work 

 

Thanks in advance

Link to comment
Share on other sites

I faced the issue with the review direction, after try and error I was able to fix it by adding the following to ccs file:

 

 

#criterions_list label {
  float: right !important;
}


#new_comment_form {
  text-align: right !important;
}
 

 

Best regards,

Link to comment
Share on other sites

thanks guys, updated the github repository along with some cleanups.

 

yosssii, what you did actually worked for me.. note that in the currency there is a small RTL symbol that you need to remove.

Can you point me out where do I need to remove the small RTL symbol you talking about ?

Link to comment
Share on other sites

Hi Friends,

 

Thank you for all the great information. I have applied the files (propbably need to download the latest from today).

I am a PrestaShop newbie, helping my [spam-filter] migrate to a self-hosted, self-controllered platform, after 7yrs :-)

I am trying to have the categories appear as a right column, and not at the footer, nor upper slider.

Any idea how I do that ?

Changing the right/left column preferences and selecting/deselecting the category item on the column list doesn't seem to have any effect.

 

Is the new RTL file disables the right/left column settings, cause right now it seems that most of the defaults are left on "left column" though they appear on the right.

 

Any insight will be highly appreicated.

 

Regards,

Ran

Link to comment
Share on other sites

Ok. So I got that fixed, by turning on Index on the left Column in Theme advanced options.

 

Left Column acts as right column for RTL ?

I now have a different problem, where when the categories do appear properly on the right, the facebook like block is cut in the frame.

Any idea where I fix that ?
(Screenshot attached)
 

post-1005255-0-72844700-1431783104_thumb.png

Link to comment
Share on other sites

  • 2 weeks later...

Ok. So I got that fixed, by turning on Index on the left Column in Theme advanced options.

 

Left Column acts as right column for RTL ?

 

I now have a different problem, where when the categories do appear properly on the right, the facebook like block is cut in the frame.

 

Any idea where I fix that ?

(Screenshot attached)

 

תגדיר את פייסבוק לשפה העברית, אמור להסתדר

Link to comment
Share on other sites

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

Hello everyone,

 

I wonder if this problem only on my store or someone have the same issue 

 

in heb language the page not loading on Iphone :(  , pc and android works fine.

in en language no problem  any idea ?

 

 

thanks in advance

Link to comment
Share on other sites

  • 1 month later...
  • 6 months later...

שלום לכולם 

 

שידרגתי עכשיו לגירסה 1.6.1.5

וכמובן של כל ה RTL 

התחרבש , האם בפוסט הנ"ל יש קבצים מעודכנים להורדה לגירסה זאת ?

 

תודה

שלומי

Link to comment
Share on other sites

  • 7 months later...

שלום לכולם 

 

שידרגתי עכשיו לגירסה 1.6.1.5

וכמובן של כל ה RTL 

התחרבש , האם בפוסט הנ"ל יש קבצים מעודכנים להורדה לגירסה זאת ?

 

תודה

שלומי

יש תשובה ?

Link to comment
Share on other sites

  • 2 weeks later...
  • 5 months 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...