how to disable shop function *after* order?

  • Posts: 13201
  • Thank you received: 2322
9 years 1 week ago #221327

Hi,

My bad, I don't know wahat I was thinking about, this new version should work correctly:

File Attachment:

File Name: plg_hikash...1-20.zip
File Size:10 KB


ps: you have to do the tests in frontend.

Attachments:
Last edit: 9 years 1 week ago by Xavier.

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

  • Posts: 79
  • Thank you received: 0
9 years 1 week ago #221436

Hi Xavier,
I've tested a lot...

it's only working when there is no payment method involved.
in my shop there are 4 payment methods but most orders will be managed *without* a payment method (because final price = 0).

I see the logout only works when there's no-payment. It doesn't work for the 4 payment methods.

I would like to see a forced loguit and a redirect to a public page for each order, regardless of the payment method.

another new problem:
now when i place a product in the cart I'm redirected to the checkout process. It ignores my configuration that says "stay on page and show a popup". This used to work before....

Last edit: 9 years 1 week ago by proo4509.

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

  • Posts: 79
  • Thank you received: 0
9 years 6 days ago #221517

Hello Xavier,
I thinks it is now clear why this is all not working

The massaction is not triggered directly after an order because the run thru the cron job settings (I didn't know that).

Now, I have 2 massactions that need to perform a task at the final step of an order (=directly! no delay). They must change the ACL of the user and logout the user so he can not shop again.
The problem is it is only running once every 15 minutes and not directly. When I try to edit the cron job, the shortest/smallest frequency is once every 15 minutes. So, this must be the problem. I've set the minimum waiting time between two cron jobs to 1 second, but this is ignored. It runs every 15 minutes.
They must run directly after each order.

Best would be to perform all actions in the last step of the checkout proces in the after_end.php page:

1) remove user from ACL group shopper
2) place user in ACL group "reeds geshopt"
3) remove user from the price_access_level groups (there are 2, every user is in one of them)
4) redirect to thankyou page
5) logout the user

Would ths work and how would I do this?

regards

suzanne

Last edit: 9 years 6 days ago by proo4509.

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

  • Posts: 79
  • Thank you received: 0
9 years 6 days ago #221595

Hello Xavier,

I solved it by migrating the cron job to my own server. It runs now every minute and I think this is workable.
I removed the user logout php code in your last massaction order version and replaced it with a user session refresh code.
Now, without logging out and in the acl changes are applied.

So, this is ok now.

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

  • Posts: 13201
  • Thank you received: 2322
9 years 5 days ago #221532

Hi,

Please give us a screenshot of your mass action settings.
I was thinking that you were triggering on "onAfterOrderCreate()", so if it is not the case, you have to trigger on this.

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

  • Posts: 79
  • Thank you received: 0
9 years 5 days ago #221625

No
i was struggling with this. I don't use "create", because the status of the order is changed in the payment methods (one changed to 'bevestigd', the other is changed to 'bijbetalen'), so I think I shouldn't use 'create' but 'changed' because the payment methods come first in the process, not?
And... as it is working now I think this is right.

I have a total of 3 different order massaction jobs. 2 for changing acl after order (runs every minute) and 1 for export order (for daily bulk export and change order status to 'verzonden').

No I have the change-acl finally working! And with the user session refresh the ACL change is even applied without logout.

But, the export order is stil not working (for this we have another thread in the forum).

regards

Suzanne

Attachments:

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

  • Posts: 13201
  • Thank you received: 2322
9 years 5 days ago #221631

Hi,

Yes indeed the "onAfterOrderCreate" is not adapted in your case, but maybe the "onAfterOrderUpdate" one can work.
If you select a filter on the desired order status, that can do the job. The cron solution every minutes is a correct solution too.

Let's continue on the other thread for the order export.

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

Time to create page: 0.077 seconds
Powered by Kunena Forum