Skip to content

fix: update product.sales during migration#190

Open
Dennis Garding (DennisGarding) wants to merge 2 commits into
trunkfrom
12748/update-product-sales
Open

fix: update product.sales during migration#190
Dennis Garding (DennisGarding) wants to merge 2 commits into
trunkfrom
12748/update-product-sales

Conversation

@DennisGarding
Copy link
Copy Markdown
Contributor

@DennisGarding Dennis Garding (DennisGarding) commented May 20, 2026

Closes: shopware/shopware#12748

  • Recalculates product.sales after order migration based on persisted live order line items.
  • Covers remigration cases by updating both previously and currently affected products.

Comment thread src/Migration/Service/ProductSalesUpdater.php
AND order_line_item.version_id = :liveVersion
AND order_line_item.product_version_id = :liveVersion
AND order_line_item.type = :lineItemType
AND state_machine_state.technical_name != :cancelledState
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there other state we need to exclude? refunded, returned ...

EntityWriterInterface $entityWriter,
EntityDefinition $definition,
private readonly StructNormalizer $structNormalizer,
private readonly ProductSalesUpdater $productSalesUpdater,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Break. So please also update the UPGRADE.md and use bang notation for the commit: fix!: ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrated orders are not included in the ‘Sales’ field in the product overview.

3 participants