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

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 I want to insert data in glossary module with the help of CSV file Can some one suggest me the be

Options
U042Q46D597
U042Q46D597 Posts: 26 🧑🏻‍🚀 - Cadet

Hi
I want to insert data in glossary module with the help of CSV file
Can some one suggest me the best way to do it ..?

Comments

  • Alberto Reyer
    Alberto Reyer Lead Spryker Solution Architect / Technical Director Posts: 690 🪐 - Explorer
    Options

    Adapt the data/import/common/common/glossary.csv and run docker/sdk console data:import:glossary

  • U042Q46D597
    U042Q46D597 Posts: 26 🧑🏻‍🚀 - Cadet
    Options

    I want to upload from back office button click
    as we have one button which will take CSV data and once we upload CSV file it should insert data into database

  • Alberto Reyer
    Alberto Reyer Lead Spryker Solution Architect / Technical Director Posts: 690 🪐 - Explorer
    Options

    There is no out of the box functionality to upload a glossary csv.
    But you can follow \Pyz\Zed\DataImport\Business\Model\Glossary\GlossaryWriterStep::execute to implement these functionality

  • U042Q46D597
    U042Q46D597 Posts: 26 🧑🏻‍🚀 - Cadet
    Options

    @UL6DGRULR
    Hi
    How do read CSV file from our Custom Controller
    Is there any best way to do it ?

  • Alberto Reyer
    Alberto Reyer Lead Spryker Solution Architect / Technical Director Posts: 690 🪐 - Explorer
    Options

    https://www.php.net/manual/en/function.fgetcsv.php#refsect1-function.fgetcsv-examples or you use the \Pyz\Zed\DataImport\Business\Reader\CsvReader that should be part of the B2C/B2B demoshop.
    I would just upload the glossary.csv to either a temporary storage (e.g.: /tmp) or if you have a shared file system available, like S3, to this one and pass the import task itself to DataImport module, which already provides all the necessary functionality to import a glossary.csv (use \Spryker\Zed\DataImport\Business\DataImportFacade::importByAction)