1

I want to apply the matrix rate shipping method which has multiple rates based on quantity in the cart. I tried the following code but it is not working

$shippingAddress->setCollectShippingRates(true)->collectShippingRates()->setShippingMethod('matrixrate');
$quote->collectTotals();
$quote->save();
OR
$quote->setShippingAmount(666);
$quote->getTotals->setShippingAmount(666);
$quote->save();

I cannot see any rates added in the quote_shipping_rate table in the database.

$shippingAddress->getAllShippingRates() is also returning empty values

How to apply the shipping rate to the quote?

1
  • Please share solution for this Oct 12, 2022 at 10:17

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.