RTLing OpenCart Default Theme

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..

1. Set your language to an RTL one

  • We'll go for Arabic. Go to your Admin Dashboard, go to the Languages page through the System > Localization > Languages, then click Insert to add your new Language. Below is how I added the Arabic language
    Adding the Arabic Language in OpenCart  
  • Go to your language folder in <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)
  • Open the newly renamed 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'
  • Now go to your Front End to make sure it's working, you'll see the language selection now includes both languages and the Arabic version now only flips the text direction. That is because the template added the dir='rtl' in the html based on the $_['direction'] = 'rtl' in our language installation.

2. RTL the theme

Now that we prepared our multilingual OpenCart system. It's time to make it multidirectional.

  1. Open the default theme directory. It's at <opencart_root>/catalog/view/theme/default/
  2. In the stylesheet folder, you'll find 2 CSS files: 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).

3. Enable the RTLed theme

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..

  1. Open the header.tpl file that can be found at <opencart_root>/catalog/view/theme/default/template/common/
  2. You'll find that the stylesheet.css is being added at line #19. Add your RTLed file after it if the direction is rtl like this:
    
    
       
    
    
  3. Apply the same method to the ie6.css link at line #21 like this: 
    
    
       
    
    

4. Enjoy it!

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

Average: 2.6 (37 votes)

Comments

how u handel this

<?php foreach ($styles as $style) { ?>
<link rel="<?php echo $style['rel']; ?>" type="text/css" href="<?php echo $style['href']; ?>" media="<?php echo $style['media']; ?>" />
<?php } ?>

thx very match ..

i like ALL u post .. Good JOOB

For almost ten years of providing excellent and exceptional product or service for the people in the United States and also the remaining people world wide, Acorn Stair Lift Incorporated has received an admirable rapport
to clients or buyers of stairlifts and other connected products.
Other times it's actually a flaw or crack that could
be fixed. Idea 1 - Remodel in, not out - Don't blow out a corner or side in your home using a big fancy addition (until you wish to live there many years).

excellent points altogether, you simply won a new reader.
What would you suggest about your put up that you just made a few days in the past?
Any positive?

I savour, cause I found exactly what I was having a look for.
You've ended my four day long hunt! God Bless you man. Have a nice day.
Bye

I'm impressed, I have to admit. Seldom do I encounter a blog that's both equally educative and entertaining, and without a doubt, you've hit
the nail on the head. The problem is something which too few people are speaking intelligently about.

I am very happy that I found this in my search for something
regarding this.

Much of what fasters bemoan about their habits in Ramadan is the few hours after
fetar when they turn into sedentary slobs, sedately coiled into one corner of the
couch, shuffling channels launched solely for their entertainment during the holy month.
A Palestinian man hangs decorations for the upcoming
holy months of Ramadan outside his home in Jerusalem's Old City
on July 31, 2011. These Islamic books are meant for the age group 7-10 years.

Wilkinson, who gave birth to daughter Alijah Mary
in May 2014, is now at her pre-baby weight, although she's still dieting and exercising to
get toned. Now, in your vegetarian weight loss diet meal plan, it should contain 5 meals
a day. Obesity is a major concern in the health sector today.

We're a bunch of volunteers and opening a new
scheme in our community. Your website provided us with helpful information to
work on. You've performed a formidable process and our whole community will be grateful to
you.

This is a very good article thanks
But what about if i am using multilingual website, I have two buttons select english and arabic laguages. how do i call only stylesheet.css when a user clicks on english buttonand both stylesheet.css and rtl.stylesheet.css when a user clicks on arabic button?

A Bible verse that is misquoted so many times comes to mind:
. Today, especially during our challenging
economic times, invoice factoring services can be a beneficial tool for business owners worldwide.
Whatever your business does, there will be a way for you to measure the influence of social media.

Okinawa City is probably the most Americanized town in Okinawa because it is right next to Kade-na Air Base.
The night you had detested so much could turn out to be the most satisfying event that you have experienced in your
entire career. Just appreciate all by yourself and stuff will take treatment
of on their own.

you're in reality a good webmaster. The site loading speed is amazing.
It kind of feels that you are doing any distinctive trick.
Also, The contents are masterpiece. you've done a
fantastic process in this matter!

I think I will return my Tom Tom and get a Garmin GPS.
MP3 devices are overflowing the marketplace these days.

On your own stereo, make sure you don't have your speaker wires crossed anywhere, as it
is very easy in all the confusing mass of wires to
actually hook a connection back onto itself.

If the reception is being held in the same place as the wedding,
you may write: reception to follow. Reply to each question to the best of your
capability. One of the first golfing rules of etiquette and a very important one at that is -"To learn to play properly before going out on the golf course".

If the reception is being held in the same place as the wedding,
you may write: reception to follow. Reply to each question to the best of your
capability. One of the first golfing rules of etiquette and a very important one at that is -"To learn to play properly before going out on the golf course".

