Enforce Shipping and billing to be same address

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 years ago
What would be the best approach,
if we want to enforce to only allow shipping to the same address as the billing,

we need so that the user has only one option,
To add the same address for billing and shipping,
we also need to notify the user that they could only ship to the same address as billing.

we use OnePageCheckout

we cant get this done just between these two settings
"Disable "Billing address"
and
"Ship to the same address"
4 years ago
Here's a simple approach (but it could be 'hacked' by a customer if they know HTML and inspect your page).

Don't "Disable "Billing address", but do enable "Ship to the same address"; then modify this file:  \Views\Checkout\OpcBillingAddress.cshtml

and change this
                <input asp-for="ShipToSameAddress"/>
to this
                <input asp-for="ShipToSameAddress" type="hidden"/>

In Languages, you can then change the locale resource string checkout.shiptosameaddress (from 'Ship to the same address')  to better "notify the user that they could only ship to the same address as billing".
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.