Okay
  Public Ticket #1162638
Changing price position make it show twice
Closed

Comments

  •  2
    Hassan started the conversation

    Hello,

    I want to show price beside product title. For which i have to move the price up. I edited single page price position. I added actions

    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
    add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 2 );

    In my sanzo-child functions.php. But it does not remove price action at position 10 and added at position 2 as well. So its showing price twice. If i again add action at position 10 instead of 2 then it shows only once. Is it something you can help me with?

  •  305
    Stormit replied

    Hi Hassan,

    You add the code below

    add_action('template_redirect', 'sanzo_child_template_redirect');
    if( !function_exists('sanzo_child_template_redirect') ){
        function sanzo_child_template_redirect(){
            remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_price', 5);
            add_action('woocommerce_single_product_summary', 'woocommerce_template_single_price', 1);
        }
    }
    

    Best regards,