Elementor Editor not loading when using shortcode with get_total_sales
-
Hi,
I’m using the following shortcode to show the total sales of the product within a Loop template.
add_shortcode( ‘wsn-verkocht’, function () {
global $product;
$units_sold = $product->get_total_sales();
if ($units_sold) {return $units_sold;} else {return 0;}
});This shortcode works but when I try to load the editor to edit the Loop template I get a 500 error with the following message:
DOMDocument::loadHTML(): htmlParseStartTag: misplaced <body> tag in Entity,
When I disable the line $units_sold = $product->get_total_sales(); the there is no error and the editor is loading.
Hope you or anyone can help.
Regards, Peter.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Elementor Editor not loading when using shortcode with get_total_sales’ is closed to new replies.