Skip Navigation

[Resolved] Access additional WooCommerce fields with WPV short codes (i.e. sku)

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

Problem:
How to access native WooCommerce Post Fields, like for example sku and sale_price, and others, with Toolset, so to display them?

Solution:
The ShortCode

wpv-woo-product-meta

helps you to display Product Meta data:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-woo-product-meta
It basically calls the WooCommerce

woocommerce_template_single_meta()

function that by default outputs the following:

Product SKU
Categories
Tags

Now, to output this in a more controlled way, you can use the "Post Fields" section in the GUI when you insert the Fields, but also have a look at the inbuilt ShortCodes here:
https://toolset.com/documentation/user-guides/views-shortcodes/#woocommerce-views

Most of the data can already be called with those ShortCodes.

SKU is a hidden field, not a regular WordPress Field.

So you need to first make it visible in Toolset by adding it in Toolset > Settings > Front-End Content > Hidden custom fields

Then it'll appear in the GUI under "Post Fields".

We have a new DOC that might hep you determine what you can and cannot use with Toolset and how to register the fields:
https://toolset.com/documentation/user-guides/creating-woocommerce-products-using-cred-forms/
It's related to CRED but the registration section and the Field's Table there is very useful for an overview.

This support ticket is created 7 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

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.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 4 replies, has 2 voices.

Last updated by damianS-2 7 years, 2 months ago.

Assisted by: Beda.

Author
Posts
#481728

I am trying to build a custom Content Template for the WooCommerce single product view. When I try to add Woo fields to this layout using WPV short codes, however, there are many fields that are not accessible, for example sku and sale_price.

Here's an example page that I built by editing the PHP templates built into Woo. This in particular I created by adding code to woocommerce/templates/single-post/price.php.

hidden link

Is it possible to enable access to more Woo fields than the several that I see in the editor?

Thanks,

Damian

#481807

The ShortCode "wpv-woo-product-meta" helps you to display Product Meta data:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-woo-product-meta
It basically calls the WooCommerce woocommerce_template_single_meta() function that by default outputs the following:
Product SKU
Categories
Tags

Now, to output this in a more controlled way, you can use the "Post Fields" section in the GUI when you insert the Fields, but also have a look at the inbuilt ShortCodes here:
https://toolset.com/documentation/user-guides/views-shortcodes/#woocommerce-views

Most of the data can already be called with those ShortCodes.

#482138

OK, that makes sense.

It sounds like you're saying that I can access individual fields, like sku, is that correct? How would I do that? I'm not seeing it in the docs, I'm sure I'm just missing it.

Thanks

#482193

SKU is a hidden field, not a regular WordPress Field.

So you need to first make it visible in Toolset by adding it in Toolset > Settings > Front-End Content > Hidden custom fields

Then it'll appear in the GUI under "Post Fields".

We have a new DOC that might hep you determine what you can and cannot use with Toolset and how to register the fields:
https://toolset.com/documentation/user-guides/creating-woocommerce-products-using-cred-forms/
It's related to CRED but the registration section and the Field's Table there is very useful for an overview.

#483473

Perfect, thanks

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.