Page 1 of 1

Remove countries from checkout in config/shop.php

Posted: 28 Aug 2016, 13:24
by Arthur Tarasov
Hi, I am trying to remove all countries except for a few from checkout address option. I do not want to tamper with core configuration and I am wondering if it is possible to do it in config/shop.php.

If I try the following, it just changes the first two countries in the list:

Code: Select all

'client' => array(
		'html' => array(
			'checkout' => array(
	            'standard' => array(
	                'address' => array(
	                    'countries' => array(
	                    	'[0]' => 'US',
	                    	'[1]' => 'GB',
	                    ),
	                ),
	            ),
	        ),
		),
	),
The following code appears to do nothing at all:

Code: Select all

'client' => array(
		'html' => array(
			'checkout' => array(
	            'standard' => array(
	                'address' => array(
	                    'countries' => array(
	                    	'US',
	                    	'GB',
	                    ),
	                ),
	            ),
	        ),
		),
	),
What can I do if I just want those two countries to be available for users to select from?

Re: Remove countries from checkout in config/shop.php

Posted: 28 Aug 2016, 13:57
by aimeos
This works with the latest stable Aimeos core (2016.07.5)

Re: Remove countries from checkout in config/shop.php

Posted: 29 Aug 2016, 08:49
by Arthur Tarasov
I updated my shop to 2016.07 version but it still behaves the same way. The documentation shows it to be the latest stable version and it seems to risky to use dev versions for me.

What are my other options rather than altering `client/html/checkout/standard/address/countries`?

If I want to remove those countries within core library, where do I find the list of countries? The only file I found that has any list of countries is `..\vendor\aimeos\aimeos-core\client\i18n\country\core-client-country.pot`. Is this the file that I am trying to configure through shop.php? I was looking through the database for a table with countries, but I couldn't find it either.

Re: Remove countries from checkout in config/shop.php

Posted: 30 Aug 2016, 02:36
by Arthur Tarasov
I ended up changing the list of countries in

Code: Select all

..\vendor\aimeos\aimeos-core\client\html\config\client.php
This only works in v 2016.04. I couldn't figure out how to do it in v 2016.07

Re: Remove countries from checkout in config/shop.php

Posted: 31 Aug 2016, 17:43
by aimeos
The problem is the "[0]" and "[1]":
Arthur Tarasov wrote:

Code: Select all

'client' => array(
		'html' => array(
			'checkout' => array(
	            'standard' => array(
	                'address' => array(
	                    'countries' => array(
	                    	'[0]' => 'US',
	                    	'[1]' => 'GB',
	                    ),
	                ),
	            ),
	        ),
		),
	),
As it's a PHP array it must be

Code: Select all

	                    	0 => 'US',
	                    	1 => 'GB',

Re: Remove countries from checkout in config/shop.php

Posted: 02 Sep 2016, 09:25
by aimeos
The Laravel integration didn't allow to overwrite a setting that contains a list of values up to now. They have been merged instead.
The latest release (2017.07.3) offers the same functionality as Symfony. You can add your countries to the config/shop.php file and only those will be displayed.