Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    On which page? Provide a link please.

    Thread Starter John

    (@jemoreto)

    Hello Mike!

    I’m in an internal development.

    In an only one product, which ID is 161, I need to invert the order of the price and the excerpt.

    I’m trying this code in functions.php, but isn’t working.

    if ( is_single(161) ) {
    	remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
    	add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 21 );
    }

    Thanks!!

    Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    Have you removed the conditional to work out if its that or the filter changes not working?

    Thread Starter John

    (@jemoreto)

    The filter changes is not working, maybe because it is inside functions.php? I mean, this change have to be made in another way?

    If I remove the “if ( is_single(161) )” conditional it works, but for all the products, and I need to change this only in product ID 161.

    Thanks Mike

    Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    If it works without is_single, it must be the wrong ID or something along those lines. That conditional should be fine. I guess you could hook it in later if you think is_single is being called too early.

    Thread Starter John

    (@jemoreto)

    Great Mike!

    In functions.php it really didn’t work.

    I made this work putting the code inside content-single-product.php template, before do_action( 'woocommerce_single_product_summary' );, and it worked.

    Cheers

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Change price and excerpt in specific product’ is closed to new replies.