Hi there,
It is technically possible, though at the moment, depending on how many configurable products will be shown on an archive page, it could make it a bit heavy and impact performance, because of the data for each product would be loaded on the archive.
The idea is to use the shortcode [mkl_configurator_button] in the loop. Something like that:
<?php
add_actino( 'woocommerce_after_shop_loop_item', function() {
global $product;
if ( ! function_exists( 'mkl_pc_is_configurable' ) ) return;
if ( mkl_pc_is_configurable( $product->get_id() ) ) {
echo do_shortcode( '[mkl_configurator_button product_id="' . $product->get_id() . '"]"' );
}
}, 11 );
add_filter( 'load_configurator_on_page', '__return_true' );
Thread Starter
smams
(@smams)
That’s great, thank you for your help.
Marc Lacroix
I was tried you’re provided code. But it displaying the configurator with the first product on the archive page. And it not working with all other products, on archive page. it’s showing the this message for all other products ‘The provided ID is not a valid product.’
Can you please assist me with this issue? I would greatly appreciate your help.
Hi @arham786,
Please open your own issue to prevent other participants from receiving all the answers.
Marc