here is my issue
This is the magento template that print the shipping methods. All my shipping methods are printed properly, but not sorted in the order I want.
Looks like they are sorted by price from cheapper to the most expensive.
On my side I would like to keep the order as defined in my owebia conf.
In checkout I can see the method id_003 coming before id_001 when i would like the opposite.
So my question is : From magento file how can I act on the rates() data to sort it as I want…I’m always lost with knockout..thanks for assistance.
Owebia conf
'carriers' => [
'owsh1' => [
'config' => 'addMethod('id_001',[
'title' => 'Colissimo 48h',
'description' => ' Colissimo 48h',
'enabled' => $request->dest_country_id == 'FR' && $quote->subtotal_with_discount_excluding_tax < 50,
'price' => 4.90
])
->set('header', "Colissimo 48h not free")
->set('popup', "Colissimo 48h not free");
addMethod('id_002',[
'title' => 'Colissimo 48h free',
'description' => 'Colissimo 48h free',
'enabled' => $request->dest_country_id == 'FR' && $quote->subtotal_with_discount_excluding_tax >= 50,
'price' => 0
])
->set('header', "Colissimo 48h free")
->set('popup', "Colissimo 48h free");
addMethod('id_003',[
'title' => "Pickup",
'description' => "Pickup desc.",
'enabled' => $request->dest_country_id == 'FR',
'price' => 0
])
->set('header', "Pickup")
->set('popup', "Pickup");
vendor/magento/module-checkout/view/frontend/web/template/shipping-address/shipping-method-list.html
<div id="checkout-shipping-method-load">
<table class="table-checkout-shipping-method">
<thead>
<tr class="row">
<th class="col col-method" translate="'Select Method'"></th>
<th class="col col-price" translate="'Price'"></th>
<th class="col col-method" translate="'Method Title'"></th>
<th class="col col-carrier" translate="'Carrier Title'"></th>
</tr>
</thead>
<tbody>
<!-- ko foreach: { data: rates(), as: 'method'} -->
<!--ko template: { name: element.shippingMethodItemTemplate} --><!-- /ko -->
<!-- /ko -->
</tbody>
</table>
</div>