2

There is an issue with the checkout page. On the checkout page, when i fill the shipping address then select the shipping method and click on the next button it redirect to the payment page. But when i check in the database quote_address table i can see shipping method value is NULL, i can not see the selected shipping method. This issue is happening only some time. So, i can not track the exact issue.

and i back to the shipping step and select the shipping method again, then my shipping method saves into the database. Please check this video for the more idea.

https://watch.screencastify.com/v/bimyevlOTA80yoRy01Sp

Please help me to come out. Thanks.

1
  • Based on your video - shipping method is set properly on shiping step and it's available in totals on payment step. I suggest to monitor address state after you've click continue on shipping step, after you click to payment method, after you click to place button. Jun 6, 2022 at 13:02

1 Answer 1

0

Make plugin

public function beforeSaveAddressInformation(
    \Magento\Checkout\Model\ShippingInformationManagement $subject,
    $cartId,
    \Magento\Checkout\Api\Data\ShippingInformationInterface $addressInformation
) {
    try {
        $extAttributes = $addressInformation->getExtensionAttributes();
        $selectedShipping = $extAttributes->getSelectedShipping();
        $logger->info(get_class_methods(get_class($extAttributes)));
        $multiCustomship = $extAttributes->getMultiCustomship();
        $this->logger->info("selected shipping ");
        $this->logger->info($extAttributes->getSelectedShipping());
        $this->_coreSession->setSelectedAmount(10); //set total shipping amount
        $this->_coreSession->setSelectedMethods($this->jsonSerializer->unserialize($selectedShipping));
    } catch (\Exception $e) {
        $this->logger->info('beforeSaveAddressInformation : '.$e->getMessage());
    }

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.

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