Multilingualism and site translation

Atrás

Languages

Multilingualism and search engines

If you have several versions of a page in different languages or for different regions, help Google identify them. Then the search results will display the versions of your pages that best suit the user's language and region.
One way to implement multilingual sites is using the tag with the hreflang attribute. Example of such a tag:
<link rel="alternate" hreflang="lang_code" href="url_of_page" />

Multilingual functionality is implemented on different site pages (categories, pages, articles, product cards, and others). For example, if you have a product card added in English, Belarusian, Russian, and Ukrainian, it is enough to specify the same value in all product cards in the "Product in other languages" field, for example - "1". In this case, when opening a page in one of the languages, hreflang tags with links to pages in other languages will be added. It is recommended to use the ID of the first product card to avoid duplicate values and subsequent errors. For example, if you added a product "Sneakers" with ID "12345", then when adding a similar product in English, specify "12345" in the "Product in other languages" field.

The selected main language of the site will be additionally marked with the hreflang="x-default" tag.

How to create a multilingual site?

Create a page in one language, then the same page in another language, and fill the "Page in other languages" field with the same value, for example, the ID of the first created page. Fill in articles and product cards in the same way. The site will automatically inform the search engine about the page in other languages, as well as about the main page (the main page will correspond to the main language of the site, which you can specify in the "Settings", "Start page" section).

For creating catalog categories for articles or the store, we recommend using a language prefix. For example, the "dress" category can be created in other languages using the prefixes "dress_ua", "dress_de", "dress_fr"...
Using the same category path in other languages is possible, but during data import, for example, of a product, errors may occur because the platform will not be able to recognize the language of the category into which it is being added. Therefore, we recommend using prefixes in sections with categories, the article catalog, and the online store. When using language prefixes as described above, the "Category in other languages" variable will be set automatically.

When creating product cards, the "Product Code" must be unique, so in another language you can use, for example, custom endings "SKU/CODE_EN". If "Product in another language" is specified, then when changing basic data (price, availability, new, bestseller, discount, status), all product cards specified as an alternative version of the main product will also be updated.
"Search filter" and "Blocks/menus" can be used simultaneously for all languages, and separately specify the language in which to display them. For example, create a "Blocks/menus", Site header, and place it on all pages, specifying the language "Russian (ru)". Such a block will be displayed everywhere only if the Russian version of the site is open. In the same way, you can create a header for other languages. If you need to place some code, you don't have to create such a "Blocks/menus" for each language, just specify the language "All", and the block will be displayed regardless of the language chosen by the visitor.
The language prefix on the BooStore.pro platform is specified at the beginning, for example, "/en/page.htm".

Quick translation of the product catalog on the site

For quick store translation, you can use import/export via CSV/XLS, as well as the Google Translate service for documents.

Store categories


Export "Store categories". Replace the value of the "PREVIOUS" language in the language cell with the value of the "NEW" language, and also translate the names and descriptions (for example, using the Google Translate service for documents, after saving the file in XLSX format). In this case, the "Language" of all child categories will be the same as the language of the main category into which they are added. Therefore, for the main category (whose parent is "main"), it is important to replace the value of the "Language" cell with "NEW LANGUAGE". To eliminate possible errors during subsequent product import, we recommend using unique names, or adding "_NEWLANGUAGE" to the name of new categories. For example, "category_en", where "en" is the new language being added.

Before performing the import, you need to save the file in "XLS" or "CSV" format. After completing the import, check that the language of the new categories is correct. If for some reason the wrong language is specified, then replace the language of the main category of your catalog, into which they are added, in the "Store" - "Store categories" section. The language for all child subcategories will also be changed. If there are not many categories, you can copy the categories, replacing their language and name in the "Store" - "Store categories" section.


Adding products

