17 votes

How to add new custom field to billing address section in magento2

you need to create a plugin in your custom module ( the one that you used to create the custom attribute ), and have the code something like the following one: namespace Package\Name\Plugin\Checkout; ...
Vlad Patru's user avatar
  • 1,200
17 votes

Move billing address form to shipping address page in magento 2.1

Try to follow all step: Step 1: SR/ModifiedCheckout/etc/module.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:...
Sohel Rana's user avatar
  • 35.2k
15 votes
Accepted

Override html template file in Magento 2 not working

Just copy file from vendor/magento/module-checkout/view/frontend/web/template/billing-address/details.html And put it to app/design/frontend/Vendor/YourTheme/Magento_Checkout/web/template/billing-...
Suresh Chikani's user avatar
13 votes
Accepted

Programatically load default billing and shipping address

This is an example of getting default customer's billing and shipping address if you have the customerId and using the customerRepository Magento\Customer\Api\CustomerRepositoryInterface and the ...
Nikolas's user avatar
  • 2,221
12 votes
Accepted

how to reorder (switch) billing address before shipping address

As Aaron pointed out the form is added in Magento/Checkout/Block/Checkout/LayoutProcessor.php. With this information I developed a module with an after plugin that hooks onto that processor: app/code/...
steros's user avatar
  • 1,612
10 votes
Accepted

How to get formated order addresses

$billing = $order->getBillingAddress()->getFormated(); $shipping = $order->getShippingAddress()->getFormated(); getFormated supports an optional parameter that can be html or text.
Marius's user avatar
  • 197k
10 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,519
10 votes
Accepted

Remove country form payment block

Not 100% sure about this one, but I think the address in the dropdown is formatted via an admin settings. You can go to Stores->Configuration->Customer->Customer Configuration->Address ...
Marius's user avatar
  • 197k
8 votes
Accepted

How to remove telephone number as required field in billing and shipping on admin side?

Here's the SQL query for setting the attribute telephone to not required. UPDATE eav_attribute SET is_required = 0 WHERE attribute_code = 'telephone'; You might want this implemented in a setup ...
Vernard Luz's user avatar
8 votes
Accepted

Why the input element id's for one-page-checkout are in "type:elementname" format?

you can still reference in css or use dom selectors for elements with : in their id. Let's say you have this html <div id="some:id_here">Something here</div> you can set the styles ...
Marius's user avatar
  • 197k
8 votes
Accepted

How to Check If given address is Default Shipping or Billing address using Address id Magento

$addressId = your id here; $address = Mage::getModel('customer/address')->load($addressId); $customer = $address->getCustomer(); $defaultBilling = $customer->getDefaultBillingAddress(); if ($...
Marius's user avatar
  • 197k
8 votes

Magneto 2: Different countries in billing and shipping address

For show only one country in shipping address country dropdown we have to create plugin of LayoutProcessor method for override country_id children field of shipping-address-fieldset which we found in ...
Raj's user avatar
  • 821
7 votes
Accepted

How to clear billing form validation errors when using Magento UI components

You've asked a bit of a mouthful there -- probably too much for a single Stack Exchange question, so I'm going to concentrate on teaching you how to reset the initial state of the form so things no ...
Alana Storm's user avatar
  • 44.1k
7 votes

Move billing address form to shipping address page in magento 2.1

Continue Step 8:SR/ModifiedCheckout/view/frontend/web/template/billing-address.html <div class="checkout-billing-address"> <div class="billing-address-same-as-shipping-block field choice" ...
Sohel Rana's user avatar
  • 35.2k
6 votes

Deny change billing address customer

I think you are asking two questions. I'll try to answer the first one. This is how I tried to always use the default billing address: As far as I know a billing address is tied to the chosen payment ...
nbjohan's user avatar
  • 61
6 votes
Accepted

Magento2: How to show billing address at bottom of payment method instead of showing for each payment

There is a configuration value for this under Stores->Configuration->Sales->Checkout->Checkout Options->Display Billing Address On Change the setting from Payment Method to Payment ...
Pmclain's user avatar
  • 2,488
5 votes

Magento 2 : Default billing address not selected by default on checkout page

You could do the following: overwrite a default js file checkout-data-resolver.js add extra lines to the applyBillingAddress function to check if default billing address exists and if true to use it ...
Михаил Крылов'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

Magento 2 Get shipping and billing address of customer after order placed?

You can add this piece of code in the file: <?php /** @var $_order \Magento\Sales\Model\Order */ ?> <?php $_order = $block->getOrder() ?> <?php $billingAddress = $_order->...
osrecio's user avatar
  • 1,620
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

How to get the billing address from a quote instance: Magento 2

These error comes from a method public function getFormattedAddress(Address $address) because you expect to get the order address as a first argument. Try to remove the argument validation: public ...
Siarhey Uchukhlebau's user avatar
5 votes
Accepted

Remove My billing and shipping address are the same in Magento2

Overwrite: vendor/magento/module-checkout/view/frontend/web/template/billing-address.html in your custom theme: app/design/frontend/<customTheme>/<customTheme>/Magento_Checkout/web/...
Raül's user avatar
  • 780
5 votes

Magento 2.3 - Move billing address below shipping address in checkout

I was able to resolve the issue for Sohel's module with below changes Go to file app/code/SR/ModifiedCheckout/Plugin/Block/LayoutProcessor.php and update as per below. Update your constructor as ...
Jaimin Sutariya's user avatar
4 votes

How to add custom attribute in BILLING address in Magento 2

Please check below code to save custom address attribute in customer,checkout shipping and billing form and also save in order table. Module Name : Ccc_Checkout Script to create custom attribute for ...
Jagdish Barot's user avatar
4 votes

How to Check If given address is Default Shipping or Billing address using Address id Magento

check the below code: <?php $customerAddressID = '24'; // your customer address id $customerID = '1'; $customer = Mage::getModel('customer/customer')->load($customerID); $defaultBilling = $...
Manashvi Birla's user avatar
4 votes

How to add DOB on checkout page

You can do it via back-end Configuration → Customers → Cusotmers Configuration → Name and Address Options Then make changes in : Show Date of Birth = Optional or required Note : It will also ...
Arunendra's user avatar
  • 7,356
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,612
4 votes
Accepted

Removing various states/provinces from shipping but not billing address

It is possible to change it in the checkout for example create these module files Block/Checkout/LayoutProcessor.php <?php namespace Vendor\Module\Block\Checkout; use Magento\Directory\Helper\...
Mr. Lewis's user avatar
  • 1,891
4 votes
Accepted

How to get list billing address and list shipping address based on customer id

Try following way: $customerId = 2; $customer = Mage::getModel('customer/customer')->load($customerId); $defaultBilling = $customer->getDefaultBilling(); $defaultShipping = $customer->...
Sohel Rana's user avatar
  • 35.2k
4 votes

Magento2 : How to add state options for UAE

Here is the way you can insert new states to your Magento 2 via the setup file just follow the below steps Create a new module at Magento_root/app/code/{Vendor}/{Module} create below files into it as ...
Abhishek Tripathi's user avatar

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