php - Post meta fields are correctly updating for woocommerce custom fields but same was not showing in product page

I am strugling from 2 days to sort out the issue but unable to do so.. i am trying to customize woocommerce gift card plugin and make it editable on vendor page using dokan plugin. Everything is working fine. Post meta is updating accurately as desired but postmeta values are not working on product page. is it any issue relaing to woocommerce? or we need specific action for woocommerce in order to make it work? Here is thepost_meta
which is saving on database:
a:6:{s:13:"default_price";i:0;s:4:"type";s:19:"mwb_wgm_range_price";s:8:"template";i:4751;s:14:"by_default_tem";b:1;s:4:"from";s:1:"1";s:2:"to";s:1:"3";}
i am using below action to save post_meta values:
add_action( 'dokan_new_product_added','save_add_product_meta2', 10, 2 );
add_action( 'dokan_product_updated', 'save_add_product_meta2', 10, 2 );
function save_add_product_meta2($product_id, $postdata){
if ( ! dokan_is_user_seller( get_current_user_id() ) ) {
return;
}
if ( ! empty( $postdata['new_field_4'] ) ) {
update_post_meta( $product_id, 'new_field_4', $postdata['new_field_4'] );
}
}
Any help is highly appreciated.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: method illuminate\database\eloquent\collection::paginate does not exist.
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.