My Courses > CustomizeWoo > Module 5 > Lesson 03: Custom Fields
Custom fields (post meta, metadata) allow you to store additional information with each WordPress post (WooCommerce products included). They can then be displayed/used anywhere.
Please note: English captions are enabled by default (click on “CC” in the video player to disable). Also, you can click on the “gear” icon to manage quality and playback speed. Enjoy!
WooCommerce: Add Custom Product Fields (e.g. RRP) Without a Plugin: https://www.businessbloomer.com/woocommerce-display-rrp-msrp-manufacturer-price/
WooCommerce: Add Custom Field to Product Variations: https://www.businessbloomer.com/woocommerce-add-custom-field-product-variation/
WordPress Custom Fields: https://wordpress.org/support/article/custom-fields/
12 thoughts on “Custom Fields”
I want to show an specific attribute in the single_product_summary after the price and on the left site. I know you told this in one of the courses but I can’t find the specific course anymore. Can you guide me in the right direction?
Thanks for your question Marco 🙂
So, to display a custom field you can use https://businessbloomer.com/woocommerce-show-number-products-sold-product-page/ (in this case it gets the total sales, but you can get the custom field value with get_post_meta() – here’s an example: https://businessbloomer.com/woocommerce-show-product-custom-field-in-the-category-pages/)
Let me know
I am not getting there. The attribute is pa_merk and I want it after woocommerce_single_product_summary. I think it is easy but I am not seeing it. Could you …..:-)
Ah – sorry – so it’s a product attribute. Try with:
YEP, that’s it. Thanks
And if I want that attribute to link to the archive page?
I would search through the WooCommerce plugin files for the wc_display_product_attributes() function. At some stage within this function you find this for a single attribute:
So, you first need to get the $attribute_value.
Another option: https://docs.woocommerce.com/document/display-product-attribute-archive-links/
Thanks for all that!
Thank you – but I need to just add a number (Item Code) to be displayed – what should be the ‘data type’?
You can just remove that line, as it’s not a price 🙂
I have watched the lesson you have recommended and read the article, but something is still not clear;
I have used this code – from your website – to add a custom field on variation products:
Can you let me know what changes I need to add to this code in order for the custom field to be displayed also on simple products pages?
If it’s to much trouble – can you recommend a professional that can to it for money? I know it’s fairly easy for an experienced developer – I just need it solved fast and I am just in the
beginning of my WooCommerce programming journey..
For simple products you can use this version: https://businessbloomer.com/woocommerce-display-rrp-msrp-manufacturer-price/
Let me know 🙂