Skip to main content

Documentation Portal

Installation

You can install the Global-e Magento2 Extension packages in one of two ways:

  • Extract the Zip file provided to you by Global-e that includes the two packages.

  • Run the composer-based installation directly from the Global-e repositories.

Composer-based Installation

The Magento platform natively supports the following installation method.

To install the Global-e Magento2 lite extension:

  1. In your Magento2 installation, locate the composer.json file and open it.

    The composer.json file includes information about both the Global-e package and its corresponding repository.

  2. To avoid installing the old version, either remove or update the 'magento2_lite' version to '1.*'.

    Make sure to confirm with the Global-E Integration team that you are using the stable version of the module.

    For example:

    "require": {
        "globale/magento2_lite": "1.*",
    }
  3. Global-e provides you with the Bitbucket user and application passwords. Replace [SOME_PASSWORD] with your actual password in the Bitbucket repository URL, as shown below.

    For example:

    "repositories":[
     {
        "type": "vcs",
        "url": "https://m2readonly:[email protected]/globaleteam/magento2_lite.git"
    }

    Note

    • If necessary, Global-e can provide an alternative package version during integration.

    • Global‑e repositories are not publicly accessible, but read-only access can be requested.

  4. Run the standard Magento2 deploy scripts.

  5. Make sure that the Global-e modules are enabled:

    • Globale_BrowsingLite

    • Globale_OrderLite

    For information on enabling modules, see the Magento documentation.

Installation Using a Zip Archive

You can also install the Global-e modules by extracting the Zip file from Global-e, following the instructions below.

  1. Extract the zip file to the app/code directory.

  2. Run the standard Magento2 deploy scripts.

  3. Ensure that the Global-e modules are enabled:

    • Globale_BrowsingLite

    • Globale_OrderLite

Configuration

The Global‑e Magento2 Lite extension provides a configuration screen that allows actual activation of Global‑e Integration on the website along with other settings:

Stores -> Configuration -> Services -> Global-E Integration Lite:

image2.png

All configuration details will be provided by Global‑e during the integration step.

Headless Installation

Global-e Routes

If a full page cache requires a whitelist of dynamic URLs, the following patterns should be whitelisted to support Global-e integration

Frontend area:

/international-ge/*

/international/*

Admin area:

/globale/*

Additionally, Global-e uses Magento2’s REST APIs. Make sure to enable them.

Make sure not to cache them (remove them from varnish or any other cache mechanism).

Global-e Includes and Store Variables

The following Magento configuration values ( core_config_data table) are used to add includes:

  • 'globale_browsing_lite/api_settings/enable_gem_include'

  • • 'globale_browsing_lite/api_settings/integration_enabled'

  • 'globale_browsing_lite/api_settings/gem_base_url'

  • 'globale_browsing_lite/api_settings/merchant_id'

Include of CSS:

Note: we recommend placing it at the top of the page

if ('globale_browsing_lite/api_settings/enable_gem_include' && globale_browsing_lite/api_settings/integration_enabled')

Add the following HTML:

<link rel="stylesheet" id="GEPIStyles" type="text/css" href="CSS_REF">

Where CSS_REF build as contacting configs with constant string:

'globale_browsing_lite/api_settings/gem_base_url' + 'includes/css/' +
'globale_browsing_lite/api_settings/merchant_id'

Example:

MerchantId = 760

Environment → Production

<link rel="stylesheet" id="GEPIStyles" type="text/css" href="//gepi.global-e.com/includes/css/760>

Include JavaScript

Note: We recommend placing it before body end

if ('globale_browsing_lite/api_settings/enable_gem_include' && 'globale_browsing_lite/api_settings/integration_enabled')

Add the following JavaScript:

 <script id="globaleScript">
 var geStoreCode = ‘STORE_CODE’;
 var geStoreCodeInstance = ‘STORE_INSTANCE’;
 var preferedCulture = PreferedCulture‘’;

(function () {
 var s = document.createElement('script');
 s.type = 'text/javascript';
 s.async = true;
 s.src = ' JS_SRC ';
 document.getElementsByTagName('head')[0].appendChild(s);
})();
 </script>

Where JS_SRC build as contacting configs with constant string:

'globale_browsing_lite/api_settings/gem_base_url' + 'includes/js/' + 'globale_browsing_lite/api_settings/merchant_id'

  • STORE_CODE – is a standard Magento StoreCode storeManager->getStore()>getCode();

  • STORE_INSTANCE – is BaseUrl without https://

  • PreferedCulture – is culture code that we are getting from locale that mapped to Global-e.

You can see the usage in vendor/globale/magento2_lite/src/BrowsingLite/Observer/CookieInitialiser.php

locale → \Magento\Framework\Locale\Resolver

CultureHelper → Globale\BrowsingLite\Helper\Culture

$locale = $this->locale->getLocale(); $preferredCulture = $this->cultureHelper- >getGlobalECultureCodeByMagentoLocale($locale);

You can see how it builds on regular installation:

vendor/globale/magento2_lite/src/BrowsingLite/view/frontend/templates/client_js.phtml vendor/globale/magento2_lite/src/BrowsingLite/view/frontend/templates/client_css.phtml vendor/globale/magento2_lite/src/BrowsingLite/Block/Client.php vendor/globale/magento2_lite/src/BrowsingLite/Observer/CookieInitialiser.php

For example (same merchant) :

<script id="globaleScript">
 var geStoreCode = 'en';
 var geStoreCodeInstance = 'www.boucheron.com';
 (function () {
 var s = document.createElement('script');
 s.type = 'text/javascript';
 s.async = true;
 s.src = '//gepi.global-e.com/includes/js/760';
 document.getElementsByTagName('head')[0].appendChild(s);
 })();
</script>