Wrong logic exporting product prices with tax excluded #43
Open
Description
When exporting products in the feed that are set to excluding tax in the Magento admin panel, prices are exported without tax instead of with tax added.
Feed builder logic in app/code/Meta/Catalog/Model/Product/Tools is wrong:
$price = $this->systemConfig->isPriceInclTax()
? $this->catalogHelper->getTaxPrice($product, $product->getPrice(), true)
: $product->getPrice();
If prices in Magento are set to "Catalog Prices" = "Excluding Tax" (Store > Configuration > Sales > Tax > Calculation Settings), the function call to
$this->systemConfig->isPriceInclTax()
will return false and the product price is exported as is.
Instead, it should return the price with taxed added.
The correct logic should be:
$price = $this->systemConfig->isPriceInclTax()
? $product->getPrice()
: $this->catalogHelper->getTaxPrice($product, $product->getPrice(), true);
Found in functions getProductPrice() and getProductSalePrice().
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
- [Screenshots, logs or description]
Actual result (*)
- [Screenshots, logs or description]
Metadata
Assignees
Labels
No labels