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

Save reset stock in order line item custom field with refund #356

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

MelvinAchterhuis
Copy link

This PR makes it possible to keep track of the reset stock in Shopware through the API.

Screenshot 2022-06-01 at 15 54 25

When there are multiple refunds for a line item the resetStock gets added up.

@boxblinkracer
Copy link
Collaborator

Hi @MelvinAchterhuis
that is indeed a nice one.
thanks a lot for this

i run the pipe and merge it, could be that i need to adjust it a bit, ....we try to avoid direct custom field arrays, instead we use "attribute" classes to centralize the structure-building :)

@MelvinAchterhuis
Copy link
Author

Hi @boxblinkracer ,

Do you have an example with the "attribute" class? I will implement it + fix the failing test :)

@boxblinkracer
Copy link
Collaborator

hi
yes, like this
https://github.com/mollie/Shopware6/blob/master/src/Struct/Product/ProductAttributes.php
then one could simply say

$prodAtts = new ProductAttributes($productEntity);
$type = $prodAtts->getVoucherType();

@MelvinAchterhuis
Copy link
Author

@boxblinkracer , could you have another look at the PR?

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.

2 participants