Fixed country only for 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!
-
- Posts: 8
- Joined: 17 Oct 2022, 14:41
Fixed country only for delivery
I try limit the country options (and state) for delivery. But dont work.
but work for billing and delivery. If I put this code inside delivery or billing section, not make any changes in the form
Thanks all
Code: Select all
'checkout' => [
'standard' => [
'address' => [
'billing' => [
...
],
'delivery' => [
...
],
'countries' => ['XX'],
'states' => [
'XX' => [
'AA' => 'Aaaaaa',
...
'ZZ' => 'Zzzzzzz',
],
],
],
],
],
Thanks all
Re: Fixed country only for delivery
Seems to be a mistake in the docs because the country and state list is retrieved from "common/countries" and "common/states" config keys for a while now:
https://github.com/aimeos/ai-client-htm ... #L262-L315
https://github.com/aimeos/ai-client-htm ... #L262-L315
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
-
- Posts: 8
- Joined: 17 Oct 2022, 14:41
Re: Fixed country only for delivery
Is possible restrict only the country and the state only for Delivery, not for Billing?
Thanks
Thanks
Re: Fixed country only for delivery
Not by default. You have to create a decorator for the checkout/standard/address/delivery subpart which overwrites the addressCountries view variable in its data() method:
https://aimeos.org/docs/latest/frontend ... omponents/
Something like:
Decorator configuration would be:
https://aimeos.org/docs/latest/frontend ... omponents/
Something like:
Code: Select all
public function data( \Aimeos\Base\View\Iface $view, array &$tags = [], string &$expire = null ) : \Aimeos\Base\View\Iface
{
$view = parent::data( $view, $tags, $expire );
$view->addressCountries = [...];
return $view;
}
Code: Select all
client/html/checkout/standard/address/delivery/decorators/global = ['Mydecorator']
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