Support » Plugin: YITH WooCommerce Request A Quote » Add to quote button shows up in the wrong place on variable products

  • Hi,

    I’m having a problem displaying the add-to-quote button next to the add-to-cart button on product pages.

    I was able to correct the problem for simple products with

    add_action( 'woocommerce_after_add_to_cart_button', array( YITH_YWRAQ_Frontend(), 'add_button_single_page' ) );

    but it doesn’t work for variable products.

    Do you have a workaround ?

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi @cmontcour,

    yes you could try to use this:

    add_action( 'woocommerce_after_single_variation', array( YITH_YWRAQ_Frontend(), 'add_button_single_page' ),15 );

    Thank you for your answer. Sadly, it doesn’t seem to work :
    Screenshot
    My code :

    
    if( class_exists('YITH_YWRAQ_Frontend') ){
      remove_action( 'woocommerce_single_product_summary', array( YITH_YWRAQ_Frontend(), 'add_button_single_page' ), 35 );  
      add_action( 'woocommerce_after_add_to_cart_button', array( YITH_YWRAQ_Frontend(), 'add_button_single_page' ), 1 );
      add_action( 'woocommerce_after_single_variation', array( YITH_YWRAQ_Frontend(), 'add_button_single_page' ), 15);
    
    }
    

    I just duplicates the button.

    Thank you in advance.

    Plugin Author YITHEMES

    (@yithemes)

    Hello. Please try with the following code:

    if ( ! function_exists( 'yith_ywraq_move_button' ) && class_exists( 'YITH_YWRAQ_Frontend' ) ) {
        add_action( 'template_redirect', 'yith_ywraq_move_button', 99 );
        function yith_ywraq_move_button(){
            global $post;
            remove_action( 'woocommerce_single_product_summary', array( YITH_YWRAQ_Frontend(), 'add_button_single_page' ), 35 );
            if ( ! empty( $post->ID ) && 'variable' != wc_get_product( $post->ID )->get_type() ) {
                add_action( 'woocommerce_after_add_to_cart_button', array( YITH_YWRAQ_Frontend(), 'add_button_single_page' ), 1 );
            }
            add_action( 'woocommerce_after_single_variation', array( YITH_YWRAQ_Frontend(), 'add_button_single_page' ), 15);
        }
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.