Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mage-os-ci committed Dec 19, 2023
2 parents 0f8abc1 + a51f56a commit 5adf8b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
16 changes: 6 additions & 10 deletions ProductPriceDataExporter/Model/Provider/ProductPrice.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ private function addCustomerGroupPrices(
$prices[$key] = $fallbackPrice;

// override customer group specific fields
$this->addDiscountPrice($prices[$key], 'group', $priceValue, $pricePercentage, true);
$this->addDiscountPrice($prices[$key], 'group', $priceValue, $pricePercentage);
}

if ($row['rule_price'] !== null) {
Expand Down Expand Up @@ -315,22 +315,18 @@ private function buildKey(int|string $productId, int|string $websiteId, int|stri
* @param string $code
* @param ?string $price
* @param ?string $percentage
* @param bool $override
* @return void
*/
private function addDiscountPrice(
array &$priceFeedItem,
string $code,
string $price = null,
string $percentage = null,
bool $override = false
string $percentage = null
): void {
if ($override) {
foreach ($priceFeedItem['discounts'] as &$discount) {
if ($discount['code'] === $code) {
$this->setPriceOrPercentageDiscount($discount, $price, $percentage);
return;
}
foreach ($priceFeedItem['discounts'] as &$discount) {
if ($discount['code'] === $code) {
$this->setPriceOrPercentageDiscount($discount, $price, $percentage);
return;
}
}
unset($discount);
Expand Down
1 change: 1 addition & 0 deletions ProductPriceDataExporter/Test/_files/simple_products.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
->setName('Simple Product With Special Price')
->setSku('simple_product_with_special_price')
->setPrice(100.10)
->setData('special_price', 45.00)
->setWebsiteIds([$firstWebsiteId, $secondWebsiteId])
->setStatus(Status::STATUS_ENABLED);
$productRepository->save($product2);
Expand Down

0 comments on commit 5adf8b4

Please sign in to comment.