Skip to main content
23 votes
Accepted

Magento2 - Change standard address format on Magento Frontend

Login into Magento Admin > STORES > Configuration > CUSTOMERS > Customer Configuration > Address Templates You also can find in the config xml: vendor/magento/module-customer/etc/config.xml [EDIT] ...
Khoa TruongDinh's user avatar
18 votes
Accepted

How to add label on all lines of street fields in checkout and turn then required?

I solved rewriting street on di.xml: ... <type name="Magento\Checkout\Block\Checkout\LayoutProcessor"> <plugin name="rewrite-street" type="Vendor\ModuelName\Model\Checkout\...
Eduardo's user avatar
  • 895
11 votes
Accepted

Magento 2 : Place Billing Address Above Payments Methods in Checkout

Starting from Magento 2.1.4 release, the checkout configuration has additional Display Billing Address On option (Stores -> Configuration -> Checkout -> Checkout Options). It has two possible values: ...
joni jones's user avatar
  • 2,549
9 votes
Accepted

Update customer address using address id in magento 2

If you know the address id ($addressId) you can use the address repository to load and save updated addresses: /** * @var \Magento\Customer\Api\AddressRepositoryInterface */ protected $...
Siarhey Uchukhlebau's user avatar
9 votes
Accepted

How to get customer address with address id

