How to Get shipping rates from the quote and a change Price | change product prices per quote

SHIPPING

   $rates = $quote->getShippingAddress()->getShippingRatesCollection();
   foreach ($rates as $rate)
     {
       $rate->setPrice(0.00)->save();
     }

For Returning the values you should recalculate the Rules

  $quote->getShippingAddress()->setCollectShippingRates(true)->collectShippingRates();

QUOTE ITEM

 foreach ($quote->getAllVisibleItems() as $item) {
   $item->setCustomPrice( $item->getProduct()
       ->getPrice())->setOriginalCustomPrice($item->getProduct()->getPrice())
       ->getProduct()->setIsSuperMode(false);
   $item ->getProduct()->setTaxClassId(0);
   $item->calcRowTotal();
}


Ready to elevate your e-commerce business?

Discuss your business objectives with us. Get in touch today to explore ways we can assist in reaching them.

Copyright © 2021-2024 ArmMage LLC. All rights reserved.