Loading...

WooCommerce Integration

Add Wewell's intelligent beauty widgets to your WordPress WooCommerce store

Overview

WooCommerce integration offers multiple approaches depending on your comfort level with WordPress. Choose the method that best suits your needs and technical expertise.

Functions.php

Add code to your theme's functions file

  • More control
  • Programmatic approach
  • Requires basic PHP knowledge

Template Files

Direct template modification for developers

  • Maximum flexibility
  • Custom placement
  • Advanced users only

Method 1: Theme Customizer (Recommended)

1

Access WordPress Customizer

From your WordPress admin, go to Appearance → Customize

2

Find Additional CSS or Code Injection

Look for one of these sections in the customizer:

  • "Additional CSS"
  • "Custom Code"
  • "Footer Scripts"
  • "Code Injection"
Some themes have a dedicated section for custom scripts. Check your theme documentation.
3

Add Wewell Script

If using Additional CSS, wrap the script in <style> tags. For script sections, use the code directly:

WooCommerce Script
<style>
/* Hide this style block, only used for script injection */
body:after {
  content: '';
  display: none;
}
</style>

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

Publish Changes

Click "Publish" to save your changes

Your Wewell widgets are now live on your WooCommerce store!

Method 2: Functions.php

Important Notice

Always backup your website before editing functions.php. Use a child theme to prevent losing changes during theme updates.

1

Access Theme Editor

Go to Appearance → Theme Editor in your WordPress admin

2

Open functions.php

Select functions.php from the file list on the right

functions.php
3

Add Wewell Function

Add this code to the end of your functions.php file:

functions.php
// Add Wewell Beauty Widget
function wewell_add_scripts() {
    if (is_woocommerce() || is_product() || is_shop()) {
        ?>
        <script type="module" src="https://widget.wewell.io/wewell.es.js?v=1"></script>
        <?php
    }
}
add_action('wp_footer', 'wewell_add_scripts');
4

Update File

Click "Update File" to save your changes

Wewell widgets will now appear on WooCommerce pages automatically!

Method 3: Template Files (Advanced)

Advanced Users Only

This method requires knowledge of WordPress template hierarchy and PHP. Always use a child theme.

1

Locate Template Files

Common WooCommerce template files to modify:

  • single-product.php (Individual product pages)
  • archive-product.php (Shop page)
  • footer.php (Site-wide footer)
2

Edit Template File

Add the script before the closing </body> tag or in the appropriate location:

Template File
<?php if (is_woocommerce() || is_product() || is_shop()): ?>
<script type="module" src="https://widget.wewell.io/wewell.es.js?v=1"></script>
<?php endif; ?>

Verification & Testing

How to Verify Integration

Troubleshooting

Widget Not Showing

Clear WordPress cache
Check if script is in page source
Verify API credentials
Test with default theme

Plugin Conflicts

Deactivate other plugins temporarily
Check for JavaScript conflicts
Update WooCommerce and WordPress

Performance Issues

Enable caching plugins
Optimize database
Use CDN for assets

Need Help?

Our WordPress experts are here to assist with your WooCommerce integration: