MultiSafepay / Magento2Msp

MultiSafepay plugin for Magento 2 (Deprecated) see: https://github.com/MultiSafepay/magento2
Open Software License 3.0
29 stars 25 forks source link

Undo cancel does not work due to getItemsCollection (magento 2.2.6) #81

Closed lennartbee closed 6 years ago

lennartbee commented 6 years ago

When a customer uncancels an order the order status remains 'pending' due to the orderitems that are still canceled. This happens in Magento 2.2.6. For some reason saving the orderitems in Connect.php does not work in combination with getItemsCollection. As a workaround I replaced line 1134 of Connect.php with: foreach ($order->getAllVisibleItems() as $item) { After this, the order items save again on uncancel. I do not know the exact difference with getItemsCollection and how this will affect uncancels with parent/child products.

Jasper-MultiSafepay commented 6 years ago

I would not advise using getAllVisibleItems as it would only show parent products. https://github.com/magento/magento2/blob/2.2/app/code/Magento/Sales/Model/Order.php#L1361

Seems to be caused by the additional save at https://github.com/MultiSafepay/Magento2Msp/blob/1.6.1/Model/Connect.php#L1128 We're looking into this, but removing the save at line 1128 should also solve this.

royvanos commented 6 years ago

We're experiencing this as well, we have to manually set qty_canceled and tax_canceled to 0 in the sales_order_item table to get rid of the canceled status for order items.

Jasper-MultiSafepay commented 6 years ago

This issue is solved in the current release 1.6.2 Could you perform an update of our plugin?

JonkRuud commented 6 years ago

As this issue is solved in release 1.6.2 we will close this ticket.