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 have question How to get information about product by his id, without information about abstra

USLUHK9SQ
USLUHK9SQ Posts: 92 πŸ§‘πŸ»β€πŸš€ - Cadet

hi,
I have question
How to get information about product by his id, without information about abstract or concrete.

Comments

  • Ievgen Varava
    Ievgen Varava Sprykee Posts: 154 πŸ§‘πŸ»β€πŸš€ - Cadet

    you basically got three sources of data for products - storage, search and database.

  • Ievgen Varava
    Ievgen Varava Sprykee Posts: 154 πŸ§‘πŸ»β€πŸš€ - Cadet

    if existing clients or facade methods does not satisfy your requirements, you'll need to override existing code or provide your own

  • USLUHK9SQ
    USLUHK9SQ Posts: 92 πŸ§‘πŸ»β€πŸš€ - Cadet

    from product-storage (zed) exactly

  • Ievgen Varava
    Ievgen Varava Sprykee Posts: 154 πŸ§‘πŸ»β€πŸš€ - Cadet

    on Zed you should be looking into database though

  • USLUHK9SQ
    USLUHK9SQ Posts: 92 πŸ§‘πŸ»β€πŸš€ - Cadet

    i need example code (or where i can find this) how to call to database (orm) from zed

  • Ievgen Varava
    Ievgen Varava Sprykee Posts: 154 πŸ§‘πŸ»β€πŸš€ - Cadet

    I think that \Spryker\Zed\Product\Business\ProductFacade::findProductAbstractById() is a good starting point

  • USLUHK9SQ
    USLUHK9SQ Posts: 92 πŸ§‘πŸ»β€πŸš€ - Cadet

    okay, thanks alot

  • USLUHK9SQ
    USLUHK9SQ Posts: 92 πŸ§‘πŸ»β€πŸš€ - Cadet

    i create my own module and in listener i add:

    $productFacade = new ProductFacade();
    $findProductAbstractById = $productFacade->findProductAbstractById($productInfo[0]['id_product_abstract']);
    

    in (id_product_abstract) i set correctly id
    but in response i got:
    "findProductAbstractById\":[]

  • Ievgen Varava
    Ievgen Varava Sprykee Posts: 154 πŸ§‘πŸ»β€πŸš€ - Cadet

    you should get

    ProductAbstractTransfer
    

    or null if product is not found