This is a WordPress question.
I’m wondering, how would you create a function that detect if WooCommerce wants to output itself?
So on my page.blade.php file, I’m using ACF with flexbile content, so when WooCommerce wants to output a shortcode, it can’t.
How do I find all woocommerce_*
shortcodes, and let them echo out?
I want to detect if woocommerce is trying to output shortcode and then output it, if not, just keep using the above code, flexbile content.
So far I got this:
@php($count = 0)
@if ( have_rows( 'flexible_content' ) )
@while ( have_rows( 'flexible_content' ) ) @php(the_row())
<section>
{{-- <x-section container="{{ $page[$count]['container'] }}" paddingTop="{{ $page[$count]['paddingTop']}}" paddingBottom="{{ $page[$count]['paddingBottom']}}" bgColor="{{ $page[$count]['backgroundColor'] }}"> --}}
@if ( have_rows( 'row' ) )
@while ( have_rows( 'row' ) ) @php(the_row())
@if ( have_rows( 'column' ) )
@while ( have_rows( 'column' ) ) @php(the_row())
@php($layoutConverted = str_replace( '_', '-', get_row_layout()))
@include('blocks.' . $layoutConverted)
@endwhile
@endif
@endwhile
@endif
</section>
{{-- </x-section> --}}
@php($count++)
@endwhile
@elseif(true)
{{-- check if it has shortcode of: woocommerce_* , if yes, display it --}}
@php(the_content())
@else
<h3>No matching template found - page.blade.php
@endif