liquidlab-agency / magento2-sameday-validation-fix
Magento 2 module that fixes the Sameday shipping method to properly validate Country field, which triggers shipping address validation and saving
Magento 2 Sameday Validation Fix
A Magento 2 module that fixes the Sameday shipping method to properly validate the Country field, which triggers shipping address validation and saving during checkout.
🚀 What This Module Does
This module solves a critical issue with the original sameday/magento2-plugin where:
- Problem: The shipping address is only saved when the "Country" field contains a valid value and passes Magento's default validation
- Root Cause: The Sameday plugin doesn't add validation rules for required fields like
country_id, preventing the shipping address from being updated and saved - Solution: This module adds proper validation rules for the Sameday shipping method that include required field validation for:
country_id(Country field)postcode(Postal code)region_id(Region/State)region_id_input(Region input for manual entry)
🔍 Why This Fix Is Needed
In typical Magento 2 shipping method implementations (like tablerate), validation rules are properly defined to trigger address validation. However, the Sameday plugin was missing these crucial validation rules, causing:
- Country field validation to be skipped
- Shipping address not being updated when Sameday is selected
- Incomplete address data being saved
- Potential checkout issues and shipping calculation problems
📋 Requirements
- PHP: 7.1, 7.2, 7.3, 7.4, 8.1, 8.2, or 8.3
- Magento: 2.x (Community or Commerce Edition)
- Dependencies:
magento/framework: ^103.0magento/module-checkout: ^100.0sameday/magento2-plugin: ^1.9
📦 Installation
Via Composer (Recommended)
composer require liquidlab-agency/magento2-sameday-validation-fix
php bin/magento module:enable Liquidlab_SamedayValidationFix
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento cache:flush
Manual Installation
- Download or clone this repository
- Copy the contents to
app/code/Liquidlab/SamedayValidationFix/ - Run the following commands:
php bin/magento module:enable Liquidlab_SamedayValidationFix
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento cache:flush
🧪 Testing
After installation, test the fix by:
- Go to your store's checkout page
- Add a product to cart and proceed to checkout
- Select "Sameday Courier" as shipping method
- Verify that changing the country field triggers address validation
- Confirm the shipping address is properly saved and updated
[image: Sameday Validation Demo]
🔄 Compatibility
- Magento Versions: 2.3.x, 2.4.x
- PHP Versions: 7.1 - 8.3
- Sameday Plugin: Compatible with v1.9+
- Themes: Works with all themes (Luma, Blank, custom themes)
📚 Module Dependencies
This module depends on and extends:
Magento_Checkout- For checkout functionalitySamedayCourier_Shipping- The original Sameday plugin
📞 Support
For support, please:
- Check the GitHub Issues
- Contact us at [email protected]
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🤝 Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
🏷️ Changelog
v1.0.0
- Initial release
- Added Country field validation for Sameday shipping method
- Fixed shipping address saving issue
- Full PHP 7.1-8.3 compatibility
Made with ❤️ by Liquidlab
No changelog yet
The vendor hasn't published a changelog. Tagged releases appear in the Versions tab.
Requires 4
| Package | Constraint |
|---|---|
| magento/framework | ^103.0 |
| magento/module-checkout | ^100.0 |
| php | ~7.1.0||~7.2.0||~7.3.0||~7.4.0||~8.1.0||~8.2.0||~8.3.0 |
| sameday/magento-2-plugin | ^1.9 |
Compatibility
Each Magento release line is installed on its supported PHP versions, then the module is built (DI compilation + static-content deploy) and its unit and integration suites are run. The matrix shows the lines and PHP versions the module is confirmed to install and run on. Code-quality results further down (phpstan, phpcs, …) are reported separately and never affect compatibility.
Code Quality
Advisory checks against the module's source. Static analysis runs once across the whole module; PHPStan re-runs per Magento + PHP version because resolvable symbols differ between releases. These NEVER affect the Compatibility badge. A phpcs finding can't make a module incompatible.
Static analysis
Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.
PHPStan
Type-checks the module's PHP against a real Magento install at the configured gate level. Re-runs per Magento and PHP version because resolvable symbols differ between releases.
Tests
Unit and integration suites, run for each applicable Magento and PHP version. A test failure speaks to the module's behaviour, not its compatibility with a Magento line, so it is reported here separately and never reddens the compatibility matrix.
Unit tests
| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | ||
| 2.4.8 | N/A | N/A | ||
| 2.4.9 | N/A | N/A |
Integration tests
| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | ||
| 2.4.8 | N/A | N/A | ||
| 2.4.9 | N/A | N/A |
Security
Security checks run directly against the module: an audit of its declared dependencies for known vulnerabilities (composer audit) and a scan of its source for malware and web-shell signatures. Each runs once. A malware detection fails the version outright.
More from liquidlab-agency
View vendorRomanian language pack for Hyva Checkout
Hyva Checkout compatibility module for InnoShip (https://innoship.com/)
Hyva Checkout compatibility module for EuroPayment_EuPlatesc
EuPlatesc payment gateway for Magento 2
Turn an existing module into recurring revenue.
If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.