PrestaShop + Docker

コマンドによるキャッシュクリア

コンテナ内で以下フォルダ削除

$ docker exec -ti prestashop-fpm bash
# rm -r var/cache/prod

または、 bin/console コマンドによりキャッシュクリア(--env=prod or --env=dev)

# bin/console cache:clear --env=prod

bin/console コマンド一覧

# bin/console list
Symfony 3.4.49 (kernel: app, env: dev, debug: true)

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display this help message
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -e, --env=ENV         The Environment name. [default: "dev"]
      --no-debug        Switches off debug mode.
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  about                                               Displays information about the current project
  help                                                Displays help for a command
  list                                                Lists commands
 assets
  assets:install                                      Installs bundles web assets under a public directory
 cache
  cache:clear                                         Clears the cache
  cache:pool:clear                                    Clears cache pools
  cache:pool:prune                                    Prunes cache pools
  cache:warmup                                        Warms up an empty cache
 config
  config:dump-reference                               Dumps the default configuration for an extension
 debug
  debug:autowiring                                    Lists classes/interfaces you can use for autowiring
  debug:config                                        Dumps the current configuration for an extension
  debug:container                                     Displays current services for an application
  debug:event-dispatcher                              Displays configured listeners for an application
  debug:form                                          Displays form type information
  debug:router                                        Displays current routes for an application
  debug:swiftmailer                                   Displays current mailers for an application
  debug:tactician                                     
  debug:translation                                   Displays translation messages information
  debug:twig                                          Shows a list of twig functions, filters, globals and tests
 doctrine
  doctrine:cache:clear-collection-region              Clear a second-level cache collection region
  doctrine:cache:clear-entity-region                  Clear a second-level cache entity region
  doctrine:cache:clear-metadata                       Clears all metadata cache for an entity manager
  doctrine:cache:clear-query                          Clears all query cache for an entity manager
  doctrine:cache:clear-query-region                   Clear a second-level cache query region
  doctrine:cache:clear-result                         Clears result cache for an entity manager
  doctrine:cache:contains                             Check if a cache entry exists
  doctrine:cache:delete                               Delete a cache entry
  doctrine:cache:flush                                [doctrine:cache:clear] Flush a given cache
  doctrine:cache:stats                                Get stats on a given cache provider
  doctrine:database:create                            Creates the configured database
  doctrine:database:drop                              Drops the configured database
  doctrine:database:import                            Import SQL file(s) directly to Database.
  doctrine:ensure-production-settings                 Verify that Doctrine is properly configured for a production environment
  doctrine:generate:entities                          [generate:doctrine:entities] Generates entity classes and method stubs from your mapping information
  doctrine:mapping:convert                            [orm:convert:mapping] Convert mapping information between supported formats
  doctrine:mapping:import                             Imports mapping information from an existing database
  doctrine:mapping:info                               
  doctrine:query:dql                                  Executes arbitrary DQL directly from the command line
  doctrine:query:sql                                  Executes arbitrary SQL directly from the command line.
  doctrine:schema:create                              Executes (or dumps) the SQL needed to generate the database schema
  doctrine:schema:drop                                Executes (or dumps) the SQL needed to drop the current database schema
  doctrine:schema:update                              Executes (or dumps) the SQL needed to update the database schema to match the current mapping metadata
  doctrine:schema:validate                            Validate the mapping files
 fos
  fos:js-routing:debug                                Displays currently exposed routes for an application
  fos:js-routing:dump                                 Dumps exposed routes to the filesystem
 lint
  lint:twig                                           Lints a template and outputs encountered errors
  lint:xliff                                          Lints a XLIFF file and outputs encountered errors
  lint:yaml                                           Lints a file and outputs encountered errors
 prestashop
  prestashop:licenses:update                          Rewrite your licenses to be up-to-date
  prestashop:linter:legacy-link                       Checks if _legacy_link is configured in BackOffice routes
  prestashop:linter:naming-convention                 Checks if Back Office routes and controllers follow naming convention.
  prestashop:linter:security-annotation               Checks if Back Office route controllers has configured Security annotations.
  prestashop:list:commands-and-queries                Lists available CQRS commands and queries
  prestashop:mail:generate                            Generate mail templates for a specified theme
  prestashop:module                                   Manage your modules via command line
  prestashop:schema:update-without-foreign            Update the database
  prestashop:taxes:update-eu-tax-rule-groups          Update EU Tax rule groups
  prestashop:theme:enable                             Manage your themes via command line
  prestashop:theme:export                             Create zip to distribute theme with its dependencies
  prestashop:translation:find-duplicates              Find duplicates of your translations
  prestashop:update:configuration-file-hooks-listing  Appends configuration file hooks list
  prestashop:update:sql-upgrade-file-hooks-listing    Adds sql to sql upgrade file which contains hook insert opeartion
 router
  router:match                                        Helps debug routes by simulating a path info match
 security
  security:check                                      Checks security issues in your project dependencies
  security:encode-password                            Encodes a password.
 server
  server:log                                          Starts a log server that displays logs in real time
  server:run                                          Runs a local web server
  server:start                                        Starts a local web server in the background
  server:status                                       Outputs the status of the local web server
  server:stop                                         Stops the local web server that was started with the server:start command
 swiftmailer
  swiftmailer:email:send                              Send simple email message
  swiftmailer:spool:send                              Sends emails from the spool
 translation
  translation:update                                  Updates the translation file

テンプレートのカスタマイズ

テーマのテンプレートディレクトリ
themes/classic/templates/_partials

テンプレート編集後は管理画面から
Advanced Parameters ---> Performance からキャッシュをクリアすることで変更内容が反映されます。

ex) Footerの編集

# nano themes/classic/templates/_partials/footer.tpl
<a href="https://www.prestashop.com" target="_blank" rel="noopener noreferrer nofollow">
              {l s='%copyright% %year% - Ecommerce software by %prestashop%' sprintf=['%prestashop%' => 'PrestaShop™', '%year%' => 'Y'|date, '%copyright%' => '©'] d='Shop.Theme.Global'}
            </a>

通貨レートアップデート

モジュールによる通貨レートのアップデートではなく、ホストマシンのクローンジョブで対応。以下のコマンドをクローンジョブに追加。

# php /var/www/html/admin/cron_currency_rates.php secure_key=displayed_the_correct_secure_key

$secureKey は以下ファイルの一部を変更(echoによる確認)し抽出。抽出後削除すること。

/var/www/html/admin/cron_currency_rates.php

