Closed leonhelmus closed 2 years ago
I hope this could be fixed asap.
hi @RemcoWolterink are you still experiencing this issue at the latest version?
Not tested and at the moment less urgent for us. It was happening with configurable bundle products, but we are facing out those types.
Since it's not relevant anymore i will close the issue. Thanks for looking into it @Hnto
Issue Brief
What is the purpose of this issue? Explain the background context.
Environment
Steps to reproduce
This happens because of the following: When looking at the feed this happens because of the shared class variables for \Emico\TweakwiseExport\Model\Write\Products\Collection, named $this->entities. When looking at the method \Emico\TweakwiseExport\Model\Write\Products\CollectionDecorator\Children::addChild retrieves the same product once it's set. Although it probably shouldn't happen it also sets the class variable \Emico\TweakwiseExport\Model\Write\Products\ExportEntityChild $this->childOptions in the class variable \Emico\TweakwiseExport\Model\Write\Products\Collection, named $this->entities.
Because of this it overwrites the $this->childOptions everytime with new values. This way you can have a optionId that is not mend for that bundle.
Because of these issues it sometimes looks at another option from a other parent product id when using this method: \Emico\TweakwiseExport\Model\Write\Products\ExportEntityBundle::getStockItem. Because it uses the option settings of a other bundle instead of it's own option.
To me it looks like no child products can be shared for bundles. I don't know if this is also an issue for other composed products. But for me this sometimes shows a bundle on the frontend and other times not...
Also when looking at the method: \Emico\TweakwiseExport\Model\Write\Products\ExportEntityBundle
i think line 56 should go after line 60.
should be:
This way you do not overwrite the is_in_stock that was already set when the option is not required.
Actual result
It adds the bundles depending on the query sometimes settings of options that are mend for another bundle. Instead of required => true it sets required false.
Expected result
It should add the bundles on it's own options when it's using the same products as a other bundle instead of the options of another bundle.