- Posts: 21
- Thank you received: 0
Mass Action Documentation
I have a mass actions that needs to run at the start of each month. How do I trigger it?
a) Is a cron job necessary to trigger the mass actions? (The documentation on mass action does not mention cron jobs. The documentation on cron jobs does not mention mass actions).
b) When I set trigger to "every months", when will it actually run? How do I ensure it does not run the current month, but only next month?
c) Can I set a timed trigger, e.g. 10 p.m. on May 31st (an accuracy of about one hour +/- would be sufficient)
d) Can I set a date validation, e.g. "do not run before June 1st" in case it is triggered to early?
Thanks for your help (and eventually updating the documentation in this regard).
Best
Gunnar
Please Log in or Create an account to join the conversation.
a) yes, the configuration of the cron is necessary if you want to use periodic triggers.
b) If the cron is configured, it will run once a month. In the hikashop_config table there is a namekey massaction_last_trigger_months which will contain a timestamp of the last time the mass actions for "every month" were triggered. Next trigger for them will be a month after that (actually 30 days).
c) There is no such system in place. It would require a custom plugin.
d) There is no such system in place. It would require a custom plugin.
I'll see with Xavier to improve the documentation on the mass actions and see if some of the things you're talking about could make sense in the general system of the mass actions.
Please Log in or Create an account to join the conversation.
As my hosting package does not include cron jobs, I could use your service (thank you for that option). That would run at least every hour, hence 24*7*30 = 5040 times instead of once, which would be a bit overkill.
c) and d) could be replaced by a dynamic date functionality, you may consider also:
Filter: product_sale_start >= today (or now).
Currently this is a manually entered date.
Please Log in or Create an account to join the conversation.
Regarding the cron per months, in the mass action settings you can set the trigger on "Months".
Then in the cron settings, you have to enter a value in minutes for the cron period, so in that field you can set "1440" to execute the cron every days.
This way it will be called 30 times instead of once. which is reasonable.
For c) and d) that feature we will see to add that on our Todo list
But at this time if you set the cron on everyday, so you can set a filter in the mass actions to restrict the date interval.
The value to use for this case is: {time}-86400 where "86400" is a value in seconds.
In order to call the cron at a specific hour, you can change the "cron_next" and "cron_last" values in the #__hikashop_config table via phpMyAdmin.
Please Log in or Create an account to join the conversation.
- Posts: 112
- Thank you received: 3
"For now only the automatic update of rates requires a Cron task. However, the cron task will be used more extensively in the future to provide features like notification of start of sales, orders status automatic changes, etc."
But, I need to have a daily report run automatically. Can you provide specific instructions for how to set this up? Hopefully, it does not involve your users to use PHP to make it work.
Please Log in or Create an account to join the conversation.
In the mass actions, you can set trigger on every days directly.
If you set up the cron in Configuration > Cron so the mass action will be triggered every days.
No need of PHP.
Please Log in or Create an account to join the conversation.
- Posts: 112
- Thank you received: 3
Mass Actions:
• I set the mass action to hourly for testing purposes. See mass actions.jpg
cron
• I have set cron to the quickest frequency which is every 15 minutes. When I save this setting, I get an error that I do not understand. See cron setup page 2.
• The first page I see when I go to your cron page is set up as shown in cron page 1.
Please let me know what I am doing wrong.
Tom
Please Log in or Create an account to join the conversation.
If the action is not launched, so this seems to be due to the cron error you have.
Is the url in the cron settings the one attached to your account on our website ?
hikashop.com/my-account/your-subscriptions.html
Please check if it is set in "http" or "https".
www.hikashop.com/support/support/documen...ashop-cron-task.html
Please Log in or Create an account to join the conversation.
- Posts: 112
- Thank you received: 3
With that said, cron appears to be working now. However, when it triggers the Mass action that should be sending a CSV file, it sends the email notification and not the CSV file that should be included in the email. The CSV file is not created in the /tmp folder.
The action works correctly when I manually "Process" the action. I know the CSV file will not be generated or sent if the data is empty. But, there is data that should be sent in the CSV file. When the action is triggered manually, the CSV file is created in the /tmp folder and it is sent in the email notification.
Please Log in or Create an account to join the conversation.
Do you have other mass actions which could be interacting with this one ?
I mean other that are triggered at the same time ?
If it is I just edited you massaction class in order to solve this issue.
Please do a test and tell me if that solve the issue.
Please Log in or Create an account to join the conversation.
- Posts: 112
- Thank you received: 3
Please Log in or Create an account to join the conversation.
- Posts: 112
- Thank you received: 3
Please Log in or Create an account to join the conversation.
- Posts: 112
- Thank you received: 3
While the action is triggered and an email is sent saying the css file was sent, the css file is not created and is not sent with the email. This is when cron is used to trigger the task. When the task is activated manually, the entire process works properly and the css file is sent with the email.
Please Log in or Create an account to join the conversation.
Is that issue happening with the "Export a csv file" action too or only with the custom action "custom_csv_export" ?
I have added a debug in the custom action, so this will write content in the file "/tmp/dbg.txt" to help me to debug.
Could you try too to change the value of the option "embed_files" in Configuration > Main > Emails ?
Please Log in or Create an account to join the conversation.
- Posts: 112
- Thank you received: 3
Please Log in or Create an account to join the conversation.
- Posts: 112
- Thank you received: 3
Please Log in or Create an account to join the conversation.
Please give me the name of the action having the issue, I will do a complete debug on your website.
For the moment, I think that the file is not generated so nothing in the email because there is no data get.
No elements to export, so if there is no elements, no reason to create the file.
Now, the question is, why it does not get any elements ? maybe due to the filter based on the {time}...
Please Log in or Create an account to join the conversation.
- Posts: 112
- Thank you received: 3
Please Log in or Create an account to join the conversation.
There was an issue based on the generation of the paths, the server and web one, some times there was a missing "/" or "\".
So this should be solved with the new modifications I have done on your website.
Please keep us informed.
Please Log in or Create an account to join the conversation.
- Posts: 112
- Thank you received: 3
Please Log in or Create an account to join the conversation.