if (isset($_GET['secure_key'])) {
    $secureKey = md5(_COOKIE_KEY_.Configuration::get('PS_SHOP_NAME'));
    echo $secureKey;
    if (!empty($secureKey) && $secureKey === $_GET['secure_key']) {
        $shop_ids = Shop::getCompleteListOfShopsID();
        foreach ($shop_ids as $shop_id) {
            Shop::setContext(Shop::CONTEXT_SHOP, (int)$shop_id);
            Currency::refreshCurrencies();
        }
    }
}

secure_key=xxxxx を適当に指定すると正しい$securekeyが表示されます。

# php /var/www/html/admin/cron_currency_rates.php secure_key=xxxxx
asd4567890jj

これをクローンジョブのsecure_keyに指定します。

#Prestashop currency update schedule
* 2 * * * docker exec -u www-data prestashop-container php /var/www/html/admin/cron_currency_rates.php secure_key=asd4567890jj

ロケーションデータの挿入

ロケーションデータGeoLite2 Cityを下記サイトからダウンロード
https://www.maxmind.com/en/accounts/353548/geoip/downloads

展開したファイル GeoLite2-City.mmdbapp/Resources/geoip へコピーして
“Geolocation by IP address” を有効にします。

Gmail SMTPサーバの設定

テストメール送信時のバグ。Chromeの自動入力によるアカウントのパスワードでSMTPサーバにアクセスしているため。Chromeの自動入力設定を削除するか、自動入力されないアカウントで設定することにより回避。

E-Mailテンプレートの編集

ModernよりもClassicテーマの方がレイアウトが整然としていて見やすいです。

メールで使用される各テンプレートは、テーマ毎 (Modern, Classic)mails/themes に纏められています。

mails/themes フォルダ内の各テーマの twig ファイルから、html または txt 形式のファイルが作成されます(この作成作業は、管理画面のデザイン ---> Email Theme ---> Generate emails から行うか、以下のprestashop:mail:generateでも可能です)。

prestashop:mail:generate

# bin/console prestashop:mail:generate --help               
Usage:
  prestashop:mail:generate [options] [--] <theme> <locale> [<coreOutputFolder>] [<modulesOutputFolder>]

Arguments:
  theme                        Theme to use for mail templates.
  locale                       Which locale to use for the templates.
  coreOutputFolder             Output folder to export core templates.
  modulesOutputFolder          Output folder to export modules templates (by default same as core).

Options:
  -o, --overwrite[=OVERWRITE]  Overwrite existing templates [default: false]
  -h, --help                   Display this help message
  -q, --quiet                  Do not output any message
  -V, --version                Display this application version
      --ansi                   Force ANSI output
      --no-ansi                Disable ANSI output
  -n, --no-interaction         Do not ask any interactive question
  -e, --env=ENV                The Environment name. [default: "dev"]
      --no-debug               Switches off debug mode.
  -v|vv|vvv, --verbose         Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

ロケールと上書きオプションを指定してジェネレートコマンドを実行

# bin/console prestashop:mail:generate -o true classic ja-JP
# bin/console prestashop:mail:generate -o true classic en-US

また、作成されたテーマごとのメール送信テストは、 Email themes から行うことが出来ます(選択したテーマでのみ送信テストが可能)。


作成されたテンプレートをさらに細かく編集したい場合には、以下翻訳メニューから行うことが出来ます。

International ---> Translations ---> Modify Translations から以下の項目を選択

Core emails から編集するテンプレートを選択

テンプレートの編集箇所が多い場合は、直接twigファイルを編集したほうが良いかもしれません。上記テンプレートの {recycled_packaging_label} やフッター prestashop へのリンクを削除する場合は、メールコアの order_conf で該当する表の行を削除するか、

次のClassicテーマのtwigテンプレート

mails/themes/classic/conponents/footer.html.twig
mails/themes/classic/core/order_conf.html.twig

から該当箇所を削除し、以下のメニュー画面に従って言語毎に再作成します(編集後、所有権の修正を忘れずに)。


Gmail SMTPサーバによる送信メール内のイメージについて


メール関連ファイル

コントローラ
src/PrestaShopBundle/Controller/Admin/Configure/AdvancedParameters/EmailController.php

管理画面メール設定ファイル
src/PrestaShopBundle/Resources/config/routing/admin/configure/advanced_parameters/email.yml

テンプレート設定ファイル
src/PrestaShopBundle/Resources/config/services/core/mail_template.yml

  prestashop.core.mail_template.theme_folder_catalog:
    class: 'PrestaShop\PrestaShop\Core\MailTemplate\FolderThemeCatalog'
    arguments:
      - '%mail_themes_dir%'
      - '@prestashop.core.mail_template.theme_folder_scanner'
      - '@prestashop.core.hook.dispatcher'

  prestashop.core.mail_template.variables_builder:
    class: 'PrestaShop\PrestaShop\Core\MailTemplate\Layout\LayoutVariablesBuilder'
    arguments:
      - '@prestashop.core.hook.dispatcher'
      - '@prestashop.core.language.language_default_fonts_catalog'
      - mailThemesUrl: "@=service('prestashop.adapter.legacy.context').getMailThemesUrl()"

上記 mailThemesUrl は、
src/Adapter/LegacyContext.php

/**
     * Url to the mail themes folder
     *
     * @return string
     */
    public function getMailThemesUrl()
    {
        return $this->tools->getShopDomainSsl(true) . __PS_BASE_URI__ . $this->mailThemesUri;
    }

管理画面メール設定テンプレートフォルダ
src/PrestaShopBundle/Resources/views/Admin/Configure/AdvancedParameters/Email

Twig Configration
app/config/config.yml

# Twig Configuration
twig:
    autoescape:       "name"
    debug:            "%kernel.debug%"
    strict_variables: "%kernel.debug%"
    form_themes:
        - 'PrestaShopBundle:Admin/TwigTemplateForm:bootstrap_4_horizontal_layout.html.twig'
    paths:
        '%admin_page%/Product': Product
        '%admin_page%/TwigTemplateForm': Twig
        '%admin_page%/Common': Common
        '%admin_page%/Configure/AdvancedParameters': AdvancedParameters
        '%admin_page%/Configure/ShopParameters': ShopParameters
        '%kernel.root_dir%/../modules': Modules
        '%mail_themes_dir%': MailThemes
    globals:
        webpack_server: false
        multistore_field_prefix: !php/const:PrestaShopBundle\Service\Form\MultistoreCheckboxEnabler::MULTISTORE_FIELD_PREFIX

