Restrict delivery
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
-
- Expert
- Posts: 274
- Joined: 27 Jun 2019, 16:19
Restrict delivery
I need two implementation to checkout:
1. I have two delivery methods,and for one of them I need to make it impossible to select if order sum greater than specific value. So this method must be uncheckable in this case.
2. And the second implementation is that I need to make checkout impossible if order weight greater than specific value. So I need to show message and checkout must not be possible to be finished.
Please, give me ideas how to do it better ?
1. I have two delivery methods,and for one of them I need to make it impossible to select if order sum greater than specific value. So this method must be uncheckable in this case.
2. And the second implementation is that I need to make checkout impossible if order weight greater than specific value. So I need to show message and checkout must not be possible to be finished.
Please, give me ideas how to do it better ?
Re: Restrict delivery
Create a service decorator that implements the isAvailable() method and which returns "false" if the sum is smaller, otherwise "true": https://aimeos.org/docs/Developers/Libr ... _decoratorMikaelNazarenko wrote: ↑06 Nov 2019, 07:53 1. I have two delivery methods,and for one of them I need to make it impossible to select if order sum greater than specific value. So this method must be uncheckable in this case.
Afterwards, create a pull request on Github for that so we can integrate it into the core
Use the weight service decorator:MikaelNazarenko wrote: ↑06 Nov 2019, 07:53 2. And the second implementation is that I need to make checkout impossible if order weight greater than specific value. So I need to show message and checkout must not be possible to be finished.
https://aimeos.org/docs/User_Manual/Adm ... ors#Weight
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Expert
- Posts: 274
- Joined: 27 Jun 2019, 16:19
Re: Restrict delivery
Aimeos, thank you for the great support!
-
- Expert
- Posts: 274
- Joined: 27 Jun 2019, 16:19
Re: Restrict delivery
Only problem is that if isAvailable returns false - the delivery method not showed at all.. But I would like to make it uncheckable, and add small text why user can't use this method..
Also weight decorator is not what I want. I need to make checkout process impossible on specific condition and show some text when user goes to checkout ...
Also weight decorator is not what I want. I need to make checkout process impossible on specific condition and show some text when user goes to checkout ...
Re: Restrict delivery
That will be more work to implement because for this the system isn't designed. You would have to overwrite the service frontend controller to return all options, set status for the non-available options to "false" and change the delivery template in the checkout to display the disabled options as such. You can add texts to the service items with a new type (e.g. "disabled") which you render for disabled options.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Expert
- Posts: 274
- Joined: 27 Jun 2019, 16:19
Re: Restrict delivery
Ok thank you! Now it is clear for me
-
- Expert
- Posts: 274
- Joined: 27 Jun 2019, 16:19
Re: Restrict delivery
But I can't find a way how to make checkout process impossible by specific condition.. Please, give me idea for it
Re: Restrict delivery
The check() method of the basket is called at the end of the checkout process (summary page):
https://github.com/aimeos/aimeos-core/b ... rd.php#L71
You can register a basket plugin that checks if customers should be able to proceed.
https://github.com/aimeos/aimeos-core/b ... rd.php#L71
You can register a basket plugin that checks if customers should be able to proceed.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star