Hello my loved one! I wish to say that this post is amazing,
great written and include almost all significant infos. I would like to see more posts like this
.

I enjoy reading through a post that can make men and women think.

Also, many thanks for allowing me to comment!

Excellent site. Plenty of helpful information here.

I am sending it to a few buddies ans additionally sharing in delicious.
And naturally, thank you to your sweat!

A retailer has revealed a possible release date for the upcoming Xbox 360 exclusive
title, Dragon Ball Z for Kinect. and Saibaman, but most
of them were great in their own right. There were 9 players in the tournament,
enough for 3 rounds of non-elimination match play, with prizes awarded to the top 4 finishers.

If some one needs to be updated with latest technologies afterward he must be pay a visit this
site and be up to datee everyday.

Olá, adorei extraordinariamente do seu blog! achei o tema muito
bem alinhado. escrevi um website no mesmo assunto e gostaria de ver se você tem alguma sugestão para quem está começando a postar
arrigos sobre isso. Obrigado!

I am basically impressed with this particular blog and that I wished to take the time to thanks from
my heart's base!

Having read this I believed it was really informative. I appreciate you spending some time and effort
to put this article together. I once again find myself spending a
lot of time both reading and commenting. But so what, it was still worthwhile!

If some one needs to be updated with most up-to-date technologies after that he must be go
to see this website and be up to date everyday.

Fragrance offers, fragrance, as well as scents are merely the
start. We will certainly supply your favored perfume to your doorstep
offering Free UNITED STATE delivery for orders over
$59.00 We only bring authentic brand name perfumes as well as fragrances at the most
effective feasible reduced cheap prices. Enroll in our
newsletter and also we will send you our special perfume vouchers
Customer evaluates on perfume, fragrance, personality and also skincare perfumes will aid you select the
fragrance that matches you ideal. FragranceNet and also
are hallmarks of, Inc.

Members can be sure to find ebony tgirls,
Latina shemales, TMILFs, post op tgirls and shemales that dig
on shemales. In some cases male-to-female transgendered people will
undergo hormone replacement therapy and a breast implant to
help with their life as a woman. There are several occasions when they need the company of a presentable
man for various events and that is where male escorts come in.

If you wish to make exztra Adsense money, you then'll have to work smarter
and tougher.

The message from this fantastic book is not to live a life of scrimping if it doesn't make you happy.

lrz formats some of the other sites that have free
e - Books might not be immediately compatible.
This book contains no technical theories and really focuses on how NOT To lose money.

It's hard to find knowledgeable people about this topic, but you sound
like you know what you're talking about! Thanks

Hi, after reading this amazing post i am also glad to
share my knowledge here with mates.

What's up mates, how is all, and what you want to say about this piece of writing, in my view its really amazing
in support of me.

Once you have this you'll be able to then enter this within the
MAC deal with safety space on your WiFi router.

The interface has been updated in the near recent past and it's actually rather functional and pleasant to use.

It's truly very complex in this active life to listen news on Television, so I just use the web
for that purpose, and take the most up-to-date information.

The interface has been updated in the near recent past and it's actually rather functional and pleasant to use.

"We've always called him Tommy," his mother said during his birthday party at Bahr Che, a trendy little boite on Astor Place in New York's East Village.
She also stated that the picture needed to come down, that had us confused as she stated it
was in a bedroom. These cards are like the trump cards of the deck and often represent a major significance in the reading.

I know this web page offers quality based articles or reviews and ther material,
is thhere any other website which offers such stuff in quality?

Aunque excitarse y provocarse el orgasmo usando el vibrador
es tan natural como el que se obtiene por otros medios.
Al final se consiguió un producto con una estética muy moderna y apetecible y unas funcionalidades excelentes para que, toda mujer, pueda lograr ciertos orgasmos femeninos.
Estoy conforme con lo que escribe la autora que por la comodidad y las prisas
de llegar al clímax, el empleo de un vibrador a solas (lo digo pues lo empleo a solas), ayuda a que se llegue más veloz
al clímax.
La paciente se tumbaba en un diván y el doctor le aplicaba el vibrador electromecánico en la entrepierna, consiguiendo un clímax en unos 10 minutos, más menos.

El artista pone en el solfa en el lema del proyecto el
caduco y humillante concepto médico victoriano de la histeria femenina que relacionaba todas y cada una
de las enfermedades femeninas con el útero y la opresión sexual y prescribía masajes pélvicos aparte de tratamientos vibrátiles.
De esta forma, contando con la inestimable de muchas de
nuestras clientas, os enumeramos los 5 vibradores femeninos que más placer han proporcionado.

