Get Free Audit

Localization in Prestashop

Jul 31, 2013

1258 Alex Simonchik

Localization in Prestashop

Localization can be defined as a set of entities (such as Languages and Translations, Currencies, Countries, Taxes, etc.) which are related to a customer’s geographical area.

A special Localization tab located in the back office helps administer these parameters.

This menu section contains the following sub-sections:

1. Localization

This section is responsible for setting default parameters:

1

Importing entities to a certain country

2

Setting default configurations for the current store

3

Setting default localizations for the current store

4

Setting additional configurations

 

2. Languages

This section helps install different language versions on a website.

5

Creating/editing a language version for a magazine

Class-Model: Language (classes/Language.php)

 

3. Zones

This one is responsible for managing geographical zones:

6

Class-Model: Zone (classes/Zone.php)

 

4. Countries

Managing available countries:

7

Class-Model: Country (classes/Country.php)

 

5. States

Managing states/regions of a certain country:

8

Class-Model: State (classes/State.php)

 

6. Currencies

Managing available store currencies:

9

Class-Model: Currency (classes/Currency.php)

 

7. Translations

Managing translations into other available languages:

10

The sections Taxes and Tax Rules are described in the article “Cart in Prestаshоp”.

Initializing localizations

You can get the current localization by using the method Context::getContext(). The properties of this class are set in the file config/ config.inc.php:

Andrey_Dubina
Partner With Us Let's discuss how to grow your business. Get a Free Quote.
Talk to Andrey

Using localizations

A static method is used here to get localizations in modules or other customizations there is used Contex::getContex().  For example:

  1. Context::getContext()->country //get customer’s current country model
  2. Context::getContext()->currency //get customer’s current currency model
  3. Context::getContext()->language //get customer’s current language model
Andrey Dubina
Partner With Us Looking for a partner to grow your business? We are the right company to bring your webstore to success. Talk to Andrey

2 Comments

  1. Maria,

    By default, all users get into the guest group. And for this group, you can create settings.

  2. Hi, I just stumbled upon your blog and I find it very educational, thanks for all the effort you’re putting into this

    I have this (maybe) weird question: I know how to show prices with or without taxes depending on the kind of user (guest, visitor, client). But is it possible to show prices or not depending on the LANGUAGE the user is viewing the site in?

    Most users don’t log in at first (so we don’t know where they come from, and therefore, we cannot apply tax rules), and are seeing prices with taxes when it shouldn’t be like this

Post a new comment

BelVG Newsletter
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.
Email *