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 again, i had a weird issue that for our order export there was a hydrated sales order but no c

UPWG9AYH2
UPWG9AYH2 Posts: 509 🧑🏻‍🚀 - Cadet

Hello again,
i had a weird issue that for our order export there was a hydrated sales order but no corresponding customer exists anymore. That leads to an sales order transfer without any customer information. I resolved that but still have a question …
The problem was, that there is still a sales order record but without any corresponding customer in the spy_customer table anymore. Until now i thought that all data for sales order come from the sales order tables itself, but it seems that is not the case.
As a following step the customer_reference which is part of the spy_sales_order table gets deleted by the hydrateMissingCustomer() method too. So no customer information in the order transfer even if its there (customer_reference in spy_sales_order)

So what is the purpose of getting all data from the sales order except the customer itself?
What about the case, that a customer changed (or does not exist anymore as in my case) when the export starts much later? Wouldn’t that lead to wrong data?

Best

Comments

  • Unknown
    edited August 2020

    Hey Ingo! What exactly do you need from customer in order export?

  • If you’re interested in e-mail, name and other things related to customer then I think you need to use sales_order_address data. It’s really important for you I guess as it’s a data order was placed with.

  • UPWG9AYH2
    UPWG9AYH2 Posts: 509 🧑🏻‍🚀 - Cadet

    We need for example the customer reference for our export. This is indeed something that is applied to the sales_order but get unfortunately removed if the customer is missing. Like in our case: customer not existing anymore but we still need the customer_reference from the sales order to match the original customer even if he does not exist anymore

  • Hm, that’s interesting. How do you remove customers?

  • UPWG9AYH2
    UPWG9AYH2 Posts: 509 🧑🏻‍🚀 - Cadet

    Ah you mean, in spryker customers only get anonymized, right?
    At the moment we don’t remove customers. That is just something i experienced on my local dev system after i removed customers. But i can imagine for future process that can be relevant somehow. Maybe we don’t remove customers from the table but the customer_reference might not represent the old customer anymore … we decided to set the customer_reference to the same as in the ERPs customer number, which is also system wide unique in ERP. Like i said, nothing that happens actually, but we should keep in mind if somebody on the ERP side for example tries to recycle old customer numbers for new customers.