0

I have a product page and I wish to change the prices twice in a day automatically. I want it to repeat forever. So I have 2 options : schedule the page or the products. But I couldn’t find any plugin to do it or code (a plugin is better for me).

I tried asking the wordpress forum but there was no answer.

Please help me. Thank you!

closed as off-topic by fuxia Jan 24 at 9:25

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

2

Take a look at this page https://codex.wordpress.org/Function_Reference/wp_update_post . There is an example of how to update the post.

All you need is the post ID that you want to update, and some code to change certain text in the post.You will want to get the post's data (an array), then change the $post_content array item with some sort of process that searches for the price string you want to change and then adjusts it.

Once that is changed, set the $post_content array item to the new text (with your price change), and store the result. The example in the link above should get you pointed in the right direction.

Once you have the PHP file that does the process correctly (test it a lot!), then add that to the CRON.

Not the answer you're looking for? Browse other questions tagged or ask your own question.