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.
Theme Customizer
Use WordPress Customizer for easy integration
- No coding required
- User-friendly interface
- Safe and reversible
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)
Access WordPress Customizer
From your WordPress admin, go to Appearance → Customize
Find Additional CSS or Code Injection
Look for one of these sections in the customizer:
- "Additional CSS"
- "Custom Code"
- "Footer Scripts"
- "Code Injection"
Add Wewell Script
If using Additional CSS, wrap the script in <style> tags. For script sections, use the code directly:
<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>
Publish Changes
Click "Publish" to save your changes
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.
Access Theme Editor
Go to Appearance → Theme Editor in your WordPress admin
Open functions.php
Select functions.php from the file list on the right
Add Wewell Function
Add this code to the end of your functions.php file:
// 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');
Update File
Click "Update File" to save your changes
Method 3: Template Files (Advanced)
Advanced Users Only
This method requires knowledge of WordPress template hierarchy and PHP. Always use a child theme.
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)
Edit Template File
Add the script before the closing </body> tag or in the appropriate location:
<?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
Plugin Conflicts
Performance Issues
Need Help?
Our WordPress experts are here to assist with your WooCommerce integration: