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..

Hello all, I am trying to remove the 'DE' and 'AT' store in the spryker b2b demo shop and replace

U048WDEP3R7
U048WDEP3R7 Posts: 217 πŸ§‘πŸ»β€πŸš€ - Cadet

Hello all,

I am trying to remove the 'DE' and 'AT' store in the spryker b2b demo shop and replace it with an 'INT' store. So far, I have tried changing the deploy.dev.yml file to

version: '0.1'
namespace: xyz_b2b_dev
tag: dev
environment: docker.dev
image:
    environment: { SPRYKER_PRODUCT_CONFIGURATOR_HOST: date-time-configurator-example.spryker.local, SPRYKER_PRODUCT_CONFIGURATOR_PORT: 80, SPRYKER_AOP_INFRASTRUCTURE: '{ "SPRYKER_MESSAGE_BROKER_HTTP_SENDER_CONFIG": {}, "SPRYKER_MESSAGE_BROKER_SQS_RECEIVER_CONFIG": {} }', SPRYKER_AOP_APPLICATION: '{ "APP_DOMAINS": [], "STORE_NAME_REFERENCE_MAP": {}, "APP_CATALOG_SCRIPT_URL": "" }', SPRYKER_AOP_AUTHENTICATION: '{ "AUTH0_CUSTOM_DOMAIN": "", "AUTH0_CLIENT_ID": "", "AUTH0_CLIENT_SECRET": "" }', SPRYKER_DEFAULT_STORE: INT, SPRYKER_ACTIVE_STORES: INT }
imports:
    de: { template: _base.deploy.template.yml, parameters: { env: local, store: INT, region: INT, namespace_kvs: 0, namespace_zed: 1, namespace_yves: 2, domain: xyz.local } }

And added a store_config_INT.php file but it doesn't seem to be working. Can someone please advice? As I can not find anything useful in the Spryker's documentation.

Comments

  • U01F7P3D9NH
    U01F7P3D9NH Posts: 60 πŸ§‘πŸ»β€πŸš€ - Cadet

    Basics fist: Have you added the store to the stores.php ? Removing DE store will also need a adjustment in default_store.php You can check table spy_store as well.

  • U048WDEP3R7
    U048WDEP3R7 Posts: 217 πŸ§‘πŸ»β€πŸš€ - Cadet

    @U01F7P3D9NH I assumed stores.php is reading SPRYKER_ACTIVE_STORES constant and then reads the configuration from /stores/store_config_INT.php which I already created.

  • U01F7P3D9NH
    U01F7P3D9NH Posts: 60 πŸ§‘πŸ»β€πŸš€ - Cadet

    Ah, I see. There is some new approach in the stores and config files which we donΒ΄t have in our project. But still I see the definition of $stores[] which should define your storefront, Would you mind sharing the stores.php or explain how you removed the other stores? Without adjustments it should be kinda search for 'DE' and replace it with 'INT' thing

  • U048WDEP3R7
    U048WDEP3R7 Posts: 217 πŸ§‘πŸ»β€πŸš€ - Cadet

    @U01F7P3D9NH yes of course. This is stores.php

    <?php declare(strict_types = 1);
    
    use Aep\Shared\ActiveStore\ActiveStoreConstants;
    use Spryker\Shared\Kernel\Store;
    
    // ----------------------------------------------------------------------------
    // ------------------------------ STORE-TEMPLATE ------------------------------
    // ----------------------------------------------------------------------------
    $template = require __DIR__ . ActiveStoreConstants::ACTIVE_STORE_CONFIG_FILE_PREFIX . 'default' . ActiveStoreConstants::ACTIVE_STORE_CONFIG_FILE_EXTENSION;
    $environmentActiveStores = (string)getenv('SPRYKER_ACTIVE_STORES');
    $stores = [];
    if (!empty($environmentActiveStores)) {
        $activeStores = array_map('trim', explode(',', $environmentActiveStores));
        foreach ($activeStores as $store) {
            $stores[$store] = $template;
            $fileName = __DIR__ . ActiveStoreConstants::ACTIVE_STORE_CONFIG_FILE_PREFIX . $store . ActiveStoreConstants::ACTIVE_STORE_CONFIG_FILE_EXTENSION;
            if (file_exists($fileName)) {
                $stores[$store] = include $fileName;
            }
        }
    }
    
    if (empty($stores) && !empty(Store::getDefaultStore())) {
        $fileName = __DIR__ . ActiveStoreConstants::ACTIVE_STORE_CONFIG_FILE_PREFIX . Store::getDefaultStore() . ActiveStoreConstants::ACTIVE_STORE_CONFIG_FILE_EXTENSION;
        $stores[Store::getDefaultStore()] = file_exists($fileName) ? include $fileName : $template;
    }
    
    return $stores;
    
  • U01F7P3D9NH
    U01F7P3D9NH Posts: 60 πŸ§‘πŸ»β€πŸš€ - Cadet

    Just to make sure variables are set correct, I would add the store like at the end of https://github.com/spryker-shop/b2b-demo-shop/blob/master/config/Shared/stores.php

  • U01F7P3D9NH
    U01F7P3D9NH Posts: 60 πŸ§‘πŸ»β€πŸš€ - Cadet

    Also double check the config/install/ deploy files

  • U048WDEP3R7
    U048WDEP3R7 Posts: 217 πŸ§‘πŸ»β€πŸš€ - Cadet

    @U01F7P3D9NH Right. But basically I want to remove all other stores and set INT as default.

  • U01F7P3D9NH
    U01F7P3D9NH Posts: 60 πŸ§‘πŸ»β€πŸš€ - Cadet

    Yeah, I got that. But still you need a definition of the INT one. In the demo shop you have three stores and all have a definition of context. So you remove f.e. AT and US and rename the stuff of the DE is what you need, not getting rid of everything

  • U048WDEP3R7
    U048WDEP3R7 Posts: 217 πŸ§‘πŸ»β€πŸš€ - Cadet

    @U01F7P3D9NH Thanks. Do I have to reset docker to make it work?