New answers tagged

0

try below $customerRepository = Magento\Customer\Api\CustomerRepositoryInterface $addressRepository = Magento\Customer\Api\AddressRepositoryInterface //define above variables in constructor. $customer = $this->customerRepository->getById($customerId); $shippingAddressId = $customer->getDefaultShipping(); //get default billing address try { $...


1

Here is the sample code of how you get the default shipping address information of the customer <?php namespace Vendor\Module\Model; use Magento\Customer\Api\AddressRepositoryInterface; use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Directory\Model\CountryFactory; class MyClass { /** * @var CustomerRepositoryInterface *...


0

Try the below code and let me know if you need more details. $customerRepository = Magento\Customer\Api\CustomerRepositoryInterface $addressRepository = Magento\Customer\Api\AddressRepositoryInterface //define above variables in constructor. $customer = $this->customerRepository->getById($customerId); $shippingAddressId = $customer->...


0

After digging into the JS and template files, then tracing back to the PHP code, I discovered there is a bug in the core Magento Shipping module (vendor/magento/module-shipping). In this file: vendor/magento/module-shipping/view/adminhtml/templates/order/packaging/grid.phtml On line 63, we have: <?php $id = $item->getId() ?? $item->getOrderItemId();...


0

I realise this is an old post, although this may be helpful to someone reaching this in the future. The above answers detailed above suggest to Map a JS file, to a copy of the same JS file with modifications. I'd suggest against this, unless absolutely necessary, as when you upgrade the site to higher Magento 2 versions, things can change in the original JS ...


Top 50 recent answers are included