I checked this topic => here
I did what did you write. Added following codes to add-product.php
$WCMp->wcmp_frontend_fields->wcmp_generate_form_field(apply_filters('wcmp_fpm_fields_general', array("title" => array('label' => __('Title', 'dc-woocommerce-multi-vendor'), 'type' => 'text', 'class' => 'regular-text pro_ele simple variable external grouped', 'label_class' => 'pro_title pro_ele simple variable external grouped', 'value' => $title),
"sku" => array('label' => __('SKU', 'dc-woocommerce-multi-vendor'), 'type' => $vendor_show_sku, 'class' => (apply_filters("product_sku_hide",false)) ? 'regular-text pro_ele simple variable external grouped vendor_hidden non-booking non-accommodation-booking non-redq_rental' : 'regular-text pro_ele simple variable external grouped non-booking non-accommodation-booking non-redq_rental', 'label_class' => (apply_filters("product_sku_hide",false)) ? 'pro_title vendor_hidden simple variable external grouped non-booking non-accommodation-booking non-redq_rental' : 'pro_title simple variable external grouped non-booking non-accommodation-booking non-redq_rental', 'value' => $sku, 'hints' => __('SKU refers to a Stock-keeping unit, a unique identifier for each distinct product and service that can be purchased.', 'dc-woocommerce-multi-vendor')),
"regular_price" => array('label' => __('Price', 'dc-woocommerce-multi-vendor') . '(' . get_woocommerce_currency_symbol() . ')', 'type' => 'text', 'wrapper_class' =>'pro_ele simple external non-grouped non-booking non-accommodation-booking non-subscription non-variable non-variable-subscription non-redq_rental non-auction','class' => 'regular-text simple external non-grouped non-booking non-accommodation-booking non-subscription non-variable non-variable-subscription non-redq_rental non-auction', 'label_class' => 'pro_ele pro_title simple external non-grouped non-booking non-accommodation-booking non-subscription non-variable non-variable-subscription non-redq_rental non-auction', 'value' => $regular_price),
"sale_price" => array('label' => __('Sale Price', 'dc-woocommerce-multi-vendor') . '(' . get_woocommerce_currency_symbol() . ')', 'type' => 'text', 'wrapper_class' =>'pro_ele simple external non-grouped non-booking non-accommodation-booking non-variable non-variable-subscription non-redq_rental non-auction','class' => 'regular-text simple external non-grouped non-booking non-accommodation-booking non-variable non-variable-subscription non-redq_rental non-auction', 'label_class' => 'pro_ele pro_title simple external non-grouped non-booking non-accommodation-booking non-variable non-variable-subscription non-redq_rental non-auction', 'value' => $sale_price),
"sale_date_from" => array('label' => __('Sale Date From', 'dc-woocommerce-multi-vendor'), 'type' => 'text', 'placeholder' => __('From... YYYY-MM-DD', 'dc-woocommerce-multi-vendor'), 'wrapper_class' => 'pro_ele simple external non-grouped non-booking non-accommodation-booking non-variable non-variable-subscription non-redq_rental non-auction','class' => 'regular-text simple external non-grouped non-booking non-accommodation-booking non-variable non-variable-subscription non-redq_rental non-auction', 'label_class' => 'pro_ele pro_title simple external non-grouped non-accommodation-booking non-booking non-variable non-variable-subscription non-redq_rental non-auction', 'value' => $sale_date_from),
"sale_date_upto" => array('label' => __('Sale Date Upto', 'dc-woocommerce-multi-vendor'), 'type' => 'text', 'placeholder' => __('To... YYYY-MM-DD', 'dc-woocommerce-multi-vendor'), 'wrapper_class' => 'pro_ele simple external non-grouped non-booking non-accommodation-booking non-variable non-variable-subscription non-redq_rental non-auction','class' => 'regular-text simple external non-grouped non-booking non-accommodation-booking non-variable non-variable-subscription non-redq_rental non-auction', 'label_class' => 'pro_ele pro_title simple external non-grouped non-accommodation-booking non-booking non-variable non-variable-subscription non-redq_rental non-auction', 'value' => $sale_date_upto),
"visibility" => array('label' => __('Visibility', 'dc-woocommerce-multi-vendor'), 'type' => 'select', 'options' => array('visible' => __('Catalog/Search', 'dc-woocommerce-multi-vendor'), 'catalog' => __('Catalog', 'dc-woocommerce-multi-vendor'), 'search' => __('Search', 'dc-woocommerce-multi-vendor'), 'hidden' => __('Hidden', 'dc-woocommerce-multi-vendor')), 'class' => 'regular-select pro_ele simple variable external grouped', 'label_class' => 'pro_ele pro_title simple variable external grouped', 'value' => $visibility, 'hints' => __('Choose where this product should be displayed in your catalog. The product will always be accessible directly.', 'dc-woocommerce-multi-vendor')),
"excerpt" => array('label' => __('Short Description', 'dc-woocommerce-multi-vendor'), 'type' => 'wpeditor', 'class' => 'regular-textarea pro_ele simple variable external grouped', 'label_class' => 'pro_title grouped', 'value' => $excerpt, 'settings' => $_wp_editor_settings),
"description" => array('label' => __('Description', 'dc-woocommerce-multi-vendor'), 'type' => 'wpeditor', 'class' => 'regular-textarea pro_ele simple variable external grouped', 'label_class' => 'pro_title grouped', 'value' => $description, 'settings' => $_wp_editor_settings),
"pro_id" => array('type' => 'hidden', 'value' => $product_id),
"dp_kargolanma_suresi" => array('label' => __('Kargolanma Suresi', 'dc-woocommerce-multi-vendor'), 'type' => 'text', 'class' => 'regular-text pro_ele simple variable external grouped', 'label_class' => 'pro_title pro_ele simple variable external grouped', 'value' => $dp_kargolanma_suresi)
), $product_id));
And added this to my theme functions.php
function vendor_change_kargo_tarihi($product_id, $form_data){
$current_post = get_post( $product_id);
$current_post-> dp_kargolama_suresi = $form_data['dp_kargolanma_suresi'];
wp_update_post($current_post);
}
add_action('after_wcmp_fpm_meta_save', 'vendor_change_kargo_tarihi', 10, 2);
I am getting right value on add-product.php with this code line
$dp_kargolanma_suresi = get_post_meta($product_id, 'dp_kargolanma_suresi', true);
Showing right value. If adding a new product it seems null and if it is a product update, it shows old value.
But when I sumbit anything change, saving product meta value doesn’t change
What is the wrong
:/
-
This reply was modified 6 years, 1 month ago by shopmaster.
-
This reply was modified 6 years, 1 month ago by shopmaster.