1. Home
  2. Knowledge Base
  3. WooCommerce Product Add-Ons Ultimate
  4. Product Page
  5. Pricing
  6. Hiding add-on field and option prices
  1. Home
  2. Knowledge Base
  3. WooCommerce Product Add-Ons Ultimate
  4. Hiding add-on field and option prices

Hiding add-on field and option prices

This article refers specifically to hiding field and option prices in the Add-Ons Ultimate plugin. For a more general guide, check out this article for a detailed tutorial on how to hide prices in WooCommerce.

In Add-Ons Ultimate, you can set which fields you would like to display prices for. And you can also choose whether to display prices on certain fields, e.g. on the product page, then hide them on other pages, e.g. the cart and checkout page.

Setting field price visibility

Each field can have a different setting – so you can choose to display prices for Field A, but hide them for Field B.

To hide a field price, you need to use the Field Price Visibility setting:

In the Field Price Visibility setting, you have the following choices:

  • Visible – this is the default option. Choose it to display the field price everywhere on the site
  • Hide on product page only – choose this option to hide the field price on the product page, but display it elsewhere, e.g. on the cart page
  • Hidden – choose this option to hide the field price on all front-end pages, including the product page, cart, checkout, and order confirmation page

Note that the price is always displayed in the back-end order screen.

Hiding option prices

Just as with option prices, you can also set option price visibility. Each field type that has options, i.e. ‘Checkbox Group’, ‘Image Swatch’, ‘Radio Group’ and ‘Select’ fields, have an ‘Option Price Visibility’ setting.

This setting has the same choices as the Field Price Visibility setting above, i.e.:

  • Visible – this is the default option. Choose it to display the option prices everywhere on the site
  • Hide on product page only – choose this to hide the option prices on the product page, but display them elsewhere, e.g. on the cart page
  • Hidden – choose this to hide the option prices on all front-end pages, including the product page, cart, checkout, and order confirmation page

Option prices are always displayed in the back-end order screen.

Hiding zero prices

If your add-on field doesn’t have a price assigned to it, you can opt to hide the pricing information in the cart and at checkout.

Just go to WooCommerce > Settings > Product Add-Ons and select ‘Hide zero prices’:

Disable add-on pricing

If you are not adding any prices to your add-on fields, you can disable pricing using this snippet:

<?php
remove_action( 'woocommerce_before_calculate_totals', 'pewc_wc_calculate_total', 10, 1 );
remove_filter( 'woocommerce_cart_item_price', 'pewc_minicart_item_price', 10, 3 );
remove_action( 'woocommerce_cart_calculate_fees', 'pewc_cart_calculate_fees', 10 );
function prefix_remove_actions() {
remove_action( 'woocommerce_before_calculate_totals', 'pewc_wc_calculate_total', 10, 1 );
remove_filter( 'woocommerce_cart_item_price', 'pewc_minicart_item_price', 10, 3 );
remove_action( 'woocommerce_cart_calculate_fees', 'pewc_cart_calculate_fees', 10 );
}
add_action( 'init', 'prefix_remove_actions' );

You can find out how to add this snippet here.

How to hide the product price

To hide the product price using Product Add-Ons, see this article.

If you’d like to see some different methods for hiding the product price using the Members Only plugin, please check this article on WooCommerce hide price.

Was this article helpful?

Related Articles