• I have been asking a question on an older topic and I feel like you don’t read them so I have created a new topic.

    I cam trying to move the get_compare_button to woocommerce_after_add_to_cart_button

    I tried

    remove_action ( 'woocommerce_single_product_summary',  'get_compare_button' , 38 );
    add_action ( 'woocommerce_after_add_to_cart_button',  'get_compare_button' , 20 );

    and it did not work.

    You said that it is not a function and I need to call the instance with this code BeRocket_Compare_Products::getInstance(); but to be honest I don’t understand where.

    I have tried

    global $BeRocket_Compare_Products;
    remove_action( 'woocommerce_single_product_summary', array($BeRocket_Compare_Products, 'get_compare_button'), 38  );

    and a number of other options but non have worked.

    Is it possible to move the get_compare_button from one of the 4 default positions?

Viewing 1 replies (of 1 total)
  • Plugin Author RazyRx

    (@razyrx)

    Hello,

    Try this code to remove button

    $BeRocket_Compare_Products = BeRocket_Compare_Products::getInstance();
    remove_action( 'woocommerce_single_product_summary', array($BeRocket_Compare_Products, 'get_compare_button'), 38  );

    Also do not forget that this code will work only if position selected as “After Add to cart button”

    Regards,
    Oleg

Viewing 1 replies (of 1 total)
  • The topic ‘move compare button with remove_action and add_action’ is closed to new replies.