When I add WooCommerce shortcodes as follows in WordPress WYSIWYG editor pages or in blade templates:
[products columns=“4”]
{!! do_shortcode(’[products columns=“4”]’) !!}
<?php echo do_shortcode('[products columns="4"]'); ?> @php echo do_shortcode(’[products columns=“4”]’); @endphp
My WordPress site breaks, removes the admin bar, and doesn’t display any products. I have Sage WooCommerce (https://github.com/roots/sage-woocommerce) installed and I can override the template pages just fine. The issue comes in when I try to use WooCommerce shortcodes and even template functions like “wc_get_template_part(‘content’, ‘product’);”. It even breaks product pages when I insert the WooCommerce shortcodes.
Does this happen on development or on staging/production?
When the page breaks and output is aborted there is probably a fatal PHP error.
Is error display enabled? What is logged in the PHP error logs?
I figured it out. I had a file in the /woocommerce/content-product.blade.php that was blanking out all the [product*] stuff. Removing it made all the shortcodes work again. Thank you all for responding.