magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Subscription Related Event Observer in Payment Module

Open ThomasNegeli opened this issue 10 months ago • 3 comments

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 avatar Mar 27 '24 16:03 ThomasNegeli

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.

ThomasNegeli avatar Mar 28 '24 12:03 ThomasNegeli

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 avatar Mar 28 '24 12:03 Frank-Magmodules

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 avatar Apr 03 '24 11:04 Frank-Magmodules

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!

Frank-Magmodules avatar Apr 18 '24 14:04 Frank-Magmodules