Perform product export in the "Store" - "Product export" section. Check the "Upload all" box. Uncheck "Do not export products that are out of stock", and also check the "Export categories without transliteration" box - to simplify the selection of categories for translated products. Translate the file using the Google Translate service for documents, after saving the file in XLSX format. Using formulas, add "_language" to categories, or replace their names with newly created categories. Move the values of the "ID" column to the "Products in other languages" column. Be sure to delete the values for the "ID" column to avoid overwriting existing products. Also replace the "Product Code", for example, similarly adding "_language" using formulas, since products with the same "ID" or "Product Code" will be overwritten.
Perform the import in the "Store" - "Product import" section. You can quickly fill the cell correspondence by clicking "Fields from file, specify correspondence" - "Fill field correspondence selection according to the export file (fields "Upload all")".

In addition, to create correct markup for search engines, as well as redirect between products in different languages, in the products of the main language, perform an export and re-import, copying the value of the "ID" cell to the "Products in other languages" column. (In this case, you can import only one cell "Product in other languages" and specify the ID or "Product Code" by which products will be found for overwriting). Thus, both new and previously created products will have identical values in "Product in other languages".

Multilingualism and language selection menu

You can place the short code {HOTENGINE-SC:langmenu} and specify the list of available languages in the site settings, or place the code from the example below.
The code from the example below creates a button to switch to alternative languages, and if an alternative language version is specified for the page/article/product card, it will be used.


1) Insert the CSS code into the Design Editor, in the CSS tab.
2) Add JavaScript to a block/menu displayed on all pages.
3) Insert the language dropdown code into the block/menu where you want to place it, for example, in the site header.
4) Remove unnecessary languages from the block (class hotengine-shop-select-language-val)



Language selection menu code:
Code: html
<nav class="hotengine-shop-select-language-box">
  <span class="hotengine-shop-select-language" data-lang="es"></span>
  <span class="hotengine-shop-select-language-values">
  <li><a class="hotengine-shop-select-language-val" data-lang="be"></a></li>
  <li><a class="hotengine-shop-select-language-val" data-lang="de"></a></li>
  <li><a class="hotengine-shop-select-language-val" data-lang="en"></a></li>
  <li><a class="hotengine-shop-select-language-val" data-lang="es"></a></li>
  <li><a class="hotengine-shop-select-language-val" data-lang="fr"></a></li>
  <li><a class="hotengine-shop-select-language-val" data-lang="kk"></a></li>
  <li><a class="hotengine-shop-select-language-val" data-lang="pl"></a></li>
  <li><a class="hotengine-shop-select-language-val" data-lang="ru"></a></li>
  <li><a class="hotengine-shop-select-language-val" data-lang="uk"></a></li>
  </span>
  </nav>

CSS styles:
Code: CSS
/*LANGUAGE BLOCK*/
.hotengine-shop-select-language-box { display:inline-block; width:71px; height:auto; overflow:hidden; border:1px solid transparent;  line-height:30px; position:relative; z-index:1000; }
.hotengine-shop-select-language { display:block; width:100%; text-align:center; cursor:pointer; }
.hotengine-shop-select-language-values { display:block; width:100%; vertical-align: top; position:absolute; background:rgba(255, 255, 255, 0.80); }
.hotengine-shop-select-language-box:hover{ overflow:visible;}
.hotengine-shop-select-language-values:hover li{ position:relative; }
.hotengine-shop-select-language-val { width:auto; display:block; margin:0px; vertical-align:top; cursor:pointer; text-align:center; color:inherit; text-decoration:none; }
.hotengine-shop-select-language-val:hover {background:inherit;color:inherit;}


.hotengine-shop-select-language-box .hotengine-shop-select-language[lang="ru"]:after,
.hotengine-shop-select-language-box .hotengine-shop-select-language-val[lang="ru"]:after { content: "RU"; }

.hotengine-shop-select-language-box .hotengine-shop-select-language[lang="en"]:after,
.hotengine-shop-select-language-box .hotengine-shop-select-language-val[lang="en"]:after { content: "EN"; }

