Skip Navigation

[Resolved] Display Minimum WooCommerce Product Price in Archives

This thread is resolved. Here is a description of the problem and solution.

Problem:
I'm attempting to display only the minimum price of variable products in my product archives. While the shortcode [wpv-post-field name='views_woo_price'] initially worked for manually created test products, it no longer outputs a value after importing actual products using WP All Import.
Solution:
The 'views_woo_price' shortcode is a built-in WooCommerce Views field that Toolset uses to control WooCommerce prices. Batch processing may update it, but it's uncertain if it'll resolve the issue. Alternatively, you can use CSS to truncate the text of the price and show only the starting portion to fit the design.

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 3 replies, has 2 voices.

Last updated by Christopher Amirian 7 months, 3 weeks ago.

Assisted by: Christopher Amirian.

Author
Posts
#2690988

I'm trying to display only the minimum price of variable products (as opposed to the default price range) in my product archives. I was able to initially get the [wpv-post-field name='views_woo_price'] shortcode to work when I manually created test products by hand, but when I imported the actual products that are to be present in the site using WP All Import, the shortcode no longer outputs a value.

If I use the [wpv-woo-product-price] shortcode, it outputs the price range of the product, but the design spec doesn't leave enough room for this as it only intended for the starting value to be displayed with a "As low as $XX" statement.

This is the support thread I was following that lead me to the [wpv-post-field name='views_woo_price'] shortcode:
https://toolset.com/forums/topic/wpv-woo-product-price-shortcode-with-variable-products/

Here is the page in question: hidden link

Any help in this manner would be greatly appreciated. Thanks in advance!

#2691192

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

It will be very hard to detect what might cause the issue during the import.

The 'views_woo_price' on the other hand, is a built-in Woocommerce Views fields that is created exactly after activating the plugin and when using WooCommerce Views.
We add that to allow Toolset to control WooCommerce prices in features like parametric searches, and more.
So it's a link to the WooCommerce Price Field so to handle this 3rd party fields correctly in the Custom Searches.
It can be updated by batch processing:

https://toolset.com/documentation/woocommerce-views-calculated-fields-and-batch-update/#wcv-update-calculated

But I do not know if it will fix the issue you have.

An alternative solution is to cut the text of the price via CSS to show only the first portion to accommodate the design.

I did a Google search that might help you get started:

hidden link

Thank you.

#2691210
Screenshot 2024-04-06 at 16-39-57 Products Archive Triple E Apparel.png

It appears that manually running the batch processing addresses the issue. The default WP Cron setting says it runs once a day, but if I set it to run every five minutes, will this automatically address the issue (as opposed to manually running it after every import) and will this impact site performance at all?

#2691405

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

If the website is not too big it should not have a big impact especially as the prices will not update until a change happens.

But this is something you need to test on your server and see to find the best solution.

Thanks.