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 english folder; copy that folder to another one named arabic, and rename the english.php file in the new folder to arabic.php (as we specified the Directory and Filename in the previous step)arabic.php file 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'
to be
$_['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.
<opencart_root>/catalog/view/theme/default/stylesheet.css and ie6.css. Copy these to rtl.stylesheet.css and rtl.ie6.css respectively 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..
<opencart_root>/catalog/view/theme/default/template/common/stylesheet.css is 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.
Comments
kue kering (not verified)
Fri, 10/05/2013 - 06:53
Permalink
Cool post very informative I
Cool post very informative I just found your site and read through a few posts although this is my first comment, i'll be including it in my favorites and visit again for sure. http://www.cemilcemil.com
wisata pulau tidung (not verified)
Thu, 16/05/2013 - 06:36
Permalink
I really liked it. Keep
I really liked it. Keep sharing such excellent post like this in future too. Informative and good article. I like it very much. Have very interesting c ontent to read out. Thanks dude http://www.munawartidung.com/
Add new comment