Calling Developers!
We are reenergizing our code contribution process! Learn More

What is the easiest way to remove the entire product demo data from spryker b2b demoshop?

chandan.k
chandan.k Senior Software Developer Spryker Solution Partner Posts: 5 🧑🏻‍🚀 - Cadet
edited September 2023 in Spryker Development

What is the easiest way to remove the entire product demo data from spryker b2b demoshop?

Answers

  • Hidran Arias
    Hidran Arias Senior Technical Trainer Sprykee Posts: 71 🏛 - Council (mod)

    In DataImport/DataImportDependencyProvider.php you have the importer plugins defined.

    You could comment out the ones you don't want to use.

    Then there is Zed/Installer/InstallerDependencyprovider.php where you have plugins that run after data has been imported. Please feel free to comment out the ones referring to data you're not importing.
    This could be one solution.
    Let's see if someone else has a quickest way to do it!

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,005 ⚖️ - Guardians (admin)

    Heyhey @chandan.k ,

    if you mean by "remove" to clean up the demo-shop-setup then I have the following suggestion for you:

    1. Use the content of the following example for your full_EU and/or full_US import config: https://github.com/spryker-shop/b2b-demo-shop/blob/202307.0/data/import/common/minimal.yml
    2. Add b2b demo-data to be able to login with test-user sonia:
        #6. B2B Setup import
        - data_entity: company
          source : data/import/common/common/company.csv
        - data_entity: company-business-unit
          source : data/import/common/common/company_business_unit.csv
        - data_entity: company-unit-address
          source : data/import/common/common/company_unit_address.csv
        - data_entity: company-unit-address-label
          source : data/import/common/common/company_unit_address_label.csv
        - data_entity: company-unit-address-label-relation
          source : data/import/common/common/company_unit_address_label_relation.csv
        - data_entity: company-user
          source: data/import/common/common/company_user.csv
        - data_entity: company-business-unit-user
          source: data/import/common/common/company_business_unit_user.csv
        - data_entity: company-business-unit-address
          source: data/import/common/common/company_business_unit_address.csv
        - data_entity: company-role
          source : data/import/common/common/company_role.csv
        - data_entity: company-role-permission
          source : data/import/common/common/company_role_permission.csv
        - data_entity: company-user-role
          source : data/import/common/common/company_user_role.csv
        - data_entity: company-user-on-behalf
          source: data/import/common/common/company_user_on_behalf.csv
    

    3. Remove the Plugins here (because they fail without the product-label import) https://github.com/spryker-shop/b2b-demo-shop/blob/202307.0/src/Pyz/Zed/ProductLabel/ProductLabelDependencyProvider.php#L24

    4. Clean your data with docker/sdk clean-data

    5. Execute docker/sdk up --build --assets --data

    Please let us know if any of our suggestions helps you to solve the problem :)

    All the best,

    Florian