Skip to content

Stock of Backend Variants is increased instead of reduced when ordering. #258

@swisschocolate

Description

@swisschocolate

Bug Report

Current Behavior
When ordering a product with backend variants and stock handling in variants enabled, the stock gets increased,

Expected behavior/output
Stock has to be reduced.

Environment

  • TYPO3 version: 12.4.26
  • cart version: 10.0.0
  • Is your TYPO3 installation set up with Composer (Composer Mode): no

Possible Solution
Correct sign in Extcode\CartProducts\Domain\DoctrineRepository\Product\BeVariantRepository\addQuantityToStock

->set('stock', $currentStock - $quantity)
should be:
->set('stock', $currentStock + $quantity)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions