Wednesday, 16 May 2018

How to Create a Custom Settings Panel in WooCommerce


WooCommerce is by far the leading ecommerce plugin for WordPress. At the time of writing, it has over 3 million active installations and is reportedly behind over 40% of all online stores. One of the reasons for WooCommerce’s popularity is its extendability. Like WordPress itself, WooCommerce is packed full of actions and filters that developers can hook into if they want to extend WooCommerce’s default functionality.
A great example of this is the ability to create a custom data panel.
What’s Covered in This Tutorial?
This tutorial is split into two parts. In part one, we’re going to be looking at:
adding a custom panel to WooCommerce
adding custom fields to the panel
sanitizing and saving custom field values
Then in part two, we’ll look at:
displaying custom fields on the product page
changing the product price depending on the value of custom fields
displaying custom field values in the cart and order
What Is a WooCommerce Custom Data Panel?
When you create a new product in WooCommerce, you enter most of the critical product information, like price and inventory, in the Product data section.
In the screenshot above, you can see that the Product data section is divided into panels:
Source: https://managewp.org/articles/17433/how-to-create-a-custom-settings-panel-in-woocommerce



source https://williechiu40.wordpress.com/2018/05/16/how-to-create-a-custom-settings-panel-in-woocommerce/

No comments:

Post a Comment