Skip to content
This repository has been archived by the owner on Sep 17, 2020. It is now read-only.

id_order_invoice not set for CDiscount fees #368

Closed
ghost opened this issue May 23, 2018 · 1 comment
Closed

id_order_invoice not set for CDiscount fees #368

ghost opened this issue May 23, 2018 · 1 comment

Comments

@ghost
Copy link

ghost commented May 23, 2018

Expected behaviour

When CDiscount fees are set for an order, the corresponding virtual product should appears on the order details and in the order invoice.

Actual behaviour

CDiscount fees are visible only in the order details but not in the invoice.
This is due to id_order_invoice set at 0 when inserting FDG-ShoppingFlux.

Steps to reproduce the behaviour

Create an order with fees

@ghost
Copy link
Author

ghost commented May 23, 2018

Example of fix to be tested:

We retrieve $idOrderInvoice before inserting the FDG.

            $idOrderInvoice = Db::getInstance()->getValue('
            SELECT `id_order_invoice`
            FROM `'._DB_PREFIX_.'order_invoice`
            WHERE `id_order` =  '.(int)$id_order);

            $fdgInsertFields = array(
                'id_order' => (int) $id_order,
                'id_order_invoice' => empty($idOrderInvoice) ? 0 : (int)$idOrderInvoice,

@ghost ghost mentioned this issue May 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants