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 again, currently I introduced a new store which should be complete independent from the other sto

UPWG9AYH2
UPWG9AYH2 Posts: 509 🧑🏻‍🚀 - Cadet
edited January 2020 in Help

Hi again, currently I introduced a new store which should be complete independent from the other stores. Separate db, queue etc. just the same codebase. That works except for the store db entries itself … unfortunately on “data:import:stores” command just the keys in stores.php are read regardless if the stores have to do with each other or not. Is this just an importer issue or has this a deeper meaning?

Comments

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice

    Just a guess. Maybe you need to run commands using APPLICATION_STORE={store} console ...?

  • UPWG9AYH2
    UPWG9AYH2 Posts: 509 🧑🏻‍🚀 - Cadet

    Hi Valerii. The createStoreImporter() method unfortunately calls the

    Store::getInstance()->getAllowedStores()
    

    method which will allways return each store from the stores.php

  • UPWG9AYH2
    UPWG9AYH2 Posts: 509 🧑🏻‍🚀 - Cadet

    So for me it should be more like

    array_merge([Store::getInstance()->getStoreName()], Store::getInstance()->getStoresWithSharedPersistence())
    

    instead of

    Store::getInstance()->getAllowedStores()
    

    This will get the current store and all stores with shared persistence .. for them they should know from each other … for stores without shared persitence, only the current store gets imported

  • UPWG9AYH2
    UPWG9AYH2 Posts: 509 🧑🏻‍🚀 - Cadet

    So okay but then the whole import process get an error because in the csv files are store names that are not in each database now … the importer iterates over this lines and tries to fetch the store which will lead to an error … so i guess, the whole data:import process is intended for a setup where each database knows each store, even if they haven’t anything to do with each other … 🤔 strange …

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice

    Let's wait maybe someone will help here. Otherwise I'll forward this internally.

  • UPWG9AYH2
    UPWG9AYH2 Posts: 509 🧑🏻‍🚀 - Cadet

    Found a working solution: I just configured an extra directory for different demo data files via

    DataImportConstants::IMPORT_FILE_ROOT_PATH
    

    for each store. Since the products, customer etc. are different anyway for all the shops with different databases, this soloution works for me. I don’t know if this is the intended way …