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 everyone, with Product-api module I can read abstract product, but, how can I read concrete produ

U01UHQE5Z27
U01UHQE5Z27 Posts: 57 πŸ§‘πŸ»β€πŸš€ - Cadet

Hi everyone, with Product-api module I can read abstract product, but, how can I read concrete products? I can't find the method o module to do this

Comments

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

    Have you tried GET /concrete-products/{concreteProductId}?

  • U01UHQE5Z27
    U01UHQE5Z27 Posts: 57 πŸ§‘πŸ»β€πŸš€ - Cadet

    I am developing a ZED module, can I make that request from ZED? , I am using ProductApiResourcePlugin this plugin right now, wich module I must use for this?

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

    Ah, sorry, misunderstood the initial question.
    spryker/product-api was never released and most probably will be deprecated soonish in favor of a new set of backoffice APIs.

    Maybe @UQK3ZPJEN or @UKJSE6T47 know the answer for this particular module.

  • U01UHQE5Z27
    U01UHQE5Z27 Posts: 57 πŸ§‘πŸ»β€πŸš€ - Cadet

    yes please, if anyone can help me with this, I am a little lost, basically I need this, I am in zed module and need to read concrete products, is there another module i can use for this? or how I can read concrete products?

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    Hey Daniel, what exactly are you trying to achieve? How does requirement sound?

  • U01UHQE5Z27
    U01UHQE5Z27 Posts: 57 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited August 2021

    Hi Andriy, what I am trying to do is this.

    I create a module in ZED, in this module I make a susbcriber/listener to product's events (create/update/delete), in the listeneter handler I need to read all the data from the concrete product which was created, updated or deleted and send it to an external rest API (I make this request with Guzzle) .

    But I dont know how to read the concrete product.

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    Then you don’t need a Zed API to get information about the product. All you need to do - is to provide a product facade (\Spryker\Zed\Product\Business\ProductFacade) as a dependency to the module that reads information / sends it to the external system and use it to load information about the product.

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    zed modules (when it comes to the business layer) can easily communicate with each other via dependencies to each other facades and plugins. They don’t interact via the REST API

  • U01UHQE5Z27
    U01UHQE5Z27 Posts: 57 πŸ§‘πŸ»β€πŸš€ - Cadet

    let me check this "\Spryker\Zed\Product\Business\ProductFacade" I am not using an REST API to read the product, I found "ProductApiResourcePlugin" and read whit this, but does not read concrete products only abstract

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    ProductApiResourcePlugin is for the API. You can simply check btw, how ProductApiResourcePlugin is getting product’s data πŸ˜‰

  • U01UHQE5Z27
    U01UHQE5Z27 Posts: 57 πŸ§‘πŸ»β€πŸš€ - Cadet

    Thanks for your help the ProductFacade did the work

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    awesome πŸ’ͺ

  • U01UHQE5Z27
    U01UHQE5Z27 Posts: 57 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited August 2021

    Hi @UKJSE6T47, another question about this,

    If I launch the event from console like this

    "docker/sdk console event:trigger:listener PVXDataStorageListener id=2675"

    everything works fine.

    but when I update a concrete product from ZED the event does not lauch, how can I verify the event has been lauched?

  • U01UHQE5Z27
    U01UHQE5Z27 Posts: 57 πŸ§‘πŸ»β€πŸš€ - Cadet

    I added the subscriber in EventDependencyProvider/

    getEventSubscriberCollection()
    {
    /////////

    $eventSubscriberCollection->add(newΒ PVXDataStorageEventSubscriber());

      ////////
    

    }

    with this events

    "Entity.spy_product.create"
    "Entity.spy_product.update"
    "Entity.spy_product.delete"

    Am I missing something?

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    Sure you might miss something. Please try to check the documentation steps described here: https://documentation.spryker.com/docs/publish-and-synchronization-reference
    You don’t need the whole pub&sync implementation, but subscribing to events - is part of it