Loading...

Magento Integration

Add Wewell's intelligent beauty widgets to your Magento 2 store

Overview

Magento 2 offers several ways to integrate Wewell widgets. Choose the method that best fits your technical expertise and customization needs.

Magento Version Support

This guide is designed for Magento 2.x. For Magento 1.x support, please contact our team.

Template Files

Modify theme template files directly

  • More control
  • Custom placement
  • Requires technical knowledge

Custom Module

Create a dedicated Magento module

  • Professional approach
  • Upgrade-safe
  • Advanced users only

Method 1: Admin Panel (Recommended)

1

Access Magento Admin

Log in to your Magento admin panel

2

Navigate to Content Settings

Go to Content → Configuration

3

Select Your Store View

Click "Edit" next to your store view in the list

If you have multiple store views, you'll need to configure each one separately.
4

Find HTML Head Section

Scroll down to "HTML Head" and expand the section

HTML Head
5

Add Wewell Script

In the "Scripts and Style Sheets" field, add the Wewell script:

Magento Admin Script
<script type="module" src="https://widget.wewell.io/wewell.es.js?v=1"></script>
6

Save Configuration

Click "Save Configuration" and clear the cache

Wewell widgets are now active on your Magento store!

Clear Cache

Go to System → Cache Management and flush all cache types for changes to take effect.

Method 2: Template Files

Important Notice

Always backup your files and use a custom theme to prevent losing changes during updates.

1

Locate Theme Files

Navigate to your active theme directory:

app/design/frontend/[Vendor]/[Theme]/
2

Edit Layout File

Modify one of these files:

  • Magento_Theme/layout/default.xml
  • Magento_Theme/layout/default_head_blocks.xml
  • Magento_Catalog/layout/catalog_product_view.xml
3

Add Script Block

Add this code within the <head> section:

Layout XML
<referenceContainer name="head.additional">
    <block class="Magento\Framework\View\Element\Text" name="wewell.scripts">
        <arguments>
            <argument name="text" xsi:type="string"><![CDATA[
                                 <script type="module" src="https://widget.wewell.io/wewell.es.js?v=1"></script>
            ]]></argument>
        </arguments>
    </block>
</referenceContainer>
4

Deploy and Clear Cache

Run these commands in your Magento root:

Terminal Commands
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
php bin/magento cache:flush

Method 3: Custom Module (Advanced)

Developer Method

This approach creates a proper Magento 2 module for maximum flexibility and upgrade safety.

1

Create Module Structure

Create the following directory structure:

app/code/Wewell/Integration/
├── etc/
├── view/frontend/layout/
└── registration.php
2

Create Registration File

Create registration.php:

registration.php
<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Wewell_Integration',
    __DIR__
);
3

Create Module Configuration

Create etc/module.xml:

etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Wewell_Integration" setup_version="1.0.0"/>
</config>
4

Create Layout File

Create view/frontend/layout/default.xml:

view/frontend/layout/default.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <script type="module" src="https://widget.wewell.io/wewell.es.js?v=1"></script>
    </head>
    <body>
        <referenceContainer name="before.body.end">
            
        </referenceContainer>
    </body>
</page>
5

Enable Module

Run these commands to enable the module:

Enable Module Commands
php bin/magento module:enable Wewell_Integration
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
php bin/magento cache:flush

Verification & Testing

How to Verify Integration

Troubleshooting

Cache Issues

Clear all Magento caches
Flush CDN/Varnish cache
Disable cache temporarily for testing

Static Content Issues

Re-deploy static content
Check file permissions
Verify theme inheritance

CSP (Content Security Policy)

Add Wewell CDN to CSP whitelist
Check CSP configuration
Temporarily disable CSP for testing

Need Help?

Our Magento specialists are ready to assist with your integration: