Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shipment Processor only Imports a single InventoryUnit per LineItem #73

Open
cesartalves opened this issue Jun 28, 2021 · 1 comment
Open
Labels

Comments

@cesartalves
Copy link
Contributor

cesartalves commented Jun 28, 2021

This bug was first discovered by @aamyot

SolidusImporter::Processors::Shipment creates only one InventoryUnit per LineItem, when it should, in fact, create InventoryUnits equivalent to the LineItem amount.

Here's a suggestion:

def inventory_units
    sku = line_items_attributes[:sku]

    return [] if sku.blank?

    quantity = line_items_attributes[:quantity].to_i
    [{ sku: sku }] * quantity
  end
@stale
Copy link

stale bot commented Aug 28, 2021

This issue has been automatically marked as stale because it has not had recent activity. It might be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Aug 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant