OpenCart is a powerful open source shopping cart system. It has many features that enables you to setup your e-commerce business easily. Although the system is multilingual and templatable, its default theme doesn't support RTL. Here's how to add it..
<opencart_root>/catalog/language. It should include at least the
englishfolder; copy that folder to another one named
arabic, and rename the
english.phpfile in the new folder to
arabic.php(as we specified the Directory and Filename in the previous step)
arabic.phpfile to find a list of localized variables. In our RTLing process, we only care about the direction which can be found at line #4 as:
$_['direction'] = 'ltr'
change the value to be:
$_['direction'] = 'rtl'
and also update the
$_['code'] = 'en'
$_['code'] = 'ar'
dir='rtl'in the html based on the
$_['direction'] = 'rtl'in our language installation.
Now that we prepared our multilingual OpenCart system. It's time to make it multidirectional.
ie6.css. Copy these to
rtl.ie6.cssrespectively and RTL the directional rules while ommiting the non directional ones ( e.g
display:inline;). (use the third method explained in the tutorial on how to RTL your CSS).
Once you're done, all what we have to do is including these RTLed CSS in the template when an RTL language is being used. This is usually done in the ,
<head> section. So..
stylesheet.cssis being added at line #19. Add your RTLed file after it if the direction is rtl like this:
And that's it =) You can download the RTLed default theme(but not localized) below. Should you find any bugs or better suggestions on how to achieve this, please do mention it in the comments form below.
Note:There are some cool folks who localized the whole thing to Arabic over here. But it totally replaces the default theme to strictly use the RTL layout and you can't use the theme in a multilingual site. You can use their language files with the theme we just RTLed to get a multilingual and bidirectional theme
There are currently 0 users online.