- Posts: 176
- Thank you received: 5
Mass Actions triggering at different times
-- Joomla version -- : 3.4.8
I have a weekly mass action that is set to occur at 7am on Fridays. This last week (March 4th) it occurred at 10:02am. Any idea why this would happen? Nothing has changed in the configuration.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
It could happen if the last time, the cron task was delayed. For example, if there was a problem on the server on our end triggering your cron task, or your server not responding or not being accessible at that time (for example, if you put it in maintenance).
Please Log in or Create an account to join the conversation.
The latest one that failed was this morning at 7:00 am. Our weekly mass actions are set to occur at 7:00am on Friday each week. The massaction_last_trigger_weeks value as of this morning was 1460721600 (7:00am CST 4/15). At 7:10 I ended up having to manually process the mass action.
Here is a log of the past weeks:
3/28 - successfully triggered by cron but at wrong time (18:42) manually reset massaction_last_trigger_weeks
4/1 - successfully triggered by cron at correct time (14:00)
4/8 - cron trigger failed, manually processed (14:59)
4/15 - cron trigger failed, manually processed (14:38)
(updated timezone in Joomla config to Chicago time)
4/22 - cron trigger failed, manually processed (7:08)
Any idea why this is happening?
Please Log in or Create an account to join the conversation.
On our end the cron task for your website is successfully triggering every hour.
Could you check that your cron task is properly configured:
www.hikashop.com/support/documentation/5...cron-task.html#check
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
It is now 1461329885 (7:58 am 4/22 Friday CT)
I've manually changed it to 1461326400 again.
What is causing it to change on it's own? Having it 'slip' like this is causing all sorts of reporting issues.
Please Log in or Create an account to join the conversation.
And the system will trigger them again when the cron is called after that time + 2 weeks.
But the cron won't be called at that time + 2 weeks at the same second. It might be off by several seconds or minutes (because our server is not triggering only your website and so your cron call is called with a small delay each time.
If you want a precise cron, the best is to configure it on your own server:
www.hikashop.com/support/documentation/5...ron-task.html#server
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
If your cron task is triggered precisely, the delay will be: time to run the mass action + (cron task trigger frequency)
So if you configure your server cron task to run each minute, the maximum delay between two weeks will be 2 minutes and it can be close to 0.
After 1 year, you might have a 1 hour delay, which I suppose is acceptable.
Please Log in or Create an account to join the conversation.
Just to recap, mass actions on a time-based trigger need to be set up as a corn task on the HikaShop website?
I'm just trying to figure out why my mass action is not going off .
also, how would I set up the filtering so that only orders placed during the last day are exported? I've set up all of the other settings but want to make sure that the reports I'm trying to get aren't overlapping data.
Please Log in or Create an account to join the conversation.
1. If your mass action is not going off, it's either that its settings are wrong, or that your cron task is not configured properly.
Here is the procedure to check your cron task: www.hikashop.com/support/documentation/5...cron-task.html#check
If that doesn't help, please provide a screenshot of your mass action settings.
2. You can use a filter on the column "order_created" being >= to {time}-86400
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
I don't see what could be done to avoid that.
The system isn't meant to be able to handle that in the first place.
It would require different triggers that would work not with a last triggered timestamp but with a fixed date and time you could set for the trigger, but the mass action system doesn't even allow settings for triggers so it would require changing the trigger system of the mass actions to support that.
Now you can always develop your own little hikashop plugin implementing the triggers of the mass action system to add your own trigger and handle it the way you want by taking as an example the system massaction and the hikashop massaction_order plugins.
Please Log in or Create an account to join the conversation.
Triggers:
Every weeks
Filters:
Order status = payment confirmed
order_product_code = REGEXP ^V...$ (All the product codes are formatted the same: Start with a 'V' and are 4 characters long. E.g. V100, V200, V300, etc.)
order_created >= {time}-619200 (Which is 1 week + 4 hours)
Actions:
Export csv file
Email the csv file
Change status to 'shipped'
Every time the weekly 'slip' gets close to 1hr I manually set it back.
This leaves around a 1hr window in which orders used to slip through the cracks. However, by setting the time to minus 1 week + 4hrs this gap is closed (and gives me a little slack). Since the filter only includes orders that have the 'payment confirmed' and the massaction updates the orders to 'shipped' when it runs I don't have to worry about it grabbing any incorrect orders.
However, the csv file is very cumbersome. If a single order contains more than one of the ^V...$ items (E.g. V100x1, V200x1) it includes duplicate rows for the order. Is there any way to have the csv only include one line per order?
Please Log in or Create an account to join the conversation.
If you don't have any filter on the order_product table columns, then you should only have one line per order. You get one line per order per product because you have that filter.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Would it be easier to customize the reports section? I'm seeing 2 options to get us where we need to be:
Option 1:
Develop a plugin (or build the option into the core extension) to simply collapse the duplicate rows in our existing massaction reports (what we have been discussing). If we can accomplish this quickly it represents the simplest path to our goals.
Option 2:
The Reports in Hikashop allow us to grab what we need. However, it lacks any automation and the exported csv documents have so much extra information in them that they are next to useless.
Here are the features we would need to customize the reports:
1) Ability to pick and choose the columns exported in the csv
2) Ability to schedule these exported csv to be sent via email at a set interval (weekly)
3) Ability to update order status when the report runs (change 'payment recieved' to 'shipped' etc.)
4) Ability to print reports (would only apply to reports with charts and would export as a pdf)
#4 is a bonus item. Not critical. 1-3 would be necessary.
If you and your team are willing to develop either option1 or 2 let me know.
Please Log in or Create an account to join the conversation.
The Orders>Reports menu CSV download funfction only contains the the columns relative to the report display so it would be complex adding more columns to it.
The CSV export on the orders listing is meant as a simple one click button. I don't see the point in adding a pick and choose column setting there since in that case, you can do it with a mass action.
Exporting a CSV and sending it by email at a "relative" fixed interval and changing the status while doing it is possible with the mass action system too.
So the points 1 to 3 are already met by what's there. So that means that you don't say everything you need for your CSV export & email function (like for example a filter on the product codes without the having one row per product, etc).
I would actually recommend going a third option:
Having a custom script being built for you which would load the data from the database, generate the CSV exactly like you want with the filters you want directly in the script and the format you need, etc, send it by email and update the order status. You could run such script really precisely, at the same second every week with your own server cron task.
The cost of developing such custom script would be similar to the cost of modifying HikaShop systems to handle your very precise needs, and it could be done by any PHP developer as long as you provide a precise information on what the CSV should contain and what your database looks like.
Please Log in or Create an account to join the conversation.