Add/Update Extra Html Field And Extra Product Meta Fields In Dokan

Code

How To Add New Html Field On Add/Update Product Form?

How To Add/Update Value Of Custom Added Html Field Into Product Meta?

DOKAN is no doubt the best front end multi-vendor marketplace on WordPress, powered by WooCommerce.Dokan is the fastest way to start eCommerce and earn through commissions with products ranging from digital, physical to variable products.

Adding/Updating Html Field And Adding/Updating them to meta field is 4 Steps Process:-

  1. Adding Html To Product Adding Form.
  2. Save Value Of Newly Added Field To Product Meta.
  3. Adding Html To Product Updating Form.
  4. Update Value Of Newly Added Field To Product Meta.

Adding Html To Product Adding Form

We can Use “dokan_new_product_after_product_tags” Hook for adding Html Tags For New Field.

function AddExtraProductFieldHtml(){	
  echo "<div class="dokan-form-group">
  <input type="text" class="dokan-form-control" name="specificity" placeholder="Specificity">
  </div>"; 
}
add_action ('dokan_new_product_after_product_tags','AddExtraProductFieldHtml',99);

Save Value Of Newly Added Field To Product Meta.

We can Use “dokan_new_product_added” Hook for saving value of new field to product meta.

function AddExtraProductMeta($product_id, $post_data){	
    add_post_meta( $product_id,'specificity',$_POST['specificity']);
}
add_action ('dokan_new_product_added','AddExtraProductMeta',11,2);

Adding Html To Product Updating Form.

We can Use “dokan_product_edit_after_product_tags” Hook for adding Html in product edit form.

function UpdateExtraProductFieldHtml($post, $post_id){
$specificityvalue  = get_post_meta( $post_id,'specificity', true );	
  echo "<div class="dokan-form-group">
  <input type="text" class="dokan-form-control" value="'.$specificityvalue .'" name="specificity" placeholder="Specificity">
  </div>"; 
}
add_action ('dokan_product_edit_after_product_tags','UpdateExtraProductFieldHtml',10,2);

Update Value Of Newly Added Field To Product Meta.

We can Use “dokan_product_updated” Hook for updating value of new field in product meta.

function UpdateExtraProductMeta($product_id, $post_data){	
    update_post_meta( $product_id,'specificity',$_POST['specificity']);
}
add_action ('dokan_product_updated','UpdateExtraProductMeta',11,2);

Shiv kumawat

Executive Director & CEO

"Shiv kumawat is the Executive Director and CEO of Eoxys It Solution LLP and the strategic mind behind the company"s growth. His expertise in operational efficiency and team leadership empowers his colleagues to excel and innovate.”

Latest Posts

AI in Healthcare USA Transforming Patient Care and Operations in 2025

  AI in Healthcare USA: Transforming Patient Care and Operations in 2025 The Rise of AI in Healthcare Across the…

sakshi
August 7, 2025

AI in Restaurants: How Artificial Intelligence Is Revolutionizing the Food Service Industry

  AI in Restaurants: How Artificial Intelligence IsRevolutionizing the Food Service Industry Introduction: The Digital Transformation of Dining Restaurants around…

sakshi
August 6, 2025

Artificial Intelligence in Mobile App Development: The Complete 2025 Guide

  Artificial Intelligence in Mobile App Development:The Complete 2025 Guide Introduction: Why AI is Now Central to Mobile App Innovation…

sakshi
August 6, 2025
, , , ,

Leave a Reply

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