fbpx
Want To Add Extra Images Per Product Variation For Free? Download Now

Move Archive Page Variations Wrapper before Loop Item Title

Abidin Alkilinc

Hello,

I am trying to move the Variations Wrapper higher in the order, specifically before the Item Title.

I attempted the following code, but unfortunately, it doesn’t seem to work:

add_action('woo_variation_swatches_pro_archive_page_loaded', function ($wvs_pro) {
    remove_action('woocommerce_init', array($wvs_pro, 'enable_swatches'), 1);
    add_action('woocommerce_before_shop_loop_item_title', array($wvs_pro, 'after_shop_loop_item'), 9);
}, 10, 1);

I placed this code at the end of my theme’s functions.php file.

Regards,
Abidi

Hakik Zaman

Hi Abidin,

Thanks for reaching out to us.

That code will not work inside your theme’s functions.php file.

Please use a plugin called Code Snippets and add a snippet using that plugin.

Theme’s functions.php hook applies before the plugins_loaded hook.

So, you have to use the Code Snippets plugin to call it after our plugin loads.

Thank You