Hi Shane,
The code you provided works fine.
The problem must be in the Barn2 Product Table plugin.
I will ask support from Barn2 to solve that issue.
Many thanks for your support, guidance and patience.
Regards,
Loek
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Loek,
Happy I was able to assist.
In this case you can go ahead and mark this ticket as resolved.
Thanks,
Shane
Hi Shane,
I have checked Barn2 for this issue.
The asked me to check with you why the regular price is not visible on the product page. That should be the problem according to them.
Hereby the screen print.
Thanks in advance for your help.
Regards,
Loek
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Loek,
I'm assuming here that you're referring to the 0303CC test product. As the second product on your page does have the regular price set and is displaying on the frontend.
Please let me know.
Thanks,
Shane
Hi Shane,
Indeed it’s the test product.
Thx,
Loek
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Loek,
I need to test the entire code itself as it doesn't appear that the field data for the price is being set by the function.
Can you let me know the page that contains the form to create the product ?
Thanks,
Shane
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Loek,
This should now be working.
I've made some adjustments to the code. Here is the updated code below.
function func_custom_update_product_regular_price($post_id, $form_data) {
// if a specific form
if ($form_data['id']==15) {
update_post_meta($post_id,'_regular_price', 50);
update_post_meta($post_id,'_price', 50);
}
}
add_action('cred_save_data', 'func_custom_update_product_regular_price', 10, 2);
Hi Shane,
You have solved the problem.
Ticket can be closed.
Thanks a lot for all your help!
Regards,
Loek