How to Add New Product/Edit Product items of WooCommerce from the custom fields

This will customize way the add/edit to the Product of WooCommerce possible from custom fields with add metabox.

If you want to with Advanced Custom Fields, please see it post.

How to Add Basic Product Edit of WooCommerce from the Advanced Custom Fields

 

Settings the Product data of Custom Fields

Settings the Product data of Custom Fields

 

 

 

Step1 Remove the metabox of Product Data of WooCommerce

 

Please add code to functions.php of your theme.

 

 

Step2 Add new metabox

 

Please add code to custom_product_basic_load function.

 

And please add code to functions.php.

 

It is looks like this.

 

 

 

Add metabox

Add metabox

 

 

Step3 Add fields to the basic fields

 

It will create the custom fields for the basic field of General of Simple products of WooCommerce.

 

General Basic Price Fields

General Basic Price Fields

 

 

Please add code to custom_product_basic_metabox function.

 

It looks like this.

 

Add Price Fields

Add Price Fields

 

Also it will add other fields in the same way.

 

 

 

Step4 Add Inventory fields

 

In this example it will simple manage the stock.

Please add code to custom_product_basic_metabox function.

 

It looks like this.

 

Add Stock Status Fields

Add Stock Status Fields

 

 

Step5 Add Shipping Class Field

 

This step is add the Shipping Class. In like this way.

 

Shipping Class Fields of WooCommerce

Shipping Class Fields of WooCommerce

 

 

Please add code to custom_product_basic_metabox function.

 

It looks like this.

 

Add Shipping Class Fields

Add Shipping Class Fields

 

 

Step6 Save the Custom Fields and relation Terms

 

This step is save the value of the added field.

Please add code to custom_product_basic_load function.

 

And please add code to functions.php.

NOTEproduct_type and product_shipping_class is not custom fields. 🙂
There is terms.

 

 

This is complete! 🙂

It look like this.

 

 

Basic Product Item

Basic Product Item

 

 

Full code is here.

 

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *


*