In your sage_theme/app/setup.php file add:
add_theme_support('woocommerce');
with your soil theme supports.
In your sage_theme/resources/views folder create a woocommerce.blade.php file. Add the following code to this new file:
@php if ( !defined( 'ABSPATH' ) ) { exit; } @endphp
@extends( 'layouts.app' )
@section( 'content' )
@if ( is_product() ) {{-- if single product --}}
@php
/**
* woocommerce_before_main_content hook.
*
* @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content)
* @hooked woocommerce_breadcrumb - 20
*/
do_action( 'woocommerce_before_main_content' );
@endphp
@while ( have_posts() ) @php the_post(); @endphp
@php wc_get_template_part( 'content', 'single-product' ); @endphp
@endwhile
@php
/**
* woocommerce_after_main_content hook.
*
* @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content)
*/
do_action( 'woocommerce_after_main_content' );
@endphp
@else {{-- if product archive (any) --}}
@if ( woocommerce_product_loop() )
@php
/**
* Hook: woocommerce_before_shop_loop.
*
* @hooked woocommerce_output_all_notices - 10
* @hooked woocommerce_result_count - 20
* @hooked woocommerce_catalog_ordering - 30
*/
do_action( 'woocommerce_before_shop_loop' );
woocommerce_product_loop_start();
@endphp
@if ( wc_get_loop_prop( 'total' ) )
@while ( have_posts() ) @php the_post(); @endphp
@php
/**
* Hook: woocommerce_shop_loop.
*
* @hooked WC_Structured_Data::generate_product_data() - 10
*/
do_action( 'woocommerce_shop_loop' );
wc_get_template_part( 'content', 'product' );
@endphp
@endwhile
@endif
@php
woocommerce_product_loop_end();
/**
* Hook: woocommerce_after_shop_loop.
*
* @hooked woocommerce_pagination - 10
*/
do_action( 'woocommerce_after_shop_loop' );
@endphp
@else
@php
/**
* Hook: woocommerce_no_products_found.
*
* @hooked wc_no_products_found - 10
*/
do_action( 'woocommerce_no_products_found' );
@endphp
@endif
@endif
@endsection
Create a new folder in your sage_theme/resources/ folder called woocommerce. In that folder you need two files, archive-product.php and single-product.php. Both of those files should have: <?php echo App\Template('woocommerce'); ?>
in them.
Now you're good to go.
All Woo traffic will filter through the sage_theme/resources/views/woocommerce.blade.php page, which is then pushing them to the sage_theme/resources/woocommerce folder where you can overwrite Woo template files as you normally do.
If you need to edit something that would normally be in archive-product.php or single-product.php you'll do that in the sage_theme/resources/views/woocommerce.blade.php file.
There might be a way, in sage_theme/resources/woocommerce/archive-product.php and sage_theme/resources/woocommerce/single-product.php to link to separate files instead of the same woocommerce.blade.php file, but I haven't had time to try it out yet.