We are currently developing a new WooCommerce theme based on Sage 9.
We always use hooks to change the WooCommerce pages. We use a separate php file in (located in /app) to keep everything tidy. Right now I want to add a partial to the single product page. We haven’t figured out a way to include a blade file.
We tried it with the following code, but also with require_once and include. However, the result is that the blade is spit out as text.
For future reference the final code is: add_action('woocommerce_after_single_product', function() { echo App\template('partials.section-awards'); }, 10);
What is the source of the parameter you’re trying to pass? In your example there is nothing else I’m the scope of the anonymous function passed to the filter, which is the only scope that App\template() has access to.
In my case, i pass a value that i retrieve from ACF options page :
add_action( 'woocommerce_after_main_content', function () {
$warranties = get_field( 'warranties', 'option' );
echo App\template( 'partials.sections.warranties', [ $warranties ] );
} );