Giter Site home page Giter Site logo

shawnvdp / hyva-checkout-google-address-autocomplete Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vendic/hyva-checkout-google-address-autocomplete

0.0 0.0 0.0 39 KB

Hyvä checkout compatibility module for vendic/magento2-google-address-autocomplete

License: MIT License

PHP 33.59% HTML 66.41%

hyva-checkout-google-address-autocomplete's Introduction

Google Address Autocomplete for the Hyvä checkout

Coding Standard

Hyvä checkout compatibility module for vendic/magento2-google-address-autocomplete.

google-address-autocomplete.mp4

Installation

This extension currently only supports PHP 8.1, while the Hyvä checkout is also compatible with PHP 7.4. Feel free to create a pull request if you want PHP 7.4 support.

composer require vendic/hyva-checkout-google-address-autocomplete

Configuration

First, create your Google Maps API key. You can find instructions on how to do this here. Also make sure you have valid billing information added to your Google account.

Set your Google Maps API key in the Magento admin panel under Stores > Configuration > Vendic > Google Address Autocomplete.

Or - even better - via the CLI:

 n98-magerun2 config:set --lock-env google_autocomplete/general/api_key $your_api_key

There is no disable/enable configuration. To disable the module, simply remove the API key from the configuration.

Features

  • Autocomplete for billing address in the Hyvä checkout
  • Autocomplete for shipping address in the Hyvä checkout
  • Autocomplete for adding a new address as a logged in user (see #5)
  • Works on the company field and street 0. To add additonal fields, check \Vendic\HyvaCheckoutGoogleAddressAutocomplete\ViewModel\AutoCompleteSelectors
  • Housenumber validation to check if the housenumber contains digits.

Customizations

Field mapping

The field mapping (google address response mapped to Hyvä checkout form inputs) can be modified using di.xml. See etc/frontend/di.xml for the default mapping, which you can change edit in your own di.xml.

Input selectors

The input selectors (the fields that trigger the autocomplete dropdown ) can be modified using di.xml. By default, the autocomplete is triggered for street 0 and company.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.