The plugin adds prices on top of the main price. Can it also replace the main product price completely?

By default, Advanced Product Fields for Wooommerce is an Add-on plugin, which means it adds/subtracts an additional cost on top of the main product price. This scenario is sufficient for most of our users and also integrates best with WooCommerce.

However, sometimes you want to replace the main product price with your new pricing calculations. This is mainly the case if you have more complex pricing and it’s just easier to calculate the new main price rather than an add-on price.

In this article, we explain a few ways on how to achieve what you want.

Let’s dive in!

Option 1: Set the WooCommerce product price to zero

One option is to set the Regular Price of your product to zero. Please note this approach works best when working with Simple products.

The main advantage of this approach is that you can use our plugin to perform all pricing calculations without worrying about a base product price. There are also a few disadvantages, but our plugin offers some solutions:

  • You can not use WooCommerce’s Sale Price setting anymore. Since you will be using our plugin to calculate pricing, you could build a sale into your calculations.
  • If you set the regular price to zero, your shop and product pages will display pricing as zero (as if your product is free). Luckily, if you are creating a simple product, our plugin comes with handy settings to change the price display. The Price Display setting allows you to replace the WooCommerce price label. The Extra Price Label setting allows you to enter your own price label.Price display settings in APF
  • The “Product total” and “Options total” lines in the pricing summary are reduntant. You can disable these lines by going to WooCommerce → Settings → Product Fields and set the Display Pricing Summary setting to Only Show Grand Total.

Option 2: use pricing formulas

Another way to solve this scenario is by using formulas when setting up pricing.

Let’s say your product is priced $5. Enabling a checkbox should set the total product price to $8. In the normal scenario, you would just add an extra charge of $3 (because 5 + 3 is 8):

A product with a simple extra cost when checking a checkbox

But, that is not what you want to do here. You want to replace the main price with $8 instead! You can do this by using formula-based pricing with the following formula:

{total price of product} - [price]

{total price of product} is 8 in our example (because we want the final price to be $8). [price] is a dynamic shortcode that automatically points to your product’s base price. So basically, this formula just deduct the base price again. Your formula becomes 8-[price]:

A product field with formula-based price settings

In doing so, the “Product total” and “Options total” lines in the pricing summary become reduntant. You can disable these lines by going to WooCommerce → Settings → Product Fields and set the Display Pricing Summary setting to Only Show Grand Total. You can also hide the pricing summary completely and instead update the WooCommerce price label at the top of the product page.

But do you really need this?

While these solutions work well, we found that in 99% of the cases, working with extra (add-on) pricing works just as well. Set WooCommerce’s Regular Price setting to the cheapest possible price of your product and then use our plugin to add extra costs on top of that price.

Was this article helpful?

Related Articles