Mass action is not executed

  • Posts: 108
  • Thank you received: 0
  • Hikashop Essential
3 months 4 days ago #329183

-- url of the page with the problem -- : www.portal-gestao.com
-- HikaShop version -- : 4.4.0
-- Joomla version -- : 3.9.24
-- PHP version -- : 7.3.26
-- Browser(s) name and version -- : Firefox
-- Error-message(debug-mod must be tuned on) -- : Mass action is not executed

Hello,

I'm trying to create a mass action that runs every day and checks if the field order_product_height is today.

If it is, then it checks if the product_id = 73.

With these conditions, I want to remove the user from a user group.

This action isn't happening.

I've built the action as per attachment, and just to check if the filters were working I've set an additional email message. This email is sent, but not the removal of the user group.

Also, I have another mass action that adds users to groups that is working, so why isn't this one?

Thanks!

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 72763
  • Thank you received: 11096
  • MODERATOR
3 months 3 days ago #329210

Hi,

Well, first you need to check that your cron task is running:
www.hikashop.com/support/documentation/5...cron-task.html#check
Otherwise, the "every day" trigger won't work.
Then, you need to check that the value you have in order_product_height has the same format as what is returned by the curdate mysql function.
Also, note that the access level modification might have been done, but the user might have to logout / login to see the change as the access levels of the current user are cached in the user session data by Joomla.

Please Log in or Create an account to join the conversation.

  • Posts: 108
  • Thank you received: 0
  • Hikashop Essential
3 months 3 days ago #329223

Hello Nicolas,

The crons are working no doubt, we have other mass actions.

In the attachment, you may see an example:
1- The value of order_product_height is today: 20210208.000
2- The product_id is 73
3- The user has not been removed from the group we want to remove him.

We have another mass action to add users to groups like this one and it is working.

Attachments:
Last edit: 3 months 3 days ago by nunonog.

Please Log in or Create an account to join the conversation.

  • Posts: 72763
  • Thank you received: 11096
  • MODERATOR
3 months 3 days ago #329226

Hi,

Your problem is with the order_product_height condition.
The value returned by the curdate function is with the format "YYYY-MM-DD" :
www.w3schools.com/sql/func_mysql_curdate.asp
So it's not compatible with what it stored in that custom field.
You need to use date_format in order to generate a date in the same format as stored in that column :
www.tutorialspoint.com/change-the-curdat...0use%20date_format() .
And here you'll find the possible things you can use for the format:
www.w3schools.com/sql/func_mysql_date_format.asp

Please Log in or Create an account to join the conversation.

  • Posts: 108
  • Thank you received: 0
  • Hikashop Essential
3 months 2 days ago #329326

Hi,

Now I have 2 mass actions:
1- To add users to a group when they buy product 73 and when the order is confirmed. This adds 62 days to the current date to order_product_height with:
DATE_FORMAT(DATE_ADD(CURDATE() , INTERVAL 62 DAY), "%Y%m%d")
In order_product_heigh I have:
20210412.000
And it adds the user to the product group.
So this one is working fine.

2- To remove the users from the group 62 days later. For this I check if order_product_height is today with:
DATE_FORMAT(CURDATE(), "%Y%m%d")
You may see the details in the attachment.
HERE IS THE PROBLEM: This cron removes the WRONG users to the group. So I'm guessing it is not considering BOTH conditions: product = 73 AND order_product_height is today.

Is this a bug or am I doing anything wrong?
PS: I'm just trying to impelment a subscriptions based system, since there isn't one in Hikashop.

Attachments:
Last edit: 3 months 2 days ago by nunonog.

Please Log in or Create an account to join the conversation.

  • Posts: 72763
  • Thank you received: 11096
  • MODERATOR
3 months 1 day ago #329342

Hi,

It is an "AND". However, note that the elements searched on are orders, not order products.
So as long as an order has a product with the id 73 and a product with the correct order_product_height, it will match, even if the conditions are only met for different products of the same order.

Also, if you're trying to have a subscription system, you don't need to do all that.
You can just use HikaSubscription which we made especially for that:
www.hikashop.com/component/hikashop/prod...ikasubscription.html
I would rather recommend to use this instead of trying to create mass actions. It will be easier and much more stable going forward.

Please Log in or Create an account to join the conversation.

  • Posts: 108
  • Thank you received: 0
  • Hikashop Essential
3 months 1 day ago #329351

Hello,
That cannot be correct, because I only have one order with order_product_height and the trigger is removing users from other orders.
Also, in the "Filters" section it says: "order product columns".

The HikaSubscription is more expensive than the whole Hikashop!
Is this a one-time or recurring payment?

Please Log in or Create an account to join the conversation.

  • Posts: 3175
  • Thank you received: 418
  • MODERATOR
3 months 23 hours ago #329360

Hello,

We will try to process in another way, can you provide through our Contact us form some backend access in order to process ourselves somes test on your MassActions ?
Don't forget to add an Url link to this topic in your message.

Also, what do you mean on this question, we aren't sure to understand, here :
"Is this a one-time or recurring payment?"

Awaiting your returns to progress on your subject.
Regards

Last edit: 3 months 1 day ago by Philip.
The following user(s) said Thank You: nunonog

Please Log in or Create an account to join the conversation.

  • Posts: 108
  • Thank you received: 0
  • Hikashop Essential
3 months 13 hours ago #329431

Hi,

I found HikaSubscription price a bit too highh, therefore I'm asking if this is something we pay once or have to keep paying every year.

Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 3175
  • Thank you received: 418
  • MODERATOR
2 months 4 weeks ago #329439

Hello,

You purchase one time HikaSubscription (and enjoy one year of help and unlimited help) but you don't have to upgrade (and so purchase it each year).
Now, if some update have to be done to your website as Joomla, HikaShop or Php maybe you will have to use the last HikaSubscription versions, but we aren't be able to tell you when in the future, you will have to update.

We have find the issue in your MassAction, unfortunatelly in your Filter you have this :
order_product_height = DATE_FORMAT(CURDATE(), "%Y%m%d")

The design of a MassAction can't process an "operation" in your searching value, here, DATE_FORMAT(CURDATE(), "%Y%m%d"), this will only search and compare found value in your DataBase.

So far we didn't see how you can search a dynamic value without some development or use HikaSubscription.

regards

Last edit: 3 months 9 hours ago by Philip.

Please Log in or Create an account to join the conversation.

  • Posts: 108
  • Thank you received: 0
  • Hikashop Essential
2 months 4 weeks ago #329537

:(
expected more from mass actions, there doesn't seem to be much development in Hika products taking place, is it?
Anyway, how about a coupon? I'm a long time Hikashop/AcyMailing subscriber.

Please Log in or Create an account to join the conversation.

  • Posts: 72763
  • Thank you received: 11096
  • MODERATOR
2 months 3 weeks ago #329565

Hi,

HikaSerial / HikaSubscription is quite mature. Extra features are mainly about developping new plugins for it.
In fact, a big new release is currently in the works to add Joomla 4 support like we did for HikaShop with the 4.4.0 and the 4.4.1 (that was released a few days ago).

We cannot provide a coupon code for the purchase of HikaSerial / HikaSubscription.

Please Log in or Create an account to join the conversation.

Time to create page: 0.082 seconds
Powered by Kunena Forum