- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2021
04:01 AM
03-05-2021
04:01 AM
I am converting a Magento 1 site to Magento 2 and need to upgrade an Owebia Advanced Shipping configuration file. I'm ok with most of the file but need to help on what this line from the Magento 1 version should be replaced with in the Magento 2 version.
"fees": "{cart.weight} > 30010 ? 262.56 + (ceil(({cart.weight} - 30010) / 1000) * 2.4) : {table {cart.weight} in 2510:50.40, 3010:55.20, 3510:61.20}"
Solved! Go to Solution.
Labels:
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2021
05:44 AM
03-15-2021
05:44 AM
I got a prompt reply when I contacted Owebia. Solution is:
'price' => $request->package_weight > 30010 ? 262.56 + (ceil(($request->package_weight - 30010) / 1000) * 2.4) : array_reduce([ [2510, 50.40], [3010, 55.20], [3510, 61.20] ], function ($carry, $item) use ($request) { if (isset($carry)) return $carry; if (isset($item[0]) && ($request->package_weight <= $item[0] || $item[0] == '*')) { $carry = $item[1]; } return $carry; }),
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2021
05:44 AM
03-15-2021
05:44 AM
I got a prompt reply when I contacted Owebia. Solution is:
'price' => $request->package_weight > 30010 ? 262.56 + (ceil(($request->package_weight - 30010) / 1000) * 2.4) : array_reduce([ [2510, 50.40], [3010, 55.20], [3510, 61.20] ], function ($carry, $item) use ($request) { if (isset($carry)) return $carry; if (isset($item[0]) && ($request->package_weight <= $item[0] || $item[0] == '*')) { $carry = $item[1]; } return $carry; }),