oc-shopaholic-plugin icon indicating copy to clipboard operation
oc-shopaholic-plugin copied to clipboard

[Orders for Shopaholic v1.22.1] Cart::onSetShippingType does not update cart data in database

Open pikanji opened this issue 5 years ago • 3 comments

\Lovata\OrdersShopaholic\Components\Cart::onSetShippingType returns cart data with updated shipping type information, but it does not save the new shipping type id to the database. Is this an expected behavior?

pikanji avatar Sep 18 '19 07:09 pikanji

Hi! There is no logic to save selected shipping type. I think you're right, we need to add saving of selected shipping type to database. This is useful feature.

kharanenka avatar Sep 19 '19 06:09 kharanenka

@kharanenka Thanks for your response. On second thought, I decided not to send pull request adding feature to save selected shipping type. Now I feel like Cart::onSetShippingType is intentionally not saving it to the DB, because there is a generic Ajax method Cart::onSaveData to save user's input including selected shipping type. It saves only properties specified in the sent data. I'm sorry for disturbing you with this issue.

But, if you think onSetShippingType should save it to DB, then I'll just send you my pull request for that.

pikanji avatar Sep 20 '19 03:09 pikanji

I will come back to this issue later. I think I need to think hard. Thank you for your activity.

kharanenka avatar Sep 20 '19 06:09 kharanenka