You can get the formatted address using address id with below code: public function __construct( \Magento\Customer\Api\AddressRepositoryInterface $addressRepository, \Magento\Customer\Model\...
Pankaj Pareek's user avatar
8 votes

Magento 2: An error occurred on the server. Please try to place the order again

You may echo the actual error message on this file: vendor/magento/module-payment/view/frontend/templates/transparent/iframe.phtml if you did not extend the file yet or if you did you may edit this on ...
jjordao's user avatar
  • 351
7 votes

Update billing address inserts javascript string in the address

Remove _.values for currentBillingAddress().street in <text args="_.values(currentBillingAddress().street).join(', ')"/><br/> in the file vendor/magento/module-checkout/view/frontend/web/...
user86638's user avatar
6 votes

Magento 2: An error occurred on the server. Please try to place the order again

If the magento version is > 2.4 then check service elasticsearch is in running state.
Kapil Dev Singh's user avatar
6 votes

Magento 2 : Fatal error: Uncaught Error: Call to a member function dispatch() | Store Information

It's because your constructor does not match the parent block constructor. (the ... in my answer you linked are important). public function __construct( \Magento\Framework\View\Element\Template\...
Raphael at Digital Pianism's user avatar
6 votes
Accepted

Magento2: Add a New Customer Address

You will get all the customer address related attributes by calling below url : http://yourwebsite.com/index.php/rest//V1/attributeMetadata/customerAddress/ Method Name : GET Same way for ...
Manthan Dave's user avatar
  • 9,856
6 votes
Accepted

region Id error on updating address using address Id in magneto2

$countryId = 'US' //static set for example $regionName = 'Alaska' //static set for example /** @var \Magento\Directory\Model\Region $region */ $region = $this->regionFactory->create(); $region-&...
Milind Singh's user avatar
  • 1,594
6 votes
Accepted

Magento 2 How to add custom attribute to customer address and how to insert value in that attribute?

I have created it with below code in InstallData.php file. namespace Module\Name\Setup; use Magento\Customer\Setup\CustomerSetupFactory; use Magento\Eav\Model\Entity\Attribute\Set as AttributeSet; ...
Utsav Gupta's user avatar
  • 1,243
5 votes

Magento 2 : Place Billing Address Above Payments Methods in Checkout

I found it myself. Here is the solution We have to override the payment.html in the checkout module. Copy this file; \magento\module-checkout\view\frontend\web\template\payment.html and place it ...
Prometheus's user avatar
5 votes
Accepted

Magento 2.1.2, Remove "region" from the Address

If you want disable Region from the address, you have to set below option like. State is Required for : remove all selected country from here. Allow to Choose State if It is Optional for Country : ...
Suresh Chikani's user avatar
5 votes

Remove blank option from country dropdown list

This might be late but I think very short & sweet solution :- The file is this - app/code/core/Mage/Directory/Block/Data.php and the function is this - getCountryHtmlSelect If you want to ...
KA9's user avatar
  • 531
5 votes

how do disable/remove Zip Code for specific country in magento 2

If you want to remove the Zip Code based on country selection, then firstly you can make zip code optional for this country from backend (i.e UAE), from store > config > general > Zip/Postal ...
Keyur Shah's user avatar
  • 18.1k
5 votes
Accepted

Magento 2 : Delete address from after login from address book

This is because Magento allows deleting the address when having one more addresses. We can add one more address and will see the delete button. If we're really want to delete the address, we can base ...
Khoa TruongDinh's user avatar
5 votes

How to update customer address using custom Api in magento2?

You need to call below api for customer address update API : xyz.com/rest/V1/customers/2 Header: Authorization :"Bearer ishamls4xu7pnwhlvup141502tjm3cl2" Content-Type :"application/json" Method : ...
Prashant Valanda's user avatar
5 votes
Accepted

How to get Region text from address id (Magento 2)

You can try following code to get the region from the address id. $address = $this->addressRepository->getById($addressId); $address->getRegion()->getRegion(); where $this->...
Anshu Mishra's user avatar
  • 8,990
5 votes
Accepted

v2.3.4 Customer Import - Please enter a valid region

Managed to solve it (well a colleague managed to solve it). I think it was an issue with one of the updates up to Magento 2.3.4, it basically tries to validate a region against a country even if the ...
Thomas Harding's user avatar
4 votes

Magento 2: An error occurred on the server. Please try to place the order again

Please go to vendor/magento/module-checkout/Model/PaymentInformationManagement.php Functions: savePaymentInformationAndPlaceOrder() Change line 85 and 90 with follow code: throw new ...
the light's user avatar
  • 728
4 votes

Magento 2 : Place Billing Address Above Payments Methods in Checkout

The checked answer might work but is not correct itself. You can't just move the place of the methods. Instead you must move the form itself to beforeMethods. See https://magento.stackexchange.com/a/...
steros's user avatar
  • 1,622
4 votes
Accepted

How to set required field ''State/Province' of add new address in My Address Book, magento 2?

You can select State Required for particular Country from backend using the below path: Stores-> Configuration -> General -> State Options here select country in State is Required for dropdown.
Pankaj Pareek's user avatar
4 votes
Accepted

Magento 2 : From where (PHP) is the checkout billing address options drop down being populated?

I tracked down where the info is passed from php , I started at your file - Magento_Customer/js/model/address-list define([ 'ko', './customer-addresses' ], function (ko, defaultProvider) { ...
Vivek Kumar's user avatar
  • 5,685
4 votes

How to update customer address using custom Api in magento2?

check below code that helps you somewhat /** * @var \Magento\Customer\Api\CustomerRepositoryInterface */ protected $customerRepository; protected $addressRepository; protected $addressData; /** * ...
Murtuza Zabuawala's user avatar
4 votes
Accepted

Magento 2 How to override "\vendor\magento\module-checkout\view\frontend\web\js\view\billing-address.js" in our custom module?

For this, you need to create requirejs-config.js under your custom module, let say (VENDOR/MODULE/view/frontend/requirejs-config.js) In this js file, var config = { map: { "*": { ...
Keyur Shah's user avatar
  • 18.1k
4 votes
Accepted

Extension Attributes not storing data in database

That tutorial only shows you how to add new fields to default checkout forms but not mentioned how to save the field data (extension attribute value) into the database. To save the extension attribute ...
Tu Van's user avatar
  • 7,423
3 votes
Accepted

Magento v1, rename country

lib/Zend/Locale/Data/Translation.php lib/Zend/Locale/Data/fil.xml lib/Zend/Locale/Data/en.xml lib/Zend/Locale/Data/id.xml lib/Zend/Locale/Data/ms.xml
PЯINCƎ's user avatar
  • 11.7k
3 votes

Magento 2.1: How can i add email to "New Invoice" template

Just in case anyone stumbles on this post again. In CE 2.2.3, the following worked for me: {{var order.getData('customer_email')}}
immanuelp's user avatar
3 votes
Accepted

How to create custom address renderer

You need to specify renderer type one of: const OUTPUT_FORMAT_JSON = 'json'; const OUTPUT_FORMAT_TEXT = 'text'; const OUTPUT_FORMAT_HTML = 'html'; const OUTPUT_FORMAT_PDF = 'pdf'; const ...
DmitryFurs's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible