1

Currently, I am using Magento 2.2 version I need customize the checkout page for add multiple shipping addresses like I want to separate shipping address for every item of an order.

Exp. I have added 3 different products to the cart and on the checkout page, I want to separate shipping address for each product.

Please give me your suggestion. Is it possible or not?

Divyesh
  • 1,252
  • 10
  • 28
Banvari Lal
  • 170
  • 2
  • 11

3 Answers3

1

I think you'll want to just enable Multishipping checkout feature

https://www.youtube.com/watch?v=osNFPLC-_ME

Raul Sanchez
  • 3,036
  • 3
  • 28
  • 63
0

overwritten on this function on module-quate/Model/quote.php

public function getShippingAddressesItems()
    {
        if ($this->shippingAddressesItems !== null) {
            return $this->shippingAddressesItems;
        }
        $items = [];
        $addresses = $this->getAllAddresses();
        foreach ($addresses as $address) {
            //echo 'test1'.count($address->getAllItems());

            foreach ($address->getAllItems() as $item) {
                if ($item->getParentItemId()) {
                    continue;
                }
                if ($item->getProduct()->getIsVirtual()) {
                    $items[] = $item;
                    continue;
                }

                $item->setCustomerAddressId($address->getCustomerAddressId());
                $items[] = $item;
            }
        }
        $this->shippingAddressesItems = $items;
        // echo 'test'.count($items);
        // exit;
        return $items;
    }
Teja Bhagavan Kollepara
  • 3,816
  • 5
  • 32
  • 69
0

You can check this default setting Admin >> Store >> Configuration >> Sales >> Multishipping Setting