I have a custom looper that retrieves posts (in this case woocommerce products) where a custom field value existing in the meta query. This bit works fine.
Nested within that looper, I have another custom looper that retrieves the tax price. This also works fine on the front of the site, but in Cornerstone, the preview won’t load if I have the nested custom looper provider active (and pointed at my function).
Maybe I’m being blind, but I cannot see what is wrong with my custom looper function that would cause the preview to stop working:
add_filter( 'cs_looper_custom_dgg_tax_prices', 'dgg_homepage_tax_prices' );
function dgg_homepage_tax_prices( $result ) {
global $product;
$wrap_html_start = '<span style="color: #ffffff;">(<span class="dgg-homepage-exvat-price" style="color: #ffffff;">';
$wrap_html_end = '</span> Inc. VAT)</span><br />';
if ( !empty(wc_get_price_including_tax( $product ))) :
$tax_price = $wrap_html_start . wc_price( wc_get_price_including_tax( $product ) ) . $wrap_html_end;
endif;
return [
[ "tax_price" => "$tax_price" ]
];
}