تجاوز إلى المحتوى الرئيسي
الإصدار: 2.x

WPML

WP admin: installed in WP Admin → POS → Settings → Extensions, and set per store in WP Admin → POS → Stores.

WPML saves every translation of a product as a product of its own. Without help, the POS shows them all: search for a watch and you get the English, French and German copies side by side. The free WCPOS WPML extension makes the POS show one language only, so each product appears once.

Cashiers have nothing to set up: the first section shows what changes for them. The rest of the page is for the store's administrator.

What the cashier sees​

Product search, the product grid and a variable product's options all show one language, the store's, with one product per item on the shelf. Nothing changes in how a cashier sells: add to cart, take the payment, print the receipt as usual. See Checkout.

Install the extension​

Before you start

You need WPML set up on the site with a default language, and an administrator login to WP Admin.

An administrator installs it once, in WP Admin. Products use WPML's default language unless you choose a different language for the store. After activating the extension, follow Check it works below.

With WCPOS Pro​

  1. Go to POS → Settings → Extensions.
  2. Find WCPOS WPML and press Install. It installs and switches on in one step, and the card shows Active. If it shows Inactive instead, press Activate.

See Installing an extension for updates and auto-updates.

With the free plugin​

The Extensions screen lists the extension, but its buttons need Pro. Instead:

  1. Download wcpos-wpml.zip from the extension's latest release.
  2. Go to Plugins → Add Plugin and press Upload Plugin.
  3. Choose the file you downloaded and press Install Now.
  4. Press Activate Plugin.

Check it works​

  1. Open the POS. At the bottom of the products panel, next to Showing … of …, press and hold the sync button () and choose Clear and Refresh.
  2. Search for a product that has translations. It shows once, in WPML's default language, or in the store's language if you chose one below.

If it still shows two or three times, see If something goes wrong.

Choose a store's language​

With WCPOS Pro, each store can show its own language: a French shop and an English shop on the same site each see their own translations.

The Language page needs three things

WCPOS Pro, the WCPOS WPML extension active, and WPML switched on with at least one language. Without them, the store's menu has no Language page. If WooCommerce Multilingual is installed, it must be version 4.11.0 or later.

  1. In WP Admin, go to POS → Stores and click the store's name.
  2. In the store's menu, under Extensions, open Language.
  3. Under Store language, pick a language. The list shows every language WPML has switched on. Default language follows WPML's default. The choice saves by itself.
  4. Open the POS for this store and check it works. The product shows once, in the language you picked.

Other stores keep their own language.

Product language and screen language​

A store has two settings called Language, in two places in the store's menu:

  • Extensions → Language → Store language chooses which translation of each product the POS shows.
  • Currency & language → Language chooses the words on the POS screen and on receipts. See Fill in the store's pages.
نصيحة

For a French shop, set both to French.

If something goes wrong​

Each product still shows two or three times. Check that WCPOS WPML is active in Plugins, and that WPML has a default language. If WooCommerce Multilingual is installed, it must be version 4.11.0 or later: with an older version the extension switches itself off.

There is no Language page under Extensions in the store's menu. The page needs WCPOS Pro, the extension active, and WPML switched on with at least one language. If WooCommerce Multilingual is installed, it must be version 4.11.0 or later.

A POS Only or Online Only product shows up where it shouldn't in another language. POS Only and Online Only are saved against each product, and each translation is its own product, so a translation does not take the setting from the original. Open each translation and set the same visibility on it. See POS Only Products.

With WCPOS Pro

Every store chooses its own product language. Without Pro there is one store, and it uses WPML's default language.

For developers: filters and stored data

The extension works only on the product and variation requests the POS makes: it adds WPML's lang to their product query. Other WooCommerce REST clients are not affected. The language comes from the store the request names, when the signed-in user may use that store, and otherwise from WPML's default.

  • A store's choice is saved in the store's _wcpos_wpml_language meta. An empty value means WPML's default language.
  • wcpos_wpml_resolved_language changes the language used for one request.
  • wcpos_wpml_default_language changes the default language.
  • wcpos_wpml_is_supported switches the extension on or off.
  • wcpos_wpml_minimum_wpml_version and wcpos_wpml_minimum_wcml_version set the lowest WPML and WooCommerce Multilingual versions it runs with. The WooCommerce Multilingual minimum is 4.11.0; WPML has none by default.

Source: github.com/wcpos/wcpos-wpml.