A
A
Alexander2019-02-06 13:43:07
Task Schedulers
Alexander, 2019-02-06 13:43:07

Is it possible to set a discount for a product via cron on Opencart 2.x?

Greetings!
How can I set a discount for a product via cron (or just by executing a php file) on Opencart 2?
The essence is this: on the main page of the site, several products with a random discount will be randomly displayed. The next day, other products will be displayed (for "yesterday's" discount will be removed). And so every day.
Any ideas for implementing this? How would you do this? How can it be implemented differently? Push a thought.
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2019-02-06
@Alexandros96

If it's cron and php, then they don't really need Opencart, per se. It's just that the php script is launched by the cron according to the schedule, it crawls into the database and changes some data. All. And this whole scheme doesn't care if it's Opencart or something else. The script only needs to know that there is a database (its name), it needs a password and a user to access it, a table, it has a line number and a column name in which to change the number.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question