.hotengine-shop-select-language-box .hotengine-shop-select-language[lang="uk"]:after,
.hotengine-shop-select-language-box .hotengine-shop-select-language-val[lang="uk"]:after { content: "UA"; }

.hotengine-shop-select-language-box .hotengine-shop-select-language[lang="de"]:after,
.hotengine-shop-select-language-box .hotengine-shop-select-language-val[lang="de"]:after { content: "DE"; }

.hotengine-shop-select-language-box .hotengine-shop-select-language[lang="es"]:after,

.hotengine-shop-select-language-box .hotengine-shop-select-language-val[lang="es"]:after { content: "ES"; }

.hotengine-shop-select-language-box .hotengine-shop-select-language[lang="fr"]:after,
.hotengine-shop-select-language-box .hotengine-shop-select-language-val[lang="fr"]:after { content: "FR"; }

.hotengine-shop-select-language-box .hotengine-shop-select-language[lang="kk"]:after,
.hotengine-shop-select-language-box .hotengine-shop-select-language-val[lang="kk"]:after { content: "KK"; }

.hotengine-shop-select-language-box .hotengine-shop-select-language[lang="be"]:after,
.hotengine-shop-select-language-box .hotengine-shop-select-language-val[lang="be"]:after { content: "BE"; }

.hotengine-shop-select-language-box .hotengine-shop-select-language[lang="ro"]:after,
.hotengine-shop-select-language-box .hotengine-shop-select-language-val[lang="ro"]:after { content: "RO"; }

.hotengine-shop-select-language-box .hotengine-shop-select-language[lang="tr"]:after,
.hotengine-shop-select-language-box .hotengine-shop-select-language-val[lang="tr"]:after { content: "TR"; }

.hotengine-shop-select-language-box .hotengine-shop-select-language[lang="it"]:after,
.hotengine-shop-select-language-box .hotengine-shop-select-language-val[lang="it"]:after { content: "IT"; }

.hotengine-shop-select-language-box .hotengine-shop-select-language[lang="sk"]:after,
.hotengine-shop-select-language-box .hotengine-shop-select-language-val[lang="sk"]:after { content: "SK"; }

.hotengine-shop-select-language-box .hotengine-shop-select-language[lang="da"]:after,
.hotengine-shop-select-language-box .hotengine-shop-select-language-val[lang="da"]:after { content: "DA"; }

.hotengine-shop-select-language-box .hotengine-shop-select-language[lang="pl"]:after,
.hotengine-shop-select-language-box .hotengine-shop-select-language-val[lang="pl"]:after { content: "PL"; }

.hotengine-shop-select-language-box .hotengine-shop-select-language[lang="zh"]:after,
.hotengine-shop-select-language-box .hotengine-shop-select-language-val[lang="zh"]:after { content: "ZH"; }

.hotengine-shop-select-language-box .hotengine-shop-select-language[lang="hi"]:after,
.hotengine-shop-select-language-box .hotengine-shop-select-language-val[lang="hi"]:after { content: "HI"; }

.hotengine-shop-select-language-box .hotengine-shop-select-language[lang="ar"]:after,
.hotengine-shop-select-language-box .hotengine-shop-select-language-val[lang="ar"]:after { content: "AR"; }

.hotengine-shop-select-language-box .hotengine-shop-select-language[lang="pt"]:after,
.hotengine-shop-select-language-box .hotengine-shop-select-language-val[lang="pt"]:after { content: "PT"; }

.hotengine-shop-select-language-box .hotengine-shop-select-language[lang="bn"]:after,
.hotengine-shop-select-language-box .hotengine-shop-select-language-val[lang="bn"]:after { content: "BN"; }

/*LANGUAGE BLOCK*/

File that substitutes paths in links (from link[rel="alternate"]):
Code: JavaScript
<script src="/templates/scripts/hotengine-script-language.js"></script>

File contents

Changing text elements on the site

Multilingualism and replacing standard labels