送信メールテンプレート
mails/themes/modern/core/order_conf.html.twig

<img src="{{ mailThemesUrl }}/modern/assets/baseline-local_shipping-24px.png" style="margin-{{ align_right }}:10px">

ストアURL、ドメイン変更

ストアURLとSEO対策

Shop Parameters ---> Traffic & SEO ---> SEO & URLs

:bangbang: 注)ドメインを変更する場合は上記URLとdocker-composeファイル(または.env)で指定したPS_DOMAINを変更します。

Customer Reassurance Module

セキュリティ、デリバリー、リターンポリシーの設定

Modules ---> Module Manager ---> Theme Module ---> Customer Assurance

登録ユーザ住所・配送先住所:国・都市選択メニュー

住所登録の際の国・都市のプルダウン選択メニューに表示させる項目の追加

左下 “Bulk actions” ボタンにより、一覧表から選択した 国(Countries)・都市(States)有効または無効にします。

International ---> Locations ---> "Countries" or "States"

Countries

States

:warning:
注)日本の都道府県がISOコード別に二重で登録されているため、片方を無効化。

日本語ローカライゼーション

Locarization ---> Languages ---> 日本語

ISOコードjp ではなく ja にしないと日本語の翻訳データがダウンロード出来ません。

日本語の翻訳データのダウンロード

Locarization ---> Languages ---> Import a localization pack ---> Japan
で日本語翻訳データのインポート(税、単位、都市、通貨、言語をチェック)。

日本語翻訳文中の変数は %s で前後に半角スペースを挿入すること。

File Structure

/app

This directory contains the configuration for the bundles and the framework.

It contains the following subdirectories:

  • /config: configuration files for database, parameters, services, etc.
  • /logs: execution logs
  • /Resources: different resources for the software, most notably the /translations subdirectory which contains translation resources for all the installed languages.
  • /test: reserved

This directory also includes the AppKernel.php file, which configures the Symfony application.

/controllers

Contains controllers – as in Model-View-Controller (or MVC), the software architecture used by PrestaShop. Each file controls a specific part of PrestaShop.

Controllers are separated in two directories:

  • /admin: contains legacy controllers for the Back Office
  • /front: contains controllers for the Front Office

/mails

Contains all HTML and text templates for e-mails sent by PrestaShop. Each language has its specific folder, where you can manually edit their content if you wish. PrestaShop contains a tool to edit your e-mails, located in the back office, in the Localization > Translation page.

Since 1.7.6 this directory also contains Mail themes.

/modules

Contains all of PrestaShop’s modules, each in its own folder.
If you wish to definitely remove a module, it is better to uninstall it from the back office.

/src

Contains the new architecture files (Core, Adapter and PrestaShop Bundle). To learn more, see Understanding the “src” folder.

  • Core: contains business logic classes
  • Adapter: business logic classes that still depend on legacy framework (for instance: Context, Dispatcher or constants);
  • PrestaShopBundle: classes that acts as a glue between PrestaShop classes and Symfony

Symfony controllers & routing

Read the Symfony documentation on Controllers and Routing.

src/PrestaShopBundle/Controller

Controller/
└── Admin
    ├── Configure
    │   ├── AdvancedParameters
    │   └── ShopParameters
    ├── Improve
    │   ├── Design
    │   ├── International
    │   ├── Modules
    │   ├── Payment
    │   └── Shipping
    └── Sell
        ├── Catalog
        ├── Customers
        ├── CustomerService
        ├── Orders
        └── Stats

Routing in PrestaShop

Routes are responsible for mapping a controller action to an url, you can read more about routing in symfony docs.

PrestaShop uses YAML files for service declaration and routing (NOT ANNOTATIONS).

Routes are declared in

src/PrestaShopBundle/Resources/config/admin

folder, following the menu organization.

The routing is organized as follows:

.
├── admin
│   ├── _common.yml
│   ├── configure
│   │   ├── advanced_parameters
│   │   ├── _configure.yml
│   │   └── shop_parameters
│   ├── improve
│   │   ├── design
│   │   ├── _improve.yml
│   │   ├── international
│   │   ├── modules
│   │   ├── payment
│   │   └── shipping
│   ├── _security.yml
│   └── sell
│       ├── catalog
│       ├── orders
│       ├── _sell.yml
│       └── stocks.yml
├── admin.yml
├── api
│   ├── attributes.yml
│   ├── categories.yml
│   ├── features.yml
│   ├── i18n.yml
│   ├── improve
│   │   └── design
│   ├── manufacturers.yml
│   ├── stock_movements.yml
│   ├── stocks.yml
│   ├── suppliers.yml
│   └── translations.yml
└── api.yml

URI, ディレクトリ

Name Language Example Type Front, back?
_PS_ROOT_DIR_ PHP /var/www/html/prestashop full path front + back
root_url Twig /prefix/
__PS_BASE_URI__ PHP /prefix/ relative url
baseAdminDir Javascript /prefix/admin-dev/ back
baseDir Javascript /prefix/ back
basename(PS_ADMIN_DIR) PHP admin-dev folder name back
prestashop.urls Javascript base_url:‘’, current_url:‘’, shop_domain_url:‘’, img_ps_url:‘’, img_cat_url:’’, … front
{$base_url} Smarty https://myshop.com/prefix/ full url back
{$base_url} Smarty
{$baseAdminUrl} Smarty /prefix/admin-dev/ relative url back
{$img_base_path} Smarty /admin-dev/ back
{$urls.base_url} Smarty https://myshop.com/prefix/ full url front

管理画面コントローラ


controllers/admin/AdminCountriesController.php

都市
controllers/admin/AdminStatesController.php

PHP syntax check

# php -l  <file>
        Syntax check only (lint)
# find . -type f -name '*.php' ! -path "./vendor/*" ! -path "./tests/*" -exec php -l -n {} \; | (! grep -v "No syntax errors detected")

Fixed

classes/State.php
County ---> Country, Counties ---> Countries

    /**
     * Has Countries.
     *
     * @param int $idState
     *
     * @return int
     */
    public static function hasCountries($idState)
    {
        return count(Country::getCountries((int) $idState));
    }

多言語対応

データベース上のルール

  • Tables which contain translations must end with the _lang suffix. For instance, ps_product_lang contains all the translations for the ps_product table.
  • Use the id_lang field to store the language associated with a record.

SQLテーブルデータ一覧

テーブルの追加・編集は以下sqlデータを参照のこと(自動インストール後はinstallディレクトリは削除されます)。

