Skip to main content

Hi! I'm trying to add the reviews widget to my site, following the instructions in the help documentation, but the widget doesn't appear as an option in my visual theme editor. I work with woocommerce and the Avada Theme. I completed the process with the Code Snippets plug-in, but once it's activated, nothing appears in my visual editor.

Does anyone know how to integrate Klaviyo Reviews into an Avada Theme?

Hey @Maria Molina 

Does your code snippet look something like this? 

add_action('woocommerce_after_single_product_summary', 'klaviyo_reviews_widget', 15);
function klaviyo_reviews_widget() {
?>
<div id="klaviyo-reviews-widget"></div>
<script type="text/javascript">
Klaviyo.load({ widget: 'reviews', productId: '<?php echo get_the_ID(); ?>' });
</script>
<?php
}

Troubleshooting Tips

Ensure jQuery is Loaded:

  • The Klaviyo Reviews widget relies on jQuery. Ensure that jQuery is loaded on your site. The Avada theme should already include jQuery, but verify this in your theme settings.

Check for JavaScript Errors:

  • Open your browser's developer tools (F12 or right-click and select "Inspect") and check the console for any JavaScript errors that might be preventing the widget from loading.

Manually Insert the Widget Code:

  • If the Code Snippets plugin is not working, try manually inserting the widget code into your theme’s files. You can add the code directly to your theme's functions.php file or use a child theme to avoid overwriting changes during theme updates.
  1. For example, add the following code to the functions.php file:

function add_klaviyo_reviews_widget() {
if (is_product()) {
?>
<div id="klaviyo-reviews-widget"></div>
<script type="text/javascript">
Klaviyo.load({ widget: 'reviews', productId: '<?php echo get_the_ID(); ?>' });
</script>
<?php
}
}
add_action('wp_footer', 'add_klaviyo_reviews_widget');
  • Verify Widget Settings:

    • Ensure that the Klaviyo Reviews widget settings are correctly configured in your Klaviyo account. Check for any specific settings or configurations required for WooCommerce and the Avada theme.
  • Use Klaviyo's Embed Code:

    • Klaviyo might provide an embed code that you can place directly into your theme’s template files. Check Klaviyo's documentation or contact their support for the specific embed code for the reviews widget.

If none of these work, I would suggest you contact klaviyo support for assistance. Provide them with details about your theme, the steps you have taken, and any error messages you have encountered.

I hope this helps

Cheers

Arpit


Reply