Most labels and elements on the site are displayed using CSS pseudo-elements. For example, the element with class .hotengine-form-feedback-yourname-title has a pseudo-element with text.
The text is separated using the parent lang attribute on the html element.

Example:
Code: CSS

:lang(ru) .hotengine-form-feedback-yourname-title:after{ content:"Your name:"; }
:lang(en) .hotengine-form-feedback-yourname-title:after{ content:"Your name:"; }
:lang(uk) .hotengine-form-feedback-yourname-title:after{ content:"Your name:"; }
:lang(de) .hotengine-form-feedback-yourname-title:after{ content:"Ihr name:"; }
:lang(es) .hotengine-form-feedback-yourname-title:after{ content:"Su nombre:"; }
:lang(fr) .hotengine-form-feedback-yourname-title:after{ content:"Votre nom:"; }
:lang(kk) .hotengine-form-feedback-yourname-title:after{ content:"Your name:"; }
:lang(be) .hotengine-form-feedback-yourname-title:after{ content:"Your name:"; }
:lang(ro) .hotengine-form-feedback-yourname-title:after{ content:"Numele dvs.:"; }
:lang(tr) .hotengine-form-feedback-yourname-title:after{ content:"Adınız:"; }
:lang(it) .hotengine-form-feedback-yourname-title:after{ content:"Il tuo nome:"; }
:lang(sk) .hotengine-form-feedback-yourname-title:after{ content:"Vaše meno:"; }
:lang(da) .hotengine-form-feedback-yourname-title:after{ content:"Dit navn:"; }
:lang(pl) .hotengine-form-feedback-yourname-title:after{ content:"Twoje imię:"; }
:lang(zh) .hotengine-form-feedback-yourname-title:after{ content:"Your name:"; }
:lang(hi) .hotengine-form-feedback-yourname-title:after{ content:"Your name:"; }
:lang(ar) .hotengine-form-feedback-yourname-title:after{ content:"Your name:"; }
:lang(pt) .hotengine-form-feedback-yourname-title:after{ content:"Seu nome:"; }
:lang(bn) .hotengine-form-feedback-yourname-title:after{ content:"Your name:"; }



Files with translation of standard values


How can you translate the entire site?

When creating a multilingual site, specify the language in the created content (page, menu, category...).

Use paths with the language specified at the beginning:

/ua/ /ru/ /en/ /pl/ /kk/ /be/ ...

Main language: specified during registration (changed in "Settings" → "Languages and start page").

Products: language is determined automatically by the category into which the product is added.

Most elements on the site can be replaced using CSS styles and pseudo-elements.

Product quantity labels

:lang(ru).hotengine-shop-product-price_for-lang-1::after { content: "per 1 piece"; }

Replace lang-1 (where 1 is the selected unit of measurement) and (ru) — language code.

List of unit of measurement values:

  • 1 1 pc
  • 2 100 pcs
  • 3 1000 pcs
  • 4 per 1 package
  • 5 1 kg
  • 6 1000 kg
  • 7 1 m²
  • 8 per 1 meter
  • 9 per 1 km
  • 10 per set
  • 11 per 1 hour
  • 12 per 1 day
  • 13 per 1 month
  • 14 per 1 year
  • 15 per 100 sq m
  • 16 per Acre
  • 17 per Hectare
  • 18 per plot
  • 19 per object
  • 30 per 1 ml
  • 31 per 1 l
  • 32 per 1 km³
  • 33 per 1 m³
  • 34 per 1 dm³
  • 35 per 1 cm³
  • 36 per 1 mm³
  • 37 per 1 hl
  • 38 per 100 grams
  • 39 1 pound
  • 40 per 1 gram
  • 41 per 10 kg
  • 42 per 1 centner
  • 43 per 1 ton
  • 44 per 1 are
  • 45 per 1 pair
  • 46 per 1 dozen
  • 47 per 1 gallon
  • 48 per 1 barrel
  • 49 per 1 minute
  • 50 per 1 week
  • 51 per 1 service
  • 52 per 1 trip
  • 53 per 1 person
  • 54 per 1 car
  • 55 per 1 linear meter

Translating buttons using JavaScript

Some elements are implemented without pseudo-classes and CSS elements. For example, an element like the "Send" button in the cart. To translate such an element, you can use Javascript.
Code: JavaScript
<script>
(function() {
    const init = () => {
        const submitBtn = document.querySelector(`#hotengine-shop-cart-form .hotengine-form-submit input[type="submit"]`);
        if (submitBtn) {
            submitBtn.value = `Submit order`;
        }
    };

    if (document.readyState === `loading`) {
        document.addEventListener(`DOMContentLoaded`, init);
    } else {
        init();
    }
})();
</script>

More details ...
For example, in this case we are changing the text of the form submit button. The code must be placed on the page where the button is located. To do this, you need to create a functional page - the Cart. And insert the code given in the example into the page text.

Search filter translation

You can use one search filter for multiple languages. This will simplify the process of importing/exporting products and filling the site.
Translation is carried out using the tool Translation of characteristic values.

Additionally, you can perform translation using JavaScript. However, with such a translation, the XML export of characteristics to Marketplaces will be in one language.
For example, let's look at translation from English to Russian.
Show

Create a "Block/Menu" and place it on pages where the search filter is enabled.
For example, in the item "Enter characters upon detection of which to display Block/Menu:" specify:
/en/shop/
/en/pers_shop/

Example of translating lines, as well as the "Apply" button.
Code: JavaScript
<script>
(function() {
  const $dict = {
    "Color": "Color",
    "Blue": "Blue",
    "Green": "Green",
    "Black": "Black"
  };

  /*
  Example translations:
  RU: "Color": "Color", "Blue": "Blue", "Green": "Green", "Black": "Black"
  UA: "Color": "Color", "Blue": "Blue", "Green": "Green", "Black": "Black"
  PL: "Color": "Kolor", "Blue": "Niebieski", "Green": "Zielony", "Black": "Czarny"
  */

  const applyTranslations = () => {
    Object.entries($dict).forEach(([txtorig, txtnew]) => {
      const selectors = [
        `#shop_catalog_product_types_id_ajax .product_types_valuebox_checkbox span`,
        `#shop_catalog_product_types_id_ajax .shop_catalog_product_types_block_title`,
        `.shop_catalog_product_properties_block .shop_catalog_product_types_block_title`,
        `.shop_catalog_product_properties_block .product_types_valuebox_checkbox`
      ];

      selectors.forEach(selector => {
        document.querySelectorAll(selector).forEach(el => {
          if (el.textContent.includes(txtorig)) {
            el.innerHTML = txtnew;
          }
        });
      });
    });
  };

  applyTranslations();

  const target = document.getElementById(`shop_catalog_product_types_id_ajax`);
  if (target) {
    const observer = new MutationObserver(() => {
      observer.disconnect();
      applyTranslations();
      observer.observe(target, { childList: true, subtree: true });
    });
    observer.observe(target, { childList: true, subtree: true });
  }

  setTimeout(() => {
    const smartSearchInput = document.querySelector(`.hotengine-smart_search_submit_button input`);
    if (smartSearchInput) smartSearchInput.value = "Apply";

    const searchInpButton = document.querySelector(`#searchinp_smart_search .button`);
    if (searchInpButton) searchInpButton.value = "Apply";
  }, 100);
})();
  </script>


