Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

workarea-google_address_autocomplete

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

workarea-google_address_autocomplete

  • 4.1.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Workarea Google Address Autocomplete

A Workarea Commerce plugin that adds a Google Maps address autocomplete field to the addresses step of checkout in the Workarea Storefront. This field searches Google Maps for an address and autocompletes the standard address fields with the selected address.

Google Address Autocomplete Example

Getting Started

Add the gem to your application's Gemfile:

# ...
gem 'workarea-google_address_autocomplete'
# ...

Update your application's bundle.

cd path/to/application
bundle

Configuration

To integrate your Workarea application with Google Address Autocomplete you need configure your host application with your Google Address Autocomplete apiKey, which must be obtained here

You should use application secrets to do this. Add the following config to your secrets.yml file

# ...
google_address_autocomplete:
  :api_key: 'YOUR_API_KEY'
# ...

This plugin adds a config.js file to the Storefront's JavaScript manifest.

The object that this file provides contains two properties:

  • apiKey which must be added to secrets.yml (see above) which must be obtained here and,
  • mappings which contains an object that maps Google Places component types and selector strings that match input elements within the autocomplete-enabled form. For example:
mappings: {
    'street_number': {  // Google Places Component Type
        selector: '[name$="address[street]"]',  // Selector for a form field
        shortName: false  // Abbreviated?
    },
    'route': {
        selector: '[name$="address[street]"]',
        shortName: false
    },
    'locality': {
        selector: '[name$="address[city]"]',
        shortName: false
    },

    ... etc ...

}

If none of the input [name]s for the address partial have been changed in your project, this plugin should work out of the box. If you have modified any of these attributes, or if you are wishing to collect more data from this plugin, you'll need to modify or expand this configuration object for your project.

Workarea Commerce Documentation

See https://developer.workarea.com for Workarea Commerce documentation.

License

Workarea Google Address Autocomplete is released under the Business Software License

FAQs

Package last updated on 21 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc