MultiSafepay / woocommerce

MultiSafepay WooCommerce plugin
https://docs.multisafepay.com/docs/woocommerce
10 stars 2 forks source link

Order item price is ignored, causing incorrect amounts to be invoiced #11

Closed Stoux closed 3 years ago

Stoux commented 3 years ago

Hi,

We've updated to version 4.x (currently on 4.1.2) and noticed that any modifications done to the price of an order item are completely ignored by the plugin. This block of code causes our problems: https://github.com/MultiSafepay/WooCommerce/blob/master/src/Services/ShoppingCartService.php#L79-L88

We've patched it out by replacing the whole block with just the $product_price = (float) $item->get_total() / (int) $item->get_quantity(); line.

See attached images: image image

danielcivit commented 3 years ago

Hello @Stoux

Thanks for reporting. This issue should be solved now with the latest release (version 4.1.5).

Could you upgrade to latest version 4.1.5 in a safe environment and test. If everything works properly now, you should be able to continue upgrading the plugin safely without introduce new changes by your self.