• Resolved peterpruimboom

    (@peterpruimboom)


    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)
  • Plugin Author dudaster

    (@dudaster)

    you should be able to inspect element and see network activity and the content it returns after ajax request. Can you try to see if it ajax replies with an document error?

    Thread Starter peterpruimboom

    (@peterpruimboom)

    Sorry, but I don’t the time to further investigate this problem and am using another solution. For now I close this ticket and mark it as resolved.

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.