Skip Navigation

[Resolved] Display old product price in WooCommerce..

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 6 replies, has 2 voices.

Last updated by thomasS-11 6 years, 10 months ago.

Assigned support staff: Luo Yang.



How do i display the normal price on a product?
When i use [types field="views_woo_price" output="raw"][/types] from WooCommerce Views plugin, i get the Sale price on a product.. i would like to display the "old" price as well so the customer can see it in the product archive.

Further more, is it possible to do a mathematical calculation in a view loop?
I want to display the saving amoung in percentage, in it could be done with a mathmatical calculation.

Also, is it possible to make it conditional as well? so if the specific product is not on sale, it shouldnt show the percentage?



Luo Yang

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

If you are going to display the regular price, which is using field slug "_regular_price", please try Views shortcode [wpv-post-field], like this:
[wpv-post-field name="_regular_price"]

More help:


Works like a charm! - can i do this with all fields?

How do i make a calculation? i.e. "sale_price / regular_price * 100" = SAVED AMOUNT IN %

Thanks again!


Luo Yang

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Here is a shortcode can perform of calculation

Hope it help


Calculations are not correct at all?

Regular price is 150
Sale price is 25

[wpv-post-field name="_regular_price"]-[wpv-post-field name="_sale_price"]/[wpv-post-field name="_regular_price"]*100

This calculation gives me 133..
It should give 83...

I have tried performing the exact same calculation on a calculator, and i get 83 as i should.. i dont know why views makes it 133..


Luo Yang

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Are you going to Calculate as below?
(_regular_price - _sale_price) * 100 / _regular_price

Please try modify your codes as below:

([wpv-post-field name="_regular_price"]-[wpv-post-field name="_sale_price"])*100/[wpv-post-field name="_regular_price"]

I dont know what i would do without you..