• Resolved tallmale

    (@tallmale)


    Hi everyone,

    How can you remove the price and the price box on just one WooCommerce product page only?

    I need the other product pages to have the price displayed but this one specific page I need to remove or hide the Price and the Price Box (This looks like a field box that is used in forms)

    Many thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Vijay Hardaha

    (@vijayhardaha)

    If you’re talking about the single product page then you can override single-product/price.php template into the child theme.

    then add this code after global $product; line.

    if( 100 === $product->get_id() ){
        return;
    }

    change 100 to your product ID.

    Thread Starter tallmale

    (@tallmale)

    Thanks very much Vijay for all your help.

    Mirko P.

    (@rainfallnixfig)

    Hello @tallmale,

    To hide the price of a specific product and not all products you can use CSS with the declaration display: none; targeting the single product page with the specific product ID value. It would be something like this in Storefront, where 49 is the specific product ID:

    .single-product.postid-49 div.product p.price {
    display: none;
    }

    Hope this helps.

    Edit: The method to override shared by @vijayhardaha should work too. Thanks a lot for providing this custom code!

    • This reply was modified 3 years ago by Mirko P..
    Thread Starter tallmale

    (@tallmale)

    Thanks very much Mirko. This is very helpful indeed.

    Mirko P.

    (@rainfallnixfig)

    You’re most welcome! I’m going to close this thread now but I recommend creating a new topic if you have further questions or need assistance with anything else.

    Cheers.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How can you remove the price and price box on just one Product Page only?’ is closed to new replies.