You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This module provides methods to preselect a shipping method upon quote creation of the customer. It fetches all available countries from Magento Config and will preselect the default country/region/postcode of the current storeview.
15
+
This module preselects the cheapest shipping method by filling shipping address with mock data and default country/region/postcode of the current storeview.
16
+
17
+
Upon entering checkout, PayPal Express or PayOne pages, the mock data is removed from shipping address.
16
18
17
-
**Important:** This is WIP as of yet - shipping address mock data still needs to be cleared when entering checkout.
18
19
19
20
20
21
## Installation
@@ -32,76 +33,99 @@ This module provides methods to preselect a shipping method upon quote creation
32
33
33
34
## Configuration
34
35
35
-
In general, make sure your configuration settings meet requirements:
36
+
In general, make sure your configuration settings meet requirements:
36
37
37
38
- postcode, region and country set in General > Store Information
38
39
- all available countries need to have at least one shipping method available
39
40
- available countries cannot have mandatory region setting
40
41
41
42
1) Add selectedShippingCountry select to `Mage_Checkout::cart.phtml`
42
-
43
-
43
+
44
+
44
45
```
45
46
<?= $block->getChildHtml('shipping_country') ?>
46
47
47
48
```
48
49
2. Add shipping country script to `Mage_Checkout::cart/js/cart.phtml`
3) Set config value for the mock data `integernet/shipping_preselection/mock_data` to custom value if desired
60
-
59
+
60
+
3) Set config value for the mock data `integernet/shipping_preselection/mock_data` to custom value if desired
61
+
61
62
4) If you have an altered cart query for GraphQl, you need to override `IntegerNet\ShippingPreselection\ViewModel\ShippingAddressMutation` accordingly.
62
63
63
-
## Usage
64
64
65
-
## Changelog
65
+
.
66
66
67
-
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
67
+
Please mind: *The template provided is supposed to work with table rates / one shipping method.*
68
68
69
-
## Contributing
69
+
If you have several shipping methods and through changes made in cart - like quantity changes - the best available method changes, this will not be recognized by the module (because a shipping method is already in place). You can solve this by checking client-side in the cart, or adding a check backend-wise.
70
70
71
-
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
71
+
## Extending configuration
72
72
73
-
## Testing
73
+
Override config values for integernet/shipping_preselection/mock_clearance_urls or hook into the service to modify behaviour for pages where the shipping address should be (un-)mocked.
74
74
75
-
### Unit Tests
75
+
## Known issues
76
76
77
-
```
78
-
./vendor/bin/phpunit tests/unit
79
-
```
77
+
**1. When aborting PayPal Express and return to cart, the shipping method isn't displayed anymore**
80
78
81
-
### Magento Integration Tests
79
+
Paypal doesn't properly set the telephone address attribute, as it is called differently in its response. You can make the telephone field nullable in a `etc/schema.graphql` of your own
82
80
83
-
0. Configure test database in `dev/tests/integration/etc/install-config-mysql.php`. [Read more in the Magento docs.](https://devdocs.magento.com/guides/v2.4/test/integration/integration_test_execution.html)
84
81
85
-
1. Copy `tests/integration/phpunit.xml.dist` from the package to `dev/tests/integration/phpunit.xml` in your Magento installation.
82
+
interface CartAddressInterface {
83
+
telephone: String
84
+
}
85
+
86
+
input CartAddressInput {
87
+
telephone: String
88
+
}
86
89
87
-
2. In that directory, run
88
-
``` bash
89
-
../../../vendor/bin/phpunit
90
-
```
90
+
91
+
92
+
93
+
## Changelog
94
+
95
+
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
96
+
97
+
## Contributing
98
+
99
+
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
91
100
92
101
## Security
93
102
94
103
If you discover any security related issues, please email security@integer-net.de instead of using the issue tracker.
95
104
96
105
## Credits
97
106
98
-
- [Lisa Buchholz][link-author]
107
+
- [integer_net GmbH][link-author]
99
108
- [All Contributors][link-contributors]
100
109
101
110
## License
102
111
103
112
The MIT License (MIT). Please see [License File](LICENSE) for more information.
0 commit comments