shoppingflux / shoppingfluxexport

7 stars 7 forks source link

Take in consideration custom order reference #427

Open ghost opened 5 years ago

ghost commented 5 years ago

Expected behaviour

The order reference may change when the merchant is using custom order reference. In which case SQL requests should rely on the custom order reference.

Actual behaviour

PaymentModule is used to retrieve the order reference used to create the order. The custom order reference is (should) however changed from the hook called during order creation, and $payment->currentOrderReference is not updated accordingly.

We should instead rely on $psOrder->reference used in the _updatePrices function. As well the parameter $reference_order of this function become useless.

Steps to reproduce the behaviour

1 - System for custom order reference in place 2 - Order received 3 - Notice will be visible in the logs:

<b>Notice</b>:  Undefined variable: id_order_from_reference in <b>/var/www/[...]/shoppingfluxexport.php</b> on line <b>XYZ</b><br />

4 - Pricing and carriers will not be updated correctly