テーブルコンテンツ

テーブル Country

/* Country specific data */
CREATE TABLE `PREFIX_country` (
  `id_country` int(10) unsigned NOT NULL auto_increment,
  `id_zone` int(10) unsigned NOT NULL,
  `id_currency` int(10) unsigned NOT NULL DEFAULT '0',
  `iso_code` varchar(3) NOT NULL,
  `call_prefix` int(10) NOT NULL DEFAULT '0',
  `active` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `contains_states` tinyint(1) NOT NULL DEFAULT '0',
  `need_identification_number` tinyint(1) NOT NULL DEFAULT '0',
  `need_zip_code` tinyint(1) NOT NULL DEFAULT '1',
  `zip_code_format` varchar(12) NOT NULL DEFAULT '',
  `display_tax_label` BOOLEAN NOT NULL,
  PRIMARY KEY (`id_country`),
  KEY `country_iso_code` (`iso_code`),
  KEY `country_` (`id_zone`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8mb4 COLLATION;

/* Localized country information */
CREATE TABLE `PREFIX_country_lang` (
  `id_country` int(10) unsigned NOT NULL,
  `id_lang` int(10) unsigned NOT NULL,
  `name` varchar(64) NOT NULL,
  PRIMARY KEY (`id_country`, `id_lang`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8mb4 COLLATION;

テーブル State

/* State localization info */
CREATE TABLE `PREFIX_state` (
  `id_state` int(10) unsigned NOT NULL auto_increment,
  `id_country` int(11) unsigned NOT NULL,
  `id_zone` int(11) unsigned NOT NULL,
  `name` varchar(64) NOT NULL,
  `iso_code` varchar(7) NOT NULL,
  `tax_behavior` smallint(1) NOT NULL DEFAULT '0',
  `active` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id_state`),
  KEY `id_country` (`id_country`),
  KEY `name` (`name`),
  KEY `id_zone` (`id_zone`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8mb4 COLLATION;

上記初期テーブル以外のテーブルはDoctrineにより作成されます。

関連ディレクトリ
src/PrestaShopBundle/Entity/

テーブル ps_state_lang

以下SQLコマンドで新規に作成したテーブルにデータ挿入。PREFIXは任意。

INSERT INTO `PREFIX_state_lang` (`id_state`, `id_lang`, `name`) VALUES
('1', '1', 'AA'),
('1', '2', 'AA'),
('2', '1', 'AE'),
('2', '2', 'AE'),
('3', '1', 'AP'),
('3', '2', 'AP'),
('4', '1', 'Alabama'),
('4', '2', 'Alabama'),
('5', '1', 'Alaska'),
('5', '2', 'Alaska'),
('6', '1', 'Arizona'),
('6', '2', 'Arizona'),
('7', '1', 'Arkansas'),
('7', '2', 'Arkansas'),
('8', '1', 'California'),
('8', '2', 'California'),
('9', '1', 'Colorado'),
('9', '2', 'Colorado'),
('10', '1', 'Connecticut'),
('10', '2', 'Connecticut'),
('11', '1', 'Delaware'),
('11', '2', 'Delaware'),
('12', '1', 'Florida'),
('12', '2', 'Florida'),
('13', '1', 'Georgia'),
('13', '2', 'Georgia'),
('14', '1', 'Hawaii'),
('14', '2', 'Hawaii'),
('15', '1', 'Idaho'),
('15', '2', 'Idaho'),
('16', '1', 'Illinois'),
('16', '2', 'Illinois'),
('17', '1', 'Indiana'),
('17', '2', 'Indiana'),
('18', '1', 'Iowa'),
('18', '2', 'Iowa'),
('19', '1', 'Kansas'),
('19', '2', 'Kansas'),
('20', '1', 'Kentucky'),
('20', '2', 'Kentucky'),
('21', '1', 'Louisiana'),
('21', '2', 'Louisiana'),
('22', '1', 'Maine'),
('22', '2', 'Maine'),
('23', '1', 'Maryland'),
('23', '2', 'Maryland'),
('24', '1', 'Massachusetts'),
('24', '2', 'Massachusetts'),
('25', '1', 'Michigan'),
('25', '2', 'Michigan'),
('26', '1', 'Minnesota'),
('26', '2', 'Minnesota'),
('27', '1', 'Mississippi'),
('27', '2', 'Mississippi'),
('28', '1', 'Missouri'),
('28', '2', 'Missouri'),
('29', '1', 'Montana'),
('29', '2', 'Montana'),
('30', '1', 'Nebraska'),
('30', '2', 'Nebraska'),
('31', '1', 'Nevada'),
('31', '2', 'Nevada'),
('32', '1', 'New Hampshire'),
('32', '2', 'New Hampshire'),
('33', '1', 'New Jersey'),
('33', '2', 'New Jersey'),
('34', '1', 'New Mexico'),
('34', '2', 'New Mexico'),
('35', '1', 'New York'),
('35', '2', 'New York'),
('36', '1', 'North Carolina'),
('36', '2', 'North Carolina'),
('37', '1', 'North Dakota'),
('37', '2', 'North Dakota'),
('38', '1', 'Ohio'),
('38', '2', 'Ohio'),
('39', '1', 'Oklahoma'),
('39', '2', 'Oklahoma'),
('40', '1', 'Oregon'),
('40', '2', 'Oregon'),
('41', '1', 'Pennsylvania'),
('41', '2', 'Pennsylvania'),
('42', '1', 'Rhode Island'),
('42', '2', 'Rhode Island'),
('43', '1', 'South Carolina'),
('43', '2', 'South Carolina'),
('44', '1', 'South Dakota'),
('44', '2', 'South Dakota'),
('45', '1', 'Tennessee'),
('45', '2', 'Tennessee'),
('46', '1', 'Texas'),
('46', '2', 'Texas'),
('47', '1', 'Utah'),
('47', '2', 'Utah'),
('48', '1', 'Vermont'),
('48', '2', 'Vermont'),
('49', '1', 'Virginia'),
('49', '2', 'Virginia'),
('50', '1', 'Washington'),
('50', '2', 'Washington'),
('51', '1', 'West Virginia'),
('51', '2', 'West Virginia'),
('52', '1', 'Wisconsin'),
('52', '2', 'Wisconsin'),
('53', '1', 'Wyoming'),
('53', '2', 'Wyoming'),
('54', '1', 'Puerto Rico'),
('54', '2', 'Puerto Rico'),
('55', '1', 'US Virgin Islands'),
('55', '2', 'US Virgin Islands'),
('56', '1', 'District of Columbia'),
('56', '2', 'District of Columbia'),
('57', '1', 'Aguascalientes'),
('57', '2', 'Aguascalientes'),
('58', '1', 'Baja California'),
('58', '2', 'Baja California'),
('59', '1', 'Baja California Sur'),
('59', '2', 'Baja California Sur'),
('60', '1', 'Campeche'),
('60', '2', 'Campeche'),
('61', '1', 'Chiapas'),
('61', '2', 'Chiapas'),
('62', '1', 'Chihuahua'),
('62', '2', 'Chihuahua'),
('63', '1', 'Coahuila'),
('63', '2', 'Coahuila'),
('64', '1', 'Colima'),
('64', '2', 'Colima'),
('65', '1', 'Ciudad de México'),
('65', '2', 'Ciudad de México'),
('66', '1', 'Durango'),
('66', '2', 'Durango'),
('67', '1', 'Guanajuato'),
('67', '2', 'Guanajuato'),
('68', '1', 'Guerrero'),
('68', '2', 'Guerrero'),
('69', '1', 'Hidalgo'),
('69', '2', 'Hidalgo'),
('70', '1', 'Jalisco'),
('70', '2', 'Jalisco'),
('71', '1', 'Estado de México'),
('71', '2', 'Estado de México'),
('72', '1', 'Michoacán'),
('72', '2', 'Michoacán'),
('73', '1', 'Morelos'),
('73', '2', 'Morelos'),
('74', '1', 'Nayarit'),
('74', '2', 'Nayarit'),
('75', '1', 'Nuevo León'),
('75', '2', 'Nuevo León'),
('76', '1', 'Oaxaca'),
('76', '2', 'Oaxaca'),
('77', '1', 'Puebla'),
('77', '2', 'Puebla'),
('78', '1', 'Querétaro'),
('78', '2', 'Querétaro'),
('79', '1', 'Quintana Roo'),
('79', '2', 'Quintana Roo'),
('80', '1', 'San Luis Potosí'),
('80', '2', 'San Luis Potosí'),
('81', '1', 'Sinaloa'),
('81', '2', 'Sinaloa'),
('82', '1', 'Sonora'),
('82', '2', 'Sonora'),
('83', '1', 'Tabasco'),
('83', '2', 'Tabasco'),
('84', '1', 'Tamaulipas'),
('84', '2', 'Tamaulipas'),
('85', '1', 'Tlaxcala'),
('85', '2', 'Tlaxcala'),
('86', '1', 'Veracruz'),
('86', '2', 'Veracruz'),
('87', '1', 'Yucatán'),
('87', '2', 'Yucatán'),
('88', '1', 'Zacatecas'),
('88', '2', 'Zacatecas'),
('89', '1', 'Ontario'),
('89', '2', 'Ontario'),
('90', '1', 'Quebec'),
('90', '2', 'Quebec'),
('91', '1', 'British Columbia'),
('91', '2', 'British Columbia'),
('92', '1', 'Alberta'),
('92', '2', 'Alberta'),
('93', '1', 'Manitoba'),
('93', '2', 'Manitoba'),
('94', '1', 'Saskatchewan'),
('94', '2', 'Saskatchewan'),
('95', '1', 'Nova Scotia'),
('95', '2', 'Nova Scotia'),
('96', '1', 'New Brunswick'),
('96', '2', 'New Brunswick'),
('97', '1', 'Newfoundland and Labrador'),
('97', '2', 'Newfoundland and Labrador'),
('98', '1', 'Prince Edward Island'),
('98', '2', 'Prince Edward Island'),
('99', '1', 'Northwest Territories'),
('99', '2', 'Northwest Territories'),
('100', '1', 'Yukon'),
('100', '2', 'Yukon'),
('101', '1', 'Nunavut'),
('101', '2', 'Nunavut'),
('102', '1', 'Buenos Aires'),
('102', '2', 'Buenos Aires'),
('103', '1', 'Catamarca'),
('103', '2', 'Catamarca'),
('104', '1', 'Chaco'),
('104', '2', 'Chaco'),
('105', '1', 'Chubut'),
('105', '2', 'Chubut'),
('106', '1', 'Ciudad de Buenos Aires'),
('106', '2', 'Ciudad de Buenos Aires'),
('107', '1', 'Córdoba'),
('107', '2', 'Córdoba'),
('108', '1', 'Corrientes'),
('108', '2', 'Corrientes'),
('109', '1', 'Entre Ríos'),
('109', '2', 'Entre Ríos'),
('110', '1', 'Formosa'),
('110', '2', 'Formosa'),
('111', '1', 'Jujuy'),
('111', '2', 'Jujuy'),
('112', '1', 'La Pampa'),
('112', '2', 'La Pampa'),
('113', '1', 'La Rioja'),
('113', '2', 'La Rioja'),
('114', '1', 'Mendoza'),
('114', '2', 'Mendoza'),
('115', '1', 'Misiones'),
('115', '2', 'Misiones'),
('116', '1', 'Neuquén'),
('116', '2', 'Neuquén'),
('117', '1', 'Río Negro'),
('117', '2', 'Río Negro'),
('118', '1', 'Salta'),
('118', '2', 'Salta'),
('119', '1', 'San Juan'),
('119', '2', 'San Juan'),
('120', '1', 'San Luis'),
('120', '2', 'San Luis'),
('121', '1', 'Santa Cruz'),
('121', '2', 'Santa Cruz'),
('122', '1', 'Santa Fe'),
('122', '2', 'Santa Fe'),
('123', '1', 'Santiago del Estero'),
('123', '2', 'Santiago del Estero'),
('124', '1', 'Tierra del Fuego'),
('124', '2', 'Tierra del Fuego'),
('125', '1', 'Tucumán'),
('125', '2', 'Tucumán'),
('126', '1', 'Agrigento'),
('126', '2', 'Agrigento'),
('127', '1', 'Alessandria'),
('127', '2', 'Alessandria'),
('128', '1', 'Ancona'),
('128', '2', 'Ancona'),
('129', '1', 'Aosta'),
('129', '2', 'Aosta'),
('130', '1', 'Arezzo'),
('130', '2', 'Arezzo'),
('131', '1', 'Ascoli Piceno'),
('131', '2', 'Ascoli Piceno'),
('132', '1', 'Asti'),
('132', '2', 'Asti'),
('133', '1', 'Avellino'),
('133', '2', 'Avellino'),
('134', '1', 'Bari'),
('134', '2', 'Bari'),
('135', '1', 'Barletta-Andria-Trani'),
('135', '2', 'Barletta-Andria-Trani'),
('136', '1', 'Belluno'),
('136', '2', 'Belluno'),
('137', '1', 'Benevento'),
('137', '2', 'Benevento'),
('138', '1', 'Bergamo'),
('138', '2', 'Bergamo'),
('139', '1', 'Biella'),
('139', '2', 'Biella'),
('140', '1', 'Bologna'),
('140', '2', 'Bologna'),
('141', '1', 'Bolzano'),
('141', '2', 'Bolzano'),
('142', '1', 'Brescia'),
('142', '2', 'Brescia'),
('143', '1', 'Brindisi'),
('143', '2', 'Brindisi'),
('144', '1', 'Cagliari'),
('144', '2', 'Cagliari'),
('145', '1', 'Caltanissetta'),
('145', '2', 'Caltanissetta'),
('146', '1', 'Campobasso'),
('146', '2', 'Campobasso'),
('147', '1', 'Carbonia-Iglesias'),
('147', '2', 'Carbonia-Iglesias'),
('148', '1', 'Caserta'),
('148', '2', 'Caserta'),
('149', '1', 'Catania'),
('149', '2', 'Catania'),
('150', '1', 'Catanzaro'),
('150', '2', 'Catanzaro'),
('151', '1', 'Chieti'),
('151', '2', 'Chieti'),
('152', '1', 'Como'),
('152', '2', 'Como'),
('153', '1', 'Cosenza'),
('153', '2', 'Cosenza'),
('154', '1', 'Cremona'),
('154', '2', 'Cremona'),
('155', '1', 'Crotone'),
('155', '2', 'Crotone'),
('156', '1', 'Cuneo'),
('156', '2', 'Cuneo'),
('157', '1', 'Enna'),
('157', '2', 'Enna'),
('158', '1', 'Fermo'),
('158', '2', 'Fermo'),
('159', '1', 'Ferrara'),
('159', '2', 'Ferrara'),
('160', '1', 'Firenze'),
('160', '2', 'Firenze'),
('161', '1', 'Foggia'),
('161', '2', 'Foggia'),
('162', '1', 'Forlì-Cesena'),
('162', '2', 'Forlì-Cesena'),
('163', '1', 'Frosinone'),
('163', '2', 'Frosinone'),
('164', '1', 'Genova'),
('164', '2', 'Genova'),
('165', '1', 'Gorizia'),
('165', '2', 'Gorizia'),
('166', '1', 'Grosseto'),
('166', '2', 'Grosseto'),
('167', '1', 'Imperia'),
('167', '2', 'Imperia'),
('168', '1', 'Isernia'),
('168', '2', 'Isernia'),
('169', '1', 'L\'Aquila'),
('169', '2', 'L\'Aquila'),
('170', '1', 'La Spezia'),
('170', '2', 'La Spezia'),
('171', '1', 'Latina'),
('171', '2', 'Latina'),
('172', '1', 'Lecce'),
('172', '2', 'Lecce'),
('173', '1', 'Lecco'),
('173', '2', 'Lecco'),
('174', '1', 'Livorno'),
('174', '2', 'Livorno'),
('175', '1', 'Lodi'),
('175', '2', 'Lodi'),
('176', '1', 'Lucca'),
('176', '2', 'Lucca'),
('177', '1', 'Macerata'),
('177', '2', 'Macerata'),
('178', '1', 'Mantova'),
('178', '2', 'Mantova'),
('179', '1', 'Massa'),
('179', '2', 'Massa'),
('180', '1', 'Matera'),
('180', '2', 'Matera'),
('181', '1', 'Medio Campidano'),
('181', '2', 'Medio Campidano'),
('182', '1', 'Messina'),
('182', '2', 'Messina'),
('183', '1', 'Milano'),
('183', '2', 'Milano'),
('184', '1', 'Modena'),
('184', '2', 'Modena'),
('185', '1', 'Monza e della Brianza'),
('185', '2', 'Monza e della Brianza'),
('186', '1', 'Napoli'),
('186', '2', 'Napoli'),
('187', '1', 'Novara'),
('187', '2', 'Novara'),
('188', '1', 'Nuoro'),
('188', '2', 'Nuoro'),
('189', '1', 'Ogliastra'),
('189', '2', 'Ogliastra'),
('190', '1', 'Olbia-Tempio'),
('190', '2', 'Olbia-Tempio'),
('191', '1', 'Oristano'),
('191', '2', 'Oristano'),
('192', '1', 'Padova'),
('192', '2', 'Padova'),
('193', '1', 'Palermo'),
('193', '2', 'Palermo'),
('194', '1', 'Parma'),
('194', '2', 'Parma'),
('195', '1', 'Pavia'),
('195', '2', 'Pavia'),
('196', '1', 'Perugia'),
('196', '2', 'Perugia'),
('197', '1', 'Pesaro-Urbino'),
('197', '2', 'Pesaro-Urbino'),
('198', '1', 'Pescara'),
('198', '2', 'Pescara'),
('199', '1', 'Piacenza'),
('199', '2', 'Piacenza'),
('200', '1', 'Pisa'),
('200', '2', 'Pisa'),
('201', '1', 'Pistoia'),
('201', '2', 'Pistoia'),
('202', '1', 'Pordenone'),
('202', '2', 'Pordenone'),
('203', '1', 'Potenza'),
('203', '2', 'Potenza'),
('204', '1', 'Prato'),
('204', '2', 'Prato'),
('205', '1', 'Ragusa'),
('205', '2', 'Ragusa'),
('206', '1', 'Ravenna'),
('206', '2', 'Ravenna'),
('207', '1', 'Reggio Calabria'),
('207', '2', 'Reggio Calabria'),
('208', '1', 'Reggio Emilia'),
('208', '2', 'Reggio Emilia'),
('209', '1', 'Rieti'),
('209', '2', 'Rieti'),
('210', '1', 'Rimini'),
('210', '2', 'Rimini'),
('211', '1', 'Roma'),
('211', '2', 'Roma'),
('212', '1', 'Rovigo'),
('212', '2', 'Rovigo'),
('213', '1', 'Salerno'),
('213', '2', 'Salerno'),
('214', '1', 'Sassari'),
('214', '2', 'Sassari'),
('215', '1', 'Savona'),
('215', '2', 'Savona'),
('216', '1', 'Siena'),
('216', '2', 'Siena'),
('217', '1', 'Siracusa'),
('217', '2', 'Siracusa'),
('218', '1', 'Sondrio'),
('218', '2', 'Sondrio'),
('219', '1', 'Taranto'),
('219', '2', 'Taranto'),
('220', '1', 'Teramo'),
('220', '2', 'Teramo'),
('221', '1', 'Terni'),
('221', '2', 'Terni'),
('222', '1', 'Torino'),
('222', '2', 'Torino'),
('223', '1', 'Trapani'),
('223', '2', 'Trapani'),
('224', '1', 'Trento'),
('224', '2', 'Trento'),
('225', '1', 'Treviso'),
('225', '2', 'Treviso'),
('226', '1', 'Trieste'),
('226', '2', 'Trieste'),
('227', '1', 'Udine'),
('227', '2', 'Udine'),
('228', '1', 'Varese'),
('228', '2', 'Varese'),
('229', '1', 'Venezia'),
('229', '2', 'Venezia'),
('230', '1', 'Verbano-Cusio-Ossola'),
('230', '2', 'Verbano-Cusio-Ossola'),
('231', '1', 'Vercelli'),
('231', '2', 'Vercelli'),
('232', '1', 'Verona'),
('232', '2', 'Verona'),
('233', '1', 'Vibo Valentia'),
('233', '2', 'Vibo Valentia'),
('234', '1', 'Vicenza'),
('234', '2', 'Vicenza'),
('235', '1', 'Viterbo'),
('235', '2', 'Viterbo'),
('236', '1', 'Aceh'),
('236', '2', 'Aceh'),
('237', '1', 'Bali'),
('237', '2', 'Bali'),
('238', '1', 'Banten'),
('238', '2', 'Banten'),
('239', '1', 'Bengkulu'),
('239', '2', 'Bengkulu'),
('240', '1', 'Gorontalo'),
('240', '2', 'Gorontalo'),
('241', '1', 'Jakarta'),
('241', '2', 'Jakarta'),
('242', '1', 'Jambi'),
('242', '2', 'Jambi'),
('243', '1', 'Jawa Barat'),
('243', '2', 'Jawa Barat'),
('244', '1', 'Jawa Tengah'),
('244', '2', 'Jawa Tengah'),
('245', '1', 'Jawa Timur'),
('245', '2', 'Jawa Timur'),
('246', '1', 'Kalimantan Barat'),
('246', '2', 'Kalimantan Barat'),
('247', '1', 'Kalimantan Selatan'),
('247', '2', 'Kalimantan Selatan'),
('248', '1', 'Kalimantan Tengah'),
('248', '2', 'Kalimantan Tengah'),
('249', '1', 'Kalimantan Timur'),
('249', '2', 'Kalimantan Timur'),
('250', '1', 'Kalimantan Utara'),
('250', '2', 'Kalimantan Utara'),
('251', '1', 'Kepulauan Bangka Belitug'),
('251', '2', 'Kepulauan Bangka Belitug'),
('252', '1', 'Kepulauan Riau'),
('252', '2', 'Kepulauan Riau'),
('253', '1', 'Lampung'),
('253', '2', 'Lampung'),
('254', '1', 'Maluku'),
('254', '2', 'Maluku'),
('255', '1', 'Maluku Utara'),
('255', '2', 'Maluku Utara'),
('256', '1', 'Nusa Tengara Barat'),
('256', '2', 'Nusa Tengara Barat'),
('257', '1', 'Nusa Tenggara Timur'),
('257', '2', 'Nusa Tenggara Timur'),
('258', '1', 'Papua'),
('258', '2', 'Papua'),
('259', '1', 'Papua Barat'),
('259', '2', 'Papua Barat'),
('260', '1', 'Riau'),
('260', '2', 'Riau'),
('261', '1', 'Sulawesi Barat'),
('261', '2', 'Sulawesi Barat'),
('262', '1', 'Sulawesi Selatan'),
('262', '2', 'Sulawesi Selatan'),
('263', '1', 'Sulawesi Tengah'),
('263', '2', 'Sulawesi Tengah'),
('264', '1', 'Sulawesi Tenggara'),
('264', '2', 'Sulawesi Tenggara'),
('265', '1', 'Sulawesi Utara'),
('265', '2', 'Sulawesi Utara'),
('266', '1', 'Sumatera Barat'),
('266', '2', 'Sumatera Barat'),
('267', '1', 'Sumatera Selatan'),
('267', '2', 'Sumatera Selatan'),
('268', '1', 'Sumatera Utara'),
('268', '2', 'Sumatera Utara'),
('269', '1', 'Yogyakarta'),
('269', '2', 'Yogyakarta'),
('270', '1', '愛知'),
('270', '2', 'Aichi'),
('271', '1', '秋田'),
('271', '2', 'Akita'),
('272', '1', '青森'),
('272', '2', 'Aomori'),
('273', '1', '千葉'),
('273', '2', 'Chiba'),
('274', '1', '愛媛'),
('274', '2', 'Ehime'),
('275', '1', '福井'),
('275', '2', 'Fukui'),
('276', '1', '福岡'),
('276', '2', 'Fukuoka'),
('277', '1', '福島'),
('277', '2', 'Fukushima'),
('278', '1', '岐阜'),
('278', '2', 'Gifu'),
('279', '1', '群馬'),
('279', '2', 'Gunma'),
('280', '1', '広島'),
('280', '2', 'Hiroshima'),
('281', '1', '北海道'),
('281', '2', 'Hokkaido'),
('282', '1', '兵庫'),
('282', '2', 'Hyogo'),
('283', '1', '茨城'),
('283', '2', 'Ibaraki'),
('284', '1', '石川'),
('284', '2', 'Ishikawa'),
('285', '1', '岩手'),
('285', '2', 'Iwate'),
('286', '1', '香川'),
('286', '2', 'Kagawa'),
('287', '1', '鹿児島'),
('287', '2', 'Kagoshima'),
('288', '1', '神奈川'),
('288', '2', 'Kanagawa'),
('289', '1', '高知'),
('289', '2', 'Kochi'),
('290', '1', '熊本'),
('290', '2', 'Kumamoto'),
('291', '1', '京都'),
('291', '2', 'Kyoto'),
('292', '1', '三重'),
('292', '2', 'Mie'),
('293', '1', '宮城'),
('293', '2', 'Miyagi'),
('294', '1', '宮崎'),
('294', '2', 'Miyazaki'),
('295', '1', '長野'),
('295', '2', 'Nagano'),
('296', '1', '長崎'),
('296', '2', 'Nagasaki'),
('297', '1', '奈良'),
('297', '2', 'Nara'),
('298', '1', '新潟'),
('298', '2', 'Niigata'),
('299', '1', '大分'),
('299', '2', 'Oita'),
('300', '1', '岡山'),
('300', '2', 'Okayama'),
('301', '1', '沖縄'),
('301', '2', 'Okinawa'),
('302', '1', '大阪'),
('302', '2', 'Osaka'),
('303', '1', '佐賀'),
('303', '2', 'Saga'),
('304', '1', '埼玉'),
('304', '2', 'Saitama'),
('305', '1', '滋賀'),
('305', '2', 'Shiga'),
('306', '1', '島根'),
('306', '2', 'Shimane'),
('307', '1', '静岡'),
('307', '2', 'Shizuoka'),
('308', '1', '栃木'),
('308', '2', 'Tochigi'),
('309', '1', '徳島'),
('309', '2', 'Tokushima'),
('310', '1', '東京'),
('310', '2', 'Tokyo'),
('311', '1', '鳥取'),
('311', '2', 'Tottori'),
('312', '1', '富山'),
('312', '2', 'Toyama'),
('313', '1', '和歌山'),
('313', '2', 'Wakayama'),
('314', '1', '山形'),
('314', '2', 'Yamagata'),
('315', '1', '山口'),
('315', '2', 'Yamaguchi'),
('316', '1', '山梨'),
('316', '2', 'Yamanashi'),
('317', '1', 'Australian Capital Territory'),
('317', '2', 'Australian Capital Territory'),
('318', '1', 'New South Wales'),
('318', '2', 'New South Wales'),
('319', '1', 'Northern Territory'),
('319', '2', 'Northern Territory'),
('320', '1', 'Queensland'),
('320', '2', 'Queensland'),
('321', '1', 'South Australia'),
('321', '2', 'South Australia'),
('322', '1', 'Tasmania'),
('322', '2', 'Tasmania'),
('323', '1', 'Victoria'),
('323', '2', 'Victoria'),
('324', '1', 'Western Australia'),
('324', '2', 'Western Australia'),
('325', '1', 'Andhra Pradesh'),
('325', '2', 'Andhra Pradesh'),
('326', '1', 'Arunachal Pradesh'),
('326', '2', 'Arunachal Pradesh'),
('327', '1', 'Assam'),
('327', '2', 'Assam'),
('328', '1', 'Bihar'),
('328', '2', 'Bihar'),
('329', '1', 'Chhattisgarh'),
('329', '2', 'Chhattisgarh'),
('330', '1', 'Goa'),
('330', '2', 'Goa'),
('331', '1', 'Gujarat'),
('331', '2', 'Gujarat'),
('332', '1', 'Haryana'),
('332', '2', 'Haryana'),
('333', '1', 'Himachal Pradesh'),
('333', '2', 'Himachal Pradesh'),
('334', '1', 'Jharkhand'),
('334', '2', 'Jharkhand'),
('335', '1', 'Karnataka'),
('335', '2', 'Karnataka'),
('336', '1', 'Kerala'),
('336', '2', 'Kerala'),
('337', '1', 'Madhya Pradesh'),
('337', '2', 'Madhya Pradesh'),
('338', '1', 'Maharashtra'),
('338', '2', 'Maharashtra'),
('339', '1', 'Manipur'),
('339', '2', 'Manipur'),
('340', '1', 'Meghalaya'),
('340', '2', 'Meghalaya'),
('341', '1', 'Mizoram'),
('341', '2', 'Mizoram'),
('342', '1', 'Nagaland'),
('342', '2', 'Nagaland'),
('343', '1', 'Odisha'),
('343', '2', 'Odisha'),
('344', '1', 'Punjab'),
('344', '2', 'Punjab'),
('345', '1', 'Rajasthan'),
('345', '2', 'Rajasthan'),
('346', '1', 'Sikkim'),
('346', '2', 'Sikkim'),
('347', '1', 'Tamil Nadu'),
('347', '2', 'Tamil Nadu'),
('348', '1', 'Telangana'),
('348', '2', 'Telangana'),
('349', '1', 'Tripura'),
('349', '2', 'Tripura'),
('350', '1', 'Uttar Pradesh'),
('350', '2', 'Uttar Pradesh'),
('351', '1', 'Uttarakhand'),
('351', '2', 'Uttarakhand'),
('352', '1', 'West Bengal'),
('352', '2', 'West Bengal');

These objects are always accessible through the context:

  • Language. Set with the customer or employee language.
  • Country. Default country.
  • Currency. Set with the customer currency or the shop’s default currency.
  • Shop. Current shop.
  • Cookie. Cookie instance.
  • Link. Link instance.
  • Smarty. Smarty instance.

These objects are only accessible for the customer Context:

  • Customer. Existing customer retrieved from the cookie or default customer.
  • Cart. Current cart.
  • Controller. Current controller instance.

These objects are only accessible for the administrator Context:

  • Employee. Current employee.

From inside a Controller subclass or a Module subclass, the Context should be called with this shortcut:

ex)

$this->context->language->id

From anywhere else, you can get the Context instance by calling
ex)

$context = Context::getContext();
$id_lang = $context->language->id;

コンタクトモジュール:ステート(都道府県)が設定されていない場合の処理追加(null)

modules/ps_contactinfo/ps_contactinfo.php

'state' => (!empty($address->id_state) ? (new State($address->id_state))->name[$this->context->language->id] : null),

ステート(都道府県)多言語対応

修正ファイル一覧

クラス
classes/Country.php
classes/State.php
classes/Customer.php
classes/Manufacturer.php
classes/PaymentModule.php
classes/Cart.php
classes/tax/TaxRule.php
classes/form/CustomerAddressFormatter.php

コントローラ
controllers/admin/AdminStatesController.php
controllers/admin/AdminImportController.php
controllers/admin/AdminStoresController.php
controllers/admin/AdminTaxRulesGroupController.php

その他
src/Adapter/Form/ChoiceProvider/CountryStateByIdChoiceProvider.php
src/Adapter/Order/QueryHandler/GetOrderForViewingHandler.php
src/Adapter/Order/QueryHandler/GetOrderPreviewHandler.php
tools/foreignkeyGenerator/relations.php

上記ファイルに加え、以下コンタクトモジュールの変更(前投稿記事)が必要です。
modules/ps_contactinfo/ps_contactinfo.php

Github:ステート多言語対応変更ファイル

Multilingual for “State” on Prestashop

v1.7.8.4