Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid loading binding.min.js in places other than Checkout #394

Open
cblanc opened this issue Jun 24, 2022 · 3 comments
Open

Avoid loading binding.min.js in places other than Checkout #394

cblanc opened this issue Jun 24, 2022 · 3 comments
Assignees

Comments

@cblanc
Copy link
Member

cblanc commented Jun 24, 2022

Potential starting points:

@cblanc
Copy link
Member Author

cblanc commented Jul 6, 2022

Seems like we won't be able to do this since some customers are relying on the bindings being loaded outside of checkout (to allow address validation elsewhere)

@cblanc cblanc closed this as completed Jul 6, 2022
@timpea
Copy link

timpea commented Jul 6, 2022

@cblanc can it not be an option in the admin to enable site wide? Or just on standard Magento customer address pages?

@cblanc
Copy link
Member Author

cblanc commented Jul 6, 2022

Hey @timpea was about to drop you an email

I'll reopen ask @mfilip about this as a possibility

In the meantime if you're able to load JS on the checkout, you can also disable the plugin and drop in the following scripts:

https://github.com/ideal-postcodes/magento/blob/master/view/base/web/binding.min.js

<script src="above binding.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
  window.idpcConfig = {
    apiKey: "your key",
    postcodeLookup: true,
    autocomplete: true,
    populateCounty: true,
    populateOrganisation: true,
    hoistCountry: true,
  };
  window.idpcStart();
});
</script>

@cblanc cblanc reopened this Jul 6, 2022
@mfilip mfilip linked a pull request Aug 11, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants