solidusio-contrib / solidus_importer

Solidus importer extension to migrate data from other eCommerce systems
BSD 3-Clause "New" or "Revised" License
15 stars 30 forks source link

Shipment Processor only Imports a single InventoryUnit per LineItem #73

Open cesartalves opened 3 years ago

cesartalves commented 3 years ago

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[bot] commented 3 years ago

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.