shopgo / checkout-city
A module that adds checkout city field to checkout quote shipping address
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 4
Forks: 3
Open Issues: 3
Type:magento2-module
Requires
- php: ~5.5.0|~5.6.0|~7.0.0
- magento/framework: 100.0.*
- magento/module-checkout: 100.0.*
- magento/module-quote: 100.0.*
This package is not auto-updated.
Last update: 2024-12-27 23:44:42 UTC
README
Contents
Synopsis
A module that adds checkout city field to checkout quote shipping address.
Overview
Checkout City is a module that adds checkout city field to checkout quote shipping address. Thus, making destination city available for third-party shipping methods.
Installation
Below, you can find two ways to install the shipping core module.
1. Install via Composer (Recommended)
First, make sure that Composer is installed: https://getcomposer.org/doc/00-intro.md
Make sure that Packagist repository is not disabled.
Run Composer require to install the module:
php <your Composer install dir>/composer.phar require shopgo/checkout-city:*
2. Clone the checkout-city repository
Clone the checkout-city repository using either the HTTPS or SSH protocols.
2.1. Copy the code
Create a directory for the checkout city module and copy the cloned repository contents to it:
mkdir -p <your Magento install dir>/app/code/ShopGo/CheckoutCity
cp -R <checkout-city clone dir>/* <your Magento install dir>/app/code/ShopGo/CheckoutCity
Update the Magento database and schema
If you added the module to an existing Magento installation, run the following command:
php <your Magento install dir>/bin/magento setup:upgrade
Verify the module is installed and enabled
Enter the following command:
php <your Magento install dir>/bin/magento module:status
The following confirms you installed the module correctly, and that it's enabled:
example
List of enabled modules:
...
ShopGo_CheckoutCity
...
Create a checkout shipping rates validator for your custom shipping method
In order to validate checkout city field changes when your custom shipping module is used, you have to create a shipping rate validator in your custom shipping module. You can do that by following this gruide's instructions: http://devdocs.magento.com/guides/v2.0/howdoi/checkout/checkout_carrier.html
In your validation rules JS file (view/frontend/web/js/model/shipping-rates-validation-rules.js), make sure that you add "city" field to validation rules:
'city': {
'required': true
}
Tests
TODO
Contributors
- Ammar (ammar@shopgo.me)
- Emad (emad@shopgo.me)