Automatically confirm an order

  • Posts: 38
  • Thank you received: 2
  • Hikamarket Multivendor Hikashop Business
3 years 7 months ago #331859

-- HikaShop version -- : 4.3.0
-- Joomla version -- : 3.9.20
-- PHP version -- : 7.4
-- Browser(s) name and version -- : Google Chrome 89.0.4389.128

Dear developers,

My question is that is there any way to automatically confirm an order if the selected shipping method was "Pickup at our store" ? Also we would like to notify the customer in that confirmation e-mail that they can get their items instantly after they received that e-mail. Is there any way to do this?

Thanks for your help in advance,
Regards,
FRIK

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
3 years 7 months ago #331862

Hi,

Yes.
You need to do 2 things:
- edit your existing payment methods and use the "shipping methods" setting to select all the shipping methods besides the "pickup at our store" one.
- create a new payment method of the type "collect on delivery" and in its "shipping methods" setting, select that "pickup at our store" shipping method. Then, in the settings of that payment method, you can set the "order status" to "confirmed" and activate the "Order status notification" setting. That way, the orders with that payment method will get confirmed automatically and the order status notification email will be sent to the customer automatically too.

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

  • Posts: 38
  • Thank you received: 2
  • Hikamarket Multivendor Hikashop Business
3 years 7 months ago #331968

Thank you Nicolas, it worked fine!

One more question: Can I add a delay to the outgoing confirmation e-mail? Customers receive instantly the creation and confirmation e-mails and that can be a little confusing for them that we have already confirmed their purchase in seconds.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
3 years 7 months ago #331969

Hi,

I see two ways to do it:
- in the System>Emails menu, you can edit the "order status notification" email which is sent to the customer when an order is confirmed. And in it, you can use the PHP sleep function to stop the processing of the page for a while ( www.php.net/manual/en/function.sleep.php ).
So technically, it is possible.
However, there are several limitations to that:
1. you will hit the "max execution time" limit of your php.ini (which is 60 seconds by default).
2. the page which will send the email will be postponed too so the user will see the end page take a lot of time to display.

- An alternative would be to create an extra order status (via the System>Order statuses) and use that order status in the "collect on develiery" payment method setting and turn off the user notification there. Then, in System>Mass actions, you could create a mass action with a trigger "every hour" with a filter on the order_status column being equal to that new order status and an action "change the order status" to "confirmed" with the user notification checkbox checked. You also need to make sure that your cron task is setup: www.hikashop.com/support/documentation/5...ashop-cron-task.html
That way, the user won't be notified directly. And every hour, the mass action will check the orders in that order status and automatically change the order status of these orders to "confirmed" and send the email to the user.
Alternatively, if you have control on the email sending server, you could configure a rule to delay the sending of such emails.

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

Time to create page: 0.059 seconds
Powered by Kunena Forum