0

I’m using Datafeedr to show price comparison sets on a product page. The price comparison table opens up dynamically once the page is loaded. But because I want people to follow the link to the cheapest store that offers that product I really have no use for each imported product to show it’s own price. That price could be higher than the prices that are shown in the comparison table and the link of the button would then send the visitor to the wrong store. I have a plugin that turns of the prices and add to cart buttons, but it also turns of the prices on the category pages. And I do want the prices to show there because on the category pages people can filter the prices or set a price range. Can someone tell me with which snippets I can leave the prices in the category pages, but hide them on the single product pages and also how to hide the add to cart button? Thanks very much!

1 Answer 1

1

This will remove price and add to cart button on the product page Only

// Remove Price from the product page
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );

// Remove Add to cart form from the product page
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
2
  • Hey that is awsome. It does exactly what I was looking for. Thanks a lot! Sep 18, 2019 at 8:51
  • No worries, you can mark this answer as accepted. Sep 24, 2019 at 3:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.