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; ...
user avatar
  • 1,170
16 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:...
user avatar
  • 34.1k
14 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-...
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 ...
user avatar
  • 2,138
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/...
user avatar
  • 1,552
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.
user avatar
  • 195k
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: ...
user avatar
  • 2,479
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 ...
user avatar
  • 195k
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 ...
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 ...
user avatar
  • 195k
7 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 ($...
user avatar
  • 195k
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 ...
user avatar
  • 43.5k
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" ...
user avatar
  • 34.1k
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 ...
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 ...
user avatar
  • 2,318
6 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 ...
user avatar
  • 771
5 votes
Accepted

Change shipping and billing address from order programmatically

if you want update shipping address of an order then you need load order then load it address object: Step1:Order load by orded id $order = Mage::getModel('sales/order')->load($orderId); Step2:...
user avatar
  • 75.4k
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 ...
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 : ...
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->...
user avatar
  • 1,590
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 ...
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 ...
user avatar
4 votes
Accepted

How can I create and retrieve default billing address programatically?

You need to set it the other way around. The default_billing for the customer. $customerId = 1234; // Customer id $data = array(); // Address data $customer = Mage::getModel('customer/customer'); //...
user avatar
  • 2,928
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 = $...
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 ...
user avatar
  • 7,346
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/...
user avatar
  • 1,552
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\...
user avatar
  • 1,761
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->...
user avatar
  • 34.1k
4 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/...
user avatar
  • 770
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: { "*": { ...
user avatar
  • 17.4k

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