Hi fellow Lemons,
This store is based on the Simplicity theme with both a credit card (Eway Australia) and direct deposit custom payment method. I was adding a new order route for bank deposit payments so I could send the buyer a different thank you email that included bank account details etc.
When I tested though I notice the order is created immediately when I hit the payment method page and by default selects the "New" order route despite what payment method I actually select, the result being I can never get the order to take the "Direct" bank deposit route.
Any ideas
TIA
Dave
Page 1 of 1
Order created on load of payment method page
#2
Posted 21 December 2011 - 04:27 PM
Hi Dave,
You are right, the order is created on the order preview step, and on the Pay page you already have an existing order. You can try to solve your problem with a custom AJAX handler. In the standard implementation, when you select a payment method, the standard shop:on_updatePaymentMethod handler is called. You can create a custom AJAX handler (right on the Pay page) and call it instead of the standard one. Inside the handler you should first call the standard handler:
After that you can check whether the selected payment method is your custom method and update the order status if needed. You can access the current order with $controller->data['order'] and current payment method with $controller->data['payment_method'] (I didn't check it). To update the order status:
Another thread which could be helpful for you: http://forum.lemonst...-bank-transfer/
I hope this helps.
Thanks
You are right, the order is created on the order preview step, and on the Pay page you already have an existing order. You can try to solve your problem with a custom AJAX handler. In the standard implementation, when you select a payment method, the standard shop:on_updatePaymentMethod handler is called. You can create a custom AJAX handler (right on the Pay page) and call it instead of the standard one. Inside the handler you should first call the standard handler:
$controller->exec_action_handler('shop:on_updatePaymentMethod');After that you can check whether the selected payment method is your custom method and update the order status if needed. You can access the current order with $controller->data['order'] and current payment method with $controller->data['payment_method'] (I didn't check it). To update the order status:
$status = Shop_OrderStatus::get_by_code('your-status-api-code');
Shop_OrderStatusLog::create_record($status->id, $order);Another thread which could be helpful for you: http://forum.lemonst...-bank-transfer/
I hope this helps.
Thanks
Share this topic:
Page 1 of 1

Help












