Jump to content

Edit History

qq2kk

qq2kk

The default "import product" doesn't delete the discount if the discount amount is empty, i tried to empty the table before import but it takes an hour to process the import which means there is an hour of time the shop will have incorrect price (price without discount).

Instead of checking whether there is a record in DB, i simply run the statement to delete the discounts of this product if CSV does not have a value for the discount price.

in AdminImportController.php

Quote

if ((isset($info['reduction_price']) && $info['reduction_price'] > 0) || (isset($info['reduction_percent']) && $info['reduction_percent'] > 0)) { ...

....

} else if (isset($info['reduction_price'])) {
            Db::getInstance()->delete('specific_price', 'id_product='.$product->id);
}

I don't know is there any better and appropriate fix for this. Please let me know if there is.

qq2kk

qq2kk

The default "import product" doesn't delete the discount if the discount amount is empty, i tried to empty the table before import but it takes an hour to process which means there is an hour of time the shop will have incorrect price.

Instead of checking whether there is a record in DB, i simply run the statement to delete the discounts of this product if CSV does not have a value for the discount price.

in AdminImportController.php

Quote

if ((isset($info['reduction_price']) && $info['reduction_price'] > 0) || (isset($info['reduction_percent']) && $info['reduction_percent'] > 0)) { ...

....

} else if (isset($info['reduction_price'])) {
            Db::getInstance()->delete('specific_price', 'id_product='.$product->id);
}

I don't know is there any better and appropriate fix for this. Please let me know if there is.

×
×
  • Create New...