How to move AIG – Product AI Image Customizer inside another hook of the WC Product Page

The main action hook is defined inside wp-content\plugins\artist-image-generator-product-ai-image-customizer\includes\class-artist-image-generator-product-ai-image-customizer.php l.87

add_action('woocommerce_single_product_summary', array($this, 'display_aig_shortcode'), 10);

On your theme or, better, if you have a child-theme, place at the end of functions.php this following code :

// Remove the action that displays the Artist Image Generator shortcode on the single product page
// and add it to the bottom of the single product page
add_action( 'woocommerce_single_product_summary', function() {
    global $artist_image_generator_product_ai_image_customizer;

    remove_action('woocommerce_single_product_summary', array($artist_image_generator_product_ai_image_customizer, 'display_aig_shortcode'), 10, 2);
    add_action('YOUR_NEW_HOOK', array($artist_image_generator_product_ai_image_customizer, 'display_aig_shortcode'), 10, 2);
}, 9 );

YOUR_NEW_HOOK should be an existing WooCommerce action hook or a custom hook you’ve built.

If the generator is not displaying, try first to figure if the hook exists inside your theme (by finding it inside the “woocommerce/content-single-product.php” file) and check if the priority (here 10) is enough.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Item added to cart.
0 items - 0,00