1. Home
  2. Knowledge Base
  3. WooCommerce Product Add-Ons Ultimate
  4. Disable pricing
  1. Home
  2. Knowledge Base
  3. Pricing
  4. Disable pricing
  1. Home
  2. Knowledge Base
  3. Advanced
  4. Disable pricing

Disable 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.

Was this article helpful?

Related Articles