Skip Navigation

[Resolved] Set regular price to default

This support ticket is created 2 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 24 replies, has 2 voices.

Last updated by Shane 2 years, 3 months ago.

Assisted by: Shane.

Author
Posts
#2437111

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

#2438181

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

#2439465
Screen Shot 08-17-22 at 11.28 AM.PNG

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

#2439613

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

#2439639

Hi Shane,

Indeed it’s the test product.

Thx,
Loek

#2439653

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

#2439713

Hi Shane,

It is Toevoegen Profiel.

Regards,
Loek

#2439803

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);
#2442453

Hi Shane,

You have solved the problem.
Ticket can be closed.
Thanks a lot for all your help!

Regards,
Loek

#2443477

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Marking as resolved.