shoppingflux / shoppingfluxexport

7 stars 7 forks source link

Undefined property ShoppingFkuxExport::$id_address_invoice #418

Open ghost opened 6 years ago

ghost commented 6 years ago

Expected behaviour

The feed should be generated without notice.

Actual behaviour

In some specific case, a notice is triggered when generating the feed. In these lines:

        $this->id_address_delivery = 0;
        $carrier_tax = Tax::getCarrierTaxRate((int)$carrier->id, (int)$this->{$configuration['PS_TAX_ADDRESS_TYPE']});

When PS_TAX_ADDRESS_TYPE is set as id_address_invoice, then the value is not defined. However, the getCarrierTaxRate method doesn't require this parameter in PS 1.6 and 1.7.

We have to check in other versions of PrestaShop. If this is not required then we can simply remove this parameter. We need however to check if the default value null has the same effect than the defined value 0.

Steps to reproduce the behaviour

Set the PS_TAX_ADDRESS_TYPE as id_address_invoice and try to generate the feed with notice activated.