Closed eugene-shab closed 9 months ago
i add product to the order callback in this way. i've tried different order type also.
Our code:
Request comes into this file Updater::update()
. Originally (before fix) in update()
we have a condition like:
if (!$createNewSubscriptionAtCheckout) {
$subscriptionInterval = null;
}
in row 50
i see a $subscriptionOption = 'onetime_purchase'
after that on row 57-58
clean up the variable$subscriptionInterval
, this caused a problem for Fulfils order request.
i think we require additional check and condition for is item fulfils (see the fix)
Request comes to updater and $subscriptionOption = 'subscription'
so, on the row 50
code met condition and set variable $createNewSubscriptionOnCheckout = true
,
The interval was not cleaned.
The Request comes to updater and $subscriptionOption = 'onetime_purchase'
, on line 50
the variable doesn't met a condition.
The interval will be cleaned.
@eugene-shab What about the case of a recurring order placed by SP via the M2 API?
@eugene-shab What about the case of a recurring order placed by SP via the M2 API?
@garthbrantley As I can see recurring order placed by SP via the M2 API working by another callstack and saving Interval
{
"subscription_option": {
"is_fulfilling": true,
"subscription_id": 4790338,
"interval": "Weekly",
"reorder_ordinal": "1",
"item_added_by_subscribe_pro": true,
"item_fulfils_subscription": true,
"next_order_date": "2023-12-07"
},
"qty": 1
}
Updater::update()
didn't call
feat: Fix interval value for callback orders.
Refs: #182