How can we make a restriction on system that If an order is coming through 1 click but, its status should not be able to change to any other status unless the payment method is selected by the admin for that order?
Hello.
Maybe this addon will meet your expectations?
https://marketplace.cs-cart.com/add-ons/site-management/payment-order-status.html
Best regards
Robert.
Since this is an ajax call, a post controller will not work. But you can use the ‘change_order_status’ PHP hook to apply whatever logic you want to the changing of order statuses. I.e.
function fn_my_changes_change_order_status(&$to, $from, &$order_info, &$force_notifiation, &$order_statuses, $place_order) {NOT TESTED
if( AREA == ‘A’ && !$place_order ) {
$requires_shipping_to_change = array(‘O’);
if( in_array($from, $requires_shipping_to_change) && empty($order_info[‘payment_id’]) ) {
$to = $from;
fn_set_notification(“E”, __(“error”), “Can’t change status until payment method set”, ‘K’)l
return;
}
}
}