The error was from Temando Shipping SaveCheckoutFieldsObserver.
You can try fixing this by overriding Temando's SaveCheckoutFieldsObserver
In your di.xml
file, add this:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Temando\Shipping\Observer\SaveCheckoutFieldsObserver" type="Vendor\Module\Observer\Temando\SaveCheckoutFieldsObserver" />
</config>
Then create observer
file at:
app/code/Vendor/Module/Observer/Temando/SaveCheckoutFieldObserver
<?php
namespace Vendor\Module\Observer\Temando;
use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Exception\NoSuchEntityException;
use Temando\Shipping\Api\Data\Checkout\AddressInterface;
use Temando\Shipping\Api\Data\Checkout\AddressInterfaceFactory;
use Temando\Shipping\Model\ResourceModel\Repository\AddressRepositoryInterface;
/**
* Save checkout fields with quote shipping address.
*
*/
class SaveCheckoutFieldsObserver extends \Temando\Shipping\Observer\SaveCheckoutFieldsObserver
{
/**
* @var AddressRepositoryInterface
*/
private $addressRepository;
/**
* @var AddressInterfaceFactory
*/
private $addressFactory;
/**
* SaveCheckoutFieldsObserver constructor.
* @param AddressRepositoryInterface $addressRepository
* @param AddressInterfaceFactory $addressFactory
*/
public function __construct(
AddressRepositoryInterface $addressRepository,
AddressInterfaceFactory $addressFactory
) {
$this->addressRepository = $addressRepository;
$this->addressFactory = $addressFactory;
}
/**
* @param Observer $observer
* @return void
*/
public function execute(Observer $observer)
{
/** @var \Magento\Quote\Api\Data\AddressInterface|\Magento\Quote\Model\Quote\Address $quoteAddress */
$quoteAddress = $observer->getData('quote_address');
if ($quoteAddress->getAddressType() !== \Magento\Quote\Model\Quote\Address::ADDRESS_TYPE_SHIPPING) {
return;
}
if (!$quoteAddress->getExtensionAttributes()) {
return;
}
// persist checkout fields
try {
$checkoutAddress = $this->addressRepository->getByQuoteAddressId($quoteAddress->getId());
} catch (NoSuchEntityException $e) {
$checkoutAddress = $this->addressFactory->create(['data' => [
AddressInterface::SHIPPING_ADDRESS_ID => $quoteAddress->getId(),
]]);
}
$extensionAttributes = $quoteAddress->getExtensionAttributes();
if(!is_array($extensionAttributes)){
$checkoutAddress->setServiceSelection(array());
}else{
$checkoutAddress->setServiceSelection($extensionAttributes->getCheckoutFields());
}
$this->addressRepository->save($checkoutAddress);
}
}
ini_set('display_errors', 1);
it will display you error details. Then you can add those details in your question to have more details to debug.Uncaught TypeError: Argument 1 passed to Temando\Shipping\Model\Checkout\Address::setServiceSelection() must be of the type array, null given