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..

Hello guys, I wonder what's the easiest way to get an `ItemTransfer` from a `SpySalesOrderItem`. The

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

Hello guys,
I wonder what's the easiest way to get an ItemTransfer from a SpySalesOrderItem. The fromArray / toArray solution doesn't seem to work since the ItemTransfer has many different properties. Or am I using the wrong transfer object for the SpySalesOrderItem?

Welcome!

It looks like you're new here. Sign in or register to get started.

Comments

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

    question is how did you get item entity (SpySalesOrderItem), if you start from just id, you might want to check sales facade, it probably has some method, that takes item id as argument and returns ItemTransfer

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

    exact implementation is there:

    \Spryker\Zed\Sales\Business\Model\Order\OrderHydrator::hydrateOrderItemTransfer()
    
  • Posts: 80 πŸ§‘πŸ»β€πŸš€ - Cadet

    Thank you. I will check this. πŸ‘

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

    it's deprecated

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

    I think it's because multi shipping functionality. But item hydration must be the same I guess

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

    that might be true

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

    Ok, I found the hydrate method but nothing in the SalesFacade. I guess I have to add a method for the conversion myself then. Thanks a lot.

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

    well, that's non of my business, but how did you end up with SpySalesOrderItem?

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

    I created a custom module. The facade of this module is used in the OMS and the OMS passes on SpySalesOrderItem[] and SpySalesOrder.
    The Spryker docs say for communication between modules use transfer objects, so I want to refactor it this way.

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

    I see

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

    It bugs me how they use Transfers everywhere except OMS plugins

Welcome!

It looks like you're new here. Sign in or register to get started.