Example of translation with word overwriting:
Code: JavaScript
<script>
 (function() {
  const $dict = {
    "Colour": "Farbe",
    "Blue": "Blau",
    "Green": "Grün",
    "Black": "Schwarz"
  };

  /*
  Example translations:
  RU: "Colour": "Color", "Blue": "Blue", "Green": "Green", "Black": "Black"
  UA: "Colour": "Color", "Blue": "Blue", "Green": "Green", "Black": "Black"
  PL: "Colour": "Kolor", "Blue": "Niebieski", "Green": "Zielony", "Black": "Czarny"
  */

  const applyTranslations = (container) => {
    Object.entries($dict).forEach(([txtorig, txtnew]) => {
      const regex = new RegExp(txtorig, "g");
      if (container.innerHTML.includes(txtorig)) {
        container.innerHTML = container.innerHTML.replace(regex, txtnew);
      }
    });
  };

  const target = document.getElementById(`shop_catalog_product_types_id_ajax`);
  if (target) {
    applyTranslations(target);

    const observer = new MutationObserver(() => {
      observer.disconnect();
      applyTranslations(target);
      observer.observe(target, { childList: true, subtree: true });
    });
    observer.observe(target, { childList: true, subtree: true });
  }

  setTimeout(() => {
    const smartSearchInput = document.querySelector(`.hotengine-smart_search_submit_button input`);
    if (smartSearchInput) smartSearchInput.value = "Apply";

    const searchInpButton = document.querySelector(`#searchinp_smart_search .button`);
    if (searchInpButton) searchInpButton.value = "Apply";
  }, 100);
})();
  </script>

Similarly, you can add other languages and new words by placing the code on the corresponding language versions of the site.

Promotions (countdown timer in the store)

Translation using the timer as an example. Products have the ability to automatically create a countdown timer. When adding a product, check the "Promotional product" box, and in the appearing block click "Enable timer". Set the timer expiration date. After the specified period expires, you can set an action, for example, remove the promotion, or change the price...

How to change the labels in the timer?

Using CSS styles, you can replace the words in the timer. To do this, for example, in the product, insert the CSS html code:
Code: CSS
<style type="text/css">
<!--

/*label time left*/

:lang(ru) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-description-akciya-countdown-l-day:after{
   content:"days";
}
:lang(ru) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-description-akciya-countdown-l-hourse:after{
   content:"hours";
}
:lang(ru) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-description-akciya-countdown-l-minute:after{
   content:"minutes";
}
:lang(ru) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-description-akciya-countdown-l-seconds:after{
   content:"seconds";
}
:lang(ru) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-description-akciya-countdown-l-left:after{
   content:"left before the end of the promotion!";
}
:lang(ru) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-description-akciya-countdown-l-done:after{
   content:"Promotion ended!";
}


:lang(en) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-description-akciya-countdown-l-day:after{
   content:"days";
}
:lang(en) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-description-akciya-countdown-l-hourse:after{
   content:"hours";
}
:lang(en) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-description-akciya-countdown-l-minute:after{
   content:"minute";
}
:lang(en) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-description-akciya-countdown-l-seconds:after{
   content:"seconds";
}
:lang(en) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-description-akciya-countdown-l-left:after{
   content:"left before the end of the campaign!";
}
:lang(en) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-description-akciya-countdown-l-done:after{
   content:"Campaign complete!";
}


:lang(pl) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-description-akciya-countdown-l-day:after{
    content:"dni";
}
:lang(pl) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-description-akciya-countdown-l-hourse:after{
    content:"godziny";
}
:lang(pl) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-description-akciya-countdown-l-minute:after{
    content:"minuty";
}
:lang(pl) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-description-akciya-countdown-l-seconds:after{
    content:"sekundy";
}
:lang(pl) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-description-akciya-countdown-l-left:after{
    content:"pozostało do końca promocji!";
}
:lang(pl) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-description-akciya-countdown-l-done:after{
    content:"Ackia ukończona!";
}






:lang(ru) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-akciya-countdown-numbers-days:after{
   content:"days";
}
:lang(ru) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-akciya-countdown-numbers-hours:after{
   content:"hours";
}
:lang(ru) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-akciya-countdown-numbers-minutes:after{
   content:"minutes";
}
:lang(ru) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-akciya-countdown-numbers-seconds:after{
   content:"seconds";
}




