mollie / magento2

Mollie Payments for Magento 2
https://www.mollie.com
Other
98 stars 49 forks source link

Subscription Related Event Observer in Payment Module #764

Closed ThomasNegeli closed 2 months ago

ThomasNegeli commented 3 months ago

https://github.com/mollie/magento2/blob/ad83c2a4cb5dab2dcfb6abff9e1fd66e9561e439/Observer/SalesQuoteItemSetProduct/SetSubscriptionDataOnBuyRequest.php#L48

Hi @Frank-Magmodules, what is the purpose of this event observer? The observer is fired on reorder functionality, not when the subscription item is added to the cart. This results in the fact that every order item becomes a subscription item in the reordered cart, if the underlying product has a subscription configuration but also allows one time purchases. What is the usecase behind this functionality?

ThomasNegeli commented 3 months ago

This codepart is also not relevant if you do not have a subscription module in place https://github.com/mollie/magento2/blob/master/Plugin/Sales/AddRecurringData.php I think it would be better to move this code to the mollie/magento2-subscription repository. In our case, I had to disable the event observer and the plug-in, because some order_item configurations did not have the purchase attribute on the buyRequest JSON.

Frank-Magmodules commented 3 months ago

Hello again @ThomasNegeli, thank you for posting this question and observation on this. I'll take care of it and provide you with a useful answer shortly!

Frank-Magmodules commented 3 months ago

Hi There @ThomasNegeli ,

Thank you for your patience on this one. That this code lives in the main repository and not in the subscriptions repository is done on behalf of the request of a partner. This allows them to place subscription orders through their platform. Nevertheless, we've made an improvement on this issue that will be in the next release. I'll keep this issue open until then. Thanks again!

Frank-Magmodules commented 2 months ago

Hi @ThomasNegeli , as promised we've addressed this in our newest release, v2.37.0. I'll mark this as resolved for now, but feel free to reach out if you need any more help. Thanks once again!