0

I want to customize shipping price after customer select shipping method in checkout page. I have added a few lines of these code into Magento_Checkout/Model/ShippingInformationManagement.php, but nothing has changed.

$totals = $this->cartTotalsRepository->get($cartId);
$totals->setShippingAmount($customPrice);
$totals->setBaseShippingAmount($customPrice);
3
  • which shipping method amount U try to change?
    – Bhavik
    Commented Jan 24, 2017 at 9:38
  • Store -> Configuration -> sales > Shiping methods already provide shipping amout
    – Bhavik
    Commented Jan 24, 2017 at 9:40
  • @Bhavik i want, for example adding up selected shipping amount.
    – Seventh St
    Commented Jan 24, 2017 at 9:49

1 Answer 1

-1

Check in to below Function

Magento\Shipping\Model\Shipping::collectCarrierRates

Before $this->getResult()->append($result);

Set

$price = 10;
$result->setPrice ($price); 

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.