A module that adds checkout city field to checkout quote shipping address.
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.
Below, you can find two ways to install the shipping core module.
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:*
Clone the checkout-city repository using either the HTTPS or SSH protocols.
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
If you added the module to an existing Magento installation, run the following command:
php <your Magento install dir>/bin/magento setup:upgrade
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
...
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
}
TODO
- Ammar (ammar@shopgo.me)
- Emad (emad@shopgo.me)