0

The Shipping Courier API requires the Customer Phone Number to get the shipping rates. I'm using RateRequest to get all the information, including the Destination information, but i can't figure out how to get the Phone number. Thank you!

0

Try the following way, may be help you:

$quote = null;
$items = $request->getAllItems();
foreach($items as $item) {
    /** @var Quote $quote */
    $quote = $item->getQuote();
    break;
}

Now you have the quote. You can access the quote billing/shipping address. Ex:

$shippingAddress = $quote->getShippingAddress();
$shippingAddress->getTelephone(); // phone number

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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