Hi,
I'm trying to include a custom template for my product card item inside the worpress loop of archive-product.blade.php template using wc_get_template_part('content', 'simpleproduct') (as wc_get_template_part('content', 'product') is working)
I've got an error, whatever slug and custom template name I tried to load.
Debugging your woocommerce class and woocommerceserviceprovider it seems your filter wc_get_template_part doesn't have enough args length and the function in charge of loading templates parts the wrong arguments compare to offical hook :
Yours :
add_filter('wc_get_template_part', [$woocommerce, 'template']);
public function template(string $template, string $templateName = ''): string
Official :
add_filter( 'wc_get_template_part', 'wp_kama_wc_get_template_part_filter', 10, 3 );
function wp_kama_wc_get_template_part_filter( $template, $slug, $name )
So the template path to search is missing $slug and never find the right template
Please can you have a look
Thank you
Florent
Hi,
I'm trying to include a custom template for my product card item inside the worpress loop of archive-product.blade.php template using wc_get_template_part('content', 'simpleproduct') (as wc_get_template_part('content', 'product') is working)
I've got an error, whatever slug and custom template name I tried to load.
Debugging your woocommerce class and woocommerceserviceprovider it seems your filter wc_get_template_part doesn't have enough args length and the function in charge of loading templates parts the wrong arguments compare to offical hook :
Yours :
So the template path to search is missing $slug and never find the right template
Please can you have a look
Thank you
Florent