Join Patrick Rauland for an in-depth discussion in this video Save product fields, part of WordPress Ecommerce: WooCommerce Plugins.
- [Patrick] We've created a few fields,…but we haven't validated or saved any of this data,…so let's do that.…I'll go to my code, and in my code here…we're going to create a new action that fires…when the product page is saved.…So I'm gonna type in add_action,…and in this case I'm going to use…woocommerce_process_product_meta…and this fires when extra product information is being saved…and that's exactly when we're gonna call our function.…
For just a moment I'm going to call this in the usual way.…So, array, $this and I'll just call it save for right now.…That's the standard way we've been calling it,…but we'll change that in just a second.…But first, I'll set the priority to 20 because I want…this to run after other things have run,…and normally when we send through one parameter…we can type in comma one, or if we just leave it blank…WordPress will assume one.…But in this case we want to send through two,…so we have to manually type that,…and we end the line with a semicolon as per usual.…
This is normally how I call a specific method in a class,…
- Creating a WooCommerce plugin
- Finding hooks within WooCommerce
- Creating settings pages
- Analyzing WooCommerce settings
- Configuring settings
- Customizing the edit product page
- Using hooks on the product page
- Customizing the WooCommerce checkout
- Adding custom order statuses
Skill Level Intermediate
Q: This course was updated on 08/07/2018. What changed?
A: The following topics were updated: adding a meta box, saving product fields, customizing product titles, and adding data to product page tabs.
1. Overview of Customizing WooCommerce
Print an admin notice4m 21s
2. Create Settings Pages
3. Customize the Edit Product Page
4. Customize the Product Page
5. Customize the WooCommerce Checkout
6. Customize the WooCommerce Admin
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.