Order items should store the SKU of the purchased entity

Created on 11 October 2018, about 6 years ago
Updated 9 October 2024, 3 months ago

After deletion of a variation my orderItems return false on getPurchasedEntity() which is correct because it doesn't exist anymore, The problem i have with this is that is need the variation sku and some other information like variation author of this variation for my export to an accounting program.

What is the way to go? Why can variation be deleted if the are still linked to an orderItem this wasn't in d7 commerce because of the deletion and missing variation i think this is kinda critical because after deletion you cant go back

Feature request
Status

Active

Version

3.0

Component

Order

Created by

🇳🇱Netherlands nickvanboven

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇩🇪Germany Anybody Porta Westfalica

    I agree it would make sense to store the SKU in order items for two reasons:

    • The main reason given above: Keeping a reference for the books, even if the product has been deleted in the past
    • Allow overriding the SKU for order items (=instances). We for example need this to store details of the configuration in the order item ID. In Drupal 7 that was possible, because the line item also stored the SKU. For example: The base SKU is: mywood123-100x200cm - which is later used by the client as unique identifier for the individual manufactured product. Drupal Commerce comes very handy for configurable products, so I don't think we'll be the only ones with a useful use-case.

    So clear +1 on the idea of storing the SKU in line items at the moment they are added to cart!

    Moving this to 3.0.x-dev!

Production build 0.71.5 2024