:lang(en) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-akciya-countdown-numbers-days:after{
   content:"days";
}
:lang(en) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-akciya-countdown-numbers-hours:after{
   content:"hours";
}
:lang(en) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-akciya-countdown-numbers-minutes:after{
   content:"minute";
}
:lang(en) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-akciya-countdown-numbers-seconds:after{
   content:"seconds";
}



:lang(uk) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-akciya-countdown-numbers-days:after{
   content:"days";
}
:lang(uk) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-akciya-countdown-numbers-hours:after{
   content:"hours";
}
:lang(uk) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-akciya-countdown-numbers-minutes:after{
   content:"minutes";
}
:lang(uk) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-akciya-countdown-numbers-seconds:after{
   content:"seconds";
}


:lang(pl) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-akciya-countdown-numbers-days:after{
   content:"dni";
}
:lang(pl) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-akciya-countdown-numbers-hours:after{
   content:"godziny";
}
:lang(pl) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-akciya-countdown-numbers-minutes:after{
   content:"minuty";
}
:lang(pl) #hotengine-shop-product-description-akciya-countdown-block .hotengine-shop-product-akciya-countdown-numbers-seconds:after{
   content:"sekundy";
}


-->
</style>


lang(en) or lang(ru) is the language for which the corresponding label will be, and then the block itself is specified for which to change the label.


How to use the Timer on other pages?
Insert the following code to use our countdown timer:
Code: JavaScript
<div id="hotengine-shop-product-description-akciya-countdown-block"><div id="hotengine-shop-product-description-akciya-countdown"></div><div class="hotengine-shop-product-akciya-countdown-numbers"><span class="hotengine-shop-product-akciya-countdown-numbers-days"><i></i></span><span class="hotengine-shop-product-akciya-countdown-numbers-hours"><i></i></span><span class="hotengine-shop-product-akciya-countdown-numbers-minutes"><i></i></span><span class="hotengine-shop-product-akciya-countdown-numbers-seconds"><i></i></span></div><span class="hotengine-shop-product-description-akciya-countdown-l-left"></span></div>  

<link rel="stylesheet" type="text/css" href="/templates/javascript_timer_countdown/hotengine_timer_countdown.css" />
<script src="/templates/javascript_timer_countdown/hotengine_timer_countdown.js"></script>
<script>
document.addEventListener("DOMContentLoaded", () => {
    let timerperiod = 5 * 12 * 60 * 60 * 1000; // timer period, in the example 5 days 12 hours ( 5*12 ...) (for example, here the date is constantly shifting, i.e. current date + XX days.)

    // cookies last visit (subtract last visit time)
    let cookieName = `cookie_lastvisit_countdown_timer`;
    let cookieValue = document.cookie.split(`;`).find(c => c.trim().startsWith(`${cookieName}=`))?.split(`=`)[1];
    
    let cookie_lastvisit_minus = 0;
    if (cookieValue && cookieValue !== "null") {
        cookie_lastvisit_minus = new Date().getTime() - parseInt(cookieValue);
    } else {
        cookie_lastvisit_minus = 0;
    }

    let checkdate = timerperiod - cookie_lastvisit_minus; // to check the date of the last visit and the end of the promotion
    let counterdisable = false;

    if (checkdate > 0) {
        counterdisable = false;
    } else {
        cookie_lastvisit_minus = 0;
        counterdisable = true;
    }

    let cookie_lastvisit_countdown_timerv = new Date().getTime() - cookie_lastvisit_minus;
    document.cookie = `${cookieName}=${cookie_lastvisit_countdown_timerv}; path=/;`;
    // cookies last visit (subtract last visit time)

    let ts = new Date().getTime() + timerperiod - cookie_lastvisit_minus; // set the promotion end date
    hotengine_inittimer("hotengine-shop-product-description-akciya-countdown-block", new Date(ts));
});
</script>

To change the counter labels, open the style file /templates/javascript_timer_countdown/hotengine_timer_countdown.css, copy its code, and paste it on the page to modify the labels.
Atrás