Set Shippting Rates Product Quantity Wise by Owebia

Owebia

Go to Admin->Configuration->Sales->Delivery Method->Advanced Shipping Configuration

and use this code =>

addMethod(‘id_002’, [
‘title’ => “ヤマト運čŧ¸”,
‘enabled’ => $request->dest_region_id == ‘2’ ,
‘price’ => 220 * array_sum(
array_map(
function ($item) {
// shipping is a custom product attribute
return $item->qty;
},
$request->all_items
)
)
]);