Conflict with Elementor Pro’s related-products widget

[ad_1]

Hey all,

I wanted to post this here in case it helps someone in the future.

With Elementor Pro, you get a WooCommerce widget for displaying Related Products. The file for this widget is located in your plugins folder at:

/plugins/elementor-pro/modules/woocommerce/widgets/product-related.php

Near the bottom of this file, where it prints out the content of the widget, you will see this line:

echo wp_kses_post( $related_products_html );

wp_kses_post is a function that strips out HTML tags. This breaks the Pixel Manager for WooCommerce plugin. Pixel Manager attempts to inject a meta tag and a script tag, but these tags are stripped out, leaving raw JavaScript visible in your theme.

You can change the above line in Elementor Pro to the following to fix this:

echo $related_products_html;

However this is unsafe and not best practice. I’m hoping the authors of Pixel Manager can come up with a way around this in a future update.

  • This topic was modified 25 minutes ago by app1e5auce.
  • This topic was modified 24 minutes ago by app1e5auce.
  • This topic was modified 24 minutes ago by app1e5auce.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer