What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hi All, I am trying to add a new store UK which will share the database with DE store. I have follo

U01UHQT0PE2
U01UHQT0PE2 Posts: 15 🧑🏻‍🚀 - Cadet
edited May 2021 in Help

Hi All,

I am trying to add a new store UK which will share the database with DE store. I have followed the Spryker documentation https://documentation.spryker.com/docs/multiple-stores.
As per the documentation I have added the below code snippet inside store.php (complete store.php attached).

$stores['UK'] = [
        'contexts' => [
            // shared settings for all contexts
            '*' => [
                'timezone' => 'Europe/London',
                'dateFormat' => [
                    // short date (01.02.12)
                    'short' => 'd/m/Y',
                    // medium Date (01. Feb 2012)
                    'medium' => 'd. M Y',
                    // date formatted as described in RFC 2822
                    'rfc' => 'r',
                    'datetime' => 'Y-m-d H:i:s',
                ],
            ],
            // settings for contexts (overwrite shared)
            'yves' => [],
            'zed' => [
                'dateFormat' => [
                    // short date (2012-12-28)
                    'short' => 'Y-m-d',
                ],
            ],
        ],
        'locales' => [
            // first entry is default
            'en' => 'en_GB',
            'de' => 'de_DE',
        ],
        // first entry is default
        'countries' => ['GB'],
        // internal and shop
        'currencyIsoCode' => 'GBP',
        'currencyIsoCodes' => ['GBP', 'EUR'],
        'storesWithSharedPersistence' => ['DE'],
    ] + $stores['DE'];

I have added config_default-development_UK.php file. I want to access the store with different domain name (http://yves.uk.spryker.local/en) hence I have added new entries inside deploy.dev.yml (refer to the attachment). After making the configuration changes I ran docker/sdk bootstrap deploy.dev.yml and docker/sdk up command. When I try to access http://yves.uk.spryker.local/en I am getting the below error:

Fatal error: Uncaught Spryker\Shared\Kernel\CodeBucket\Exception\InvalidCodeBucketException: CodeBucket "UK" is not a valid option! in /data/vendor/spryker/kernel/src/Spryker/Shared/Kernel/CodeBucket/Config/AbstractCodeBucketConfig.php:47 Stack trace: #0 /data/vendor/spryker/kernel/src/Spryker/Shared/Kernel/CodeBucket/Config/AbstractCodeBucketConfig.php(27): Spryker\Shared\Kernel\CodeBucket\Config\AbstractCodeBucketConfig->assertCodeBucket('UK') #1 /data/vendor/spryker/kernel/src/Spryker/Shared/Kernel/CodeBucket/Config/CodeBucketConfig.php(40): Spryker\Shared\Kernel\CodeBucket\Config\AbstractCodeBucketConfig->getCurrentCodeBucket() #2 /data/vendor/spryker/config/src/Spryker/Shared/Config/Application/Environment.php(93): Spryker\Shared\Kernel\CodeBucket\Config\CodeBucketConfig->getCurrentCodeBucket() #3 /data/vendor/spryker/config/src/Spryker/Shared/Config/Application/Environment.php(25): Spryker\Shared\Config\Application\Environment::defineCodeBucket() #4 /data/public/Zed/index.php(14): Spryker\Shared\Config\Application\E in /data/vendor/spryker/kernel/src/Spryker/Shared/Kernel/CodeBucket/Config/AbstractCodeBucketConfig.php on line 47

I am not sure what else I need to do to make it work. Any pointers and help will be highly appreciated .

Best regards,
Vivek

Comments