ecartz wrote: ↑Fri Mar 15, 2024 1:33 am
One shipping module can offer multiple methods. For flat, there's only one method, so flat_flat. But you could have
ups_ground
ups_nextday
or similar. It's just that all the core shipping modules are simpler than that.
Thanks for all the clarifications as this makes most sense.
I do record the shipping module used in the orders table and also using this to disable certain payment options for example if you select courier option then my store would disable the in store payment module cod(brick building).
This way it would eliminate following up sending bank payment details and many more complications.
To expand on your multiple methods example ups_ground would it be as simple to add and change 'id' => $this->code, to 'id' => $service_code = $rate['service_level']['code'], in the following then i can assume we should get modulename_servicecode
Code: Select all
$serviceLevel = $rate['service_level']['name'];
$service_code = $rate['service_level']['code'];
$cost = $rate['rate']; // Total cost including VAT
$this->quotes['methods'][] = [
'id' => $this->code,
'title' => $serviceLevel . ' (' . $service_code . ')',
'cost' => number_format($cost, 2, '.', ''),
];