PHPackages                             liquidlab-agency/magento2-sameday-validation-fix - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. liquidlab-agency/magento2-sameday-validation-fix

ActiveMagento2-module[Validation &amp; Sanitization](/categories/validation)

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

1.0.1(9mo ago)051MITJavaScriptPHP ~7.1.0||~7.2.0||~7.3.0||~7.4.0||~8.1.0||~8.2.0||~8.3.0

Since Aug 14Pushed 9mo agoCompare

[ Source](https://github.com/liquidlab-agency/magento2-sameday-validation-fix)[ Packagist](https://packagist.org/packages/liquidlab-agency/magento2-sameday-validation-fix)[ RSS](/packages/liquidlab-agency-magento2-sameday-validation-fix/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

Magento 2 Sameday Validation Fix
================================

[](#magento-2-sameday-validation-fix)

[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)[![Magento 2](https://camo.githubusercontent.com/fc11f5c2a93c591c7604857053186da86fa43206b94b7238bbe5c528ea102819/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d6167656e746f2d322e782d6f72616e67652e737667)](https://magento.com/)[![PHP](https://camo.githubusercontent.com/06055a973c3390fbc7de77d84af42d045eb6bd65a7f323c9566f68720f193ee0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372e31253230746f253230382e332d626c75652e737667)](https://php.net/)

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
-----------------------

[](#-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
------------------------

[](#-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:

1. Country field validation to be skipped
2. Shipping address not being updated when Sameday is selected
3. Incomplete address data being saved
4. Potential checkout issues and shipping calculation problems

📋 Requirements
--------------

[](#-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.0`
    - `magento/module-checkout: ^100.0`
    - `sameday/magento2-plugin: ^1.9`

📦 Installation
--------------

[](#-installation)

### Via Composer (Recommended)

[](#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

[](#manual-installation)

1. Download or clone this repository
2. Copy the contents to `app/code/Liquidlab/SamedayValidationFix/`
3. 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
---------

[](#-testing)

After installation, test the fix by:

1. Go to your store's checkout page
2. Add a product to cart and proceed to checkout
3. Select "Sameday Courier" as shipping method
4. Verify that changing the country field triggers address validation
5. Confirm the shipping address is properly saved and updated

[![Sameday Validation Demo](docs/images/checkout.png)](docs/images/checkout.png)

🔄 Compatibility
---------------

[](#-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
---------------------

[](#-module-dependencies)

This module depends on and extends:

- `Magento_Checkout` - For checkout functionality
- `SamedayCourier_Shipping` - The original Sameday plugin

📞 Support
---------

[](#-support)

For support, please:

1. Check the [GitHub Issues](https://github.com/liquidlab-agency/magento2-sameday-validation-fix/issues)
2. Contact us at

📄 License
---------

[](#-license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

🤝 Contributing
--------------

[](#-contributing)

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

🏷️ Changelog
------------

[](#️-changelog)

### v1.0.0

[](#v100)

- 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](https://liquidlab.ro)**

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance58

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

271d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/92c314c20b6d15684cff367c3d48732f1ea0074efedec77e2d5f9efc9b4384c5?d=identicon)[liquidlab](/maintainers/liquidlab)

![](https://www.gravatar.com/avatar/b5d9b3bcbbbebb62b1f53afd772f4a81d02a77e969b0acc23e565a28f64445c8?d=identicon)[hawksama](/maintainers/hawksama)

---

Top Contributors

[![Hawksama](https://avatars.githubusercontent.com/u/46504593?v=4)](https://github.com/Hawksama "Hawksama (3 commits)")

---

Tags

validationshippingmagento2fixsamedaycountry-field

### Embed Badge

![Health badge](/badges/liquidlab-agency-magento2-sameday-validation-fix/health.svg)

```
[![Health](https://phpackages.com/badges/liquidlab-agency-magento2-sameday-validation-fix/health.svg)](https://phpackages.com/packages/liquidlab-agency-magento2-sameday-validation-fix)
```

###  Alternatives

[composer/semver

Version comparison library that offers utilities, version constraint parsing and validation.

3.3k489.6M672](/packages/composer-semver)[giggsey/libphonenumber-for-php

A library for parsing, formatting, storing and validating international phone numbers, a PHP Port of Google's libphonenumber.

5.0k148.7M416](/packages/giggsey-libphonenumber-for-php)[respect/validation

The most awesome validation engine ever created for PHP

5.9k37.4M383](/packages/respect-validation)[propaganistas/laravel-phone

Adds phone number functionality to Laravel based on Google's libphonenumber API.

3.0k35.7M107](/packages/propaganistas-laravel-phone)[opis/json-schema

Json Schema Validator for PHP

64236.9M186](/packages/opis-json-schema)[mollie/magento2

Mollie Payment Module for Magento 2

1121.6M10](/packages/mollie-magento2)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