Asi que hay que empujarles un tanto para disfrutar de una sexualidad más
excitante, distanciada de la rutina y sobre todo divertida.
Los fisioterapeutas nos han presentado el vibrador como una parte de su terapia para recuperar
la sensibilidad y el placer para eludir inconvenientes como el vaginismo, dificultad orgásmica, reducción de
la líbido, etc, y los sexólogos nos han dado ideas de como utilizarlo a solas en pareja
para tener una sexualidad más entretenida y
plena. Es aquí donde entran los aparatos vibradores para
masajear y hacer la tarea un tanto más fácil.
Para evitarlo, se recomienda sostener una buena higiene
y no compartir los vibradores tal como un uso moderado de estos juguetes.
El proyecto, llevado a cabo por el Centro de Promoción de la
Salud Sexual en la Universidad de Indiana (EE
UU) revela que la mayor parte de las mujeres (un 52 por ciento ) reconoció haber usado un vibrador.
Los médicos proseguían luchando contra histeria femenina acariciando manualmente
el clítoris y la vulva de las pacientes hasta que pudieran lograr lo que en aquella temporada era conocido
como ”paroxismo histérico”, que en realidad era un clímax.

Creemos que los juguetes eróticos en general y los vibradores en particular ayudan a progresar las relaciones sexuales.
Existe un estudio llevado a cabo con más de 3 mil quinientas mujeres en edades entre dieciséis y sesenta y ocho
años que deja patente, que el uso de los vibradores consoladores,
mejora la función sexual femenina y les mejora el carácter sensiblemente.
La mujer y el hombre siempre y en toda circunstancia han buscado formas
de sostener viva su sexualidad sin una pareja, si bien el
consolador femenino, vibrador con batería que conocemos, se
ideó en el siglo XIX (época victoriana) por un médico inglés llamado Joseph Mortimer Granville.

Yo he tenido múltiples a lo largo de mi vida, mas desde hace
una década a mis cuarenta años), cuando mi capacidad orgásmica y mi madurez sexual se dispararon a raiz de la separación de mi pareja el
padre de mi hija, decidí de manera consciente cambiar de vibrador a consolador sin vibración y fui probando hasta que encontré el
que más me gustaba, de mi talla hecho con un material flexible que imita la
flexibilidad del pene humano. En lo que se refiere al temido
efecto negativo del uso de vibradores en la relación de pareja,
es cierto que algunos hombres pueden sentirse agredidos si se introduce un juguete en la cama.
Investigaciones médicas han identificado que las oscilaciones que se aplican de una manera muy concreta pueden crear orgasmos impresionantemente profundos
y de gran alcance para los hombres.

Some studies show the people who arising from the financially weaker strata are most gamble.

Avoid leave it in a place with very low temperatures,
in direct sunlight, or heavy rain. Brazil has been working hard to get
their stadiums in good condition as they are hosting the World Cup (soccer) this summer.

When the S&P 500 broke above 2000 it entered a level research suggwsts could contain a large pullback.
Being sso they are worth reading about and
taking note of. Investors thinking about buying the best
organic food stocks should first make sure that they understand what the term
organic means.

Study on to find out much more!

Desalniettemin eventjes wat hierover completeren. Is
iets betreffende trap lifen.

Woman being a carved sculpture of Almighty, do have urge for sexual pleasure, in fact healthy sexual
life is equally important for a woman to induce impetus for a long and reliable relationship.
They attach to the man's genitals, and to the personal
computer via USB. To get more softball training aids
such as softball pitching aids, please visit.

For example, one segment asked the contestants to write Yelp reviews
for a strange orgy-like scenario in a music video. Proper stretching can't be
missed after each practice or game. Finally, Rosie Huntington-Whiteley-British model and actress-shared plenty of up close and personal images on social media.

Seems obvious and simple but surprisingly people really can.
Marketers are still faced with the same problem they have been facing for a while.
To make money online you need to make some work, nothing comes as result of doing nothing, and the online world is so different than the real word but when
it comes to make money it is pretty much the same, it's true that the possibilities are endless, the opportunities are endless and the
potential is limitless, but the process of making money online depends of some tasks you need
to perform, and how good you can do them will determine how much money you will
earn.

Hi Dear,
first thanks for your learning.
i select my rtl language and my details is the $_['code'] = 'fa'; $_['direction'] = 'rtl'; then follow your way but when i echo $direction in header.tpl shown ltr. i dont know why the current language is ltr !! :-(

Can you help me for it ?

Thanks.

Thanks for every other magnificent post. Where else
could anybody get that kind of info in such an ideal means of writing?
I've a presentation next week, and I am on the look for such information.

Selecting a trade that will multiply your trading balance is just not much harder than being profitable with a regular trade.
Unlike other ttypes of options, all that traders need to
do is call their strike price, which is the point aat which they predict their asset
wijll settle on the expiratiuon date, and they will
receive a return if they are correct. Registered brokers arre often subjected tto periodic inspections to ensure that they are playing by the rules.

Make sure you go through the features offered by the device and
understand its specifications like processor type, speed, screen resolution, image format it supports, audio & video support
etc. Make sure you pay attention to a game's rating when buying a gift.

You can read game reviews, download games and play them online.

Pages

Add new comment

Twitter Updates

Recent comments

Who's online

There are currently 0 users online.