Skip to content

Commit b9ca779

Browse files
author
Roman Lytvynenko
committed
MC-33512: Special price API only works with schedule update
1 parent 2ffd8a7 commit b9ca779

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

dev/tests/api-functional/testsuite/Magento/Catalog/Api/SpecialPriceStorageTest.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public function testDelete(array $data)
117117
$product = $productRepository->get($data['sku'], true);
118118
$product->setData('special_price', $data['price']);
119119
$product->setData('special_from_date', $data['price_from']);
120-
if (array_key_exists('price_to', $data)) {
120+
if ($data['price_to']) {
121121
$product->setData('special_to_date', $data['price_to']);
122122
}
123123
$productRepository->save($product);
@@ -163,7 +163,7 @@ public function updateData(): array
163163
'store_id' => 0,
164164
'sku' => self::VIRTUAL_PRODUCT_SKU,
165165
'price_from' => $fromDate,
166-
'price_to' => $toDate,
166+
'price_to' => $toDate
167167
]
168168
],
169169
[
@@ -172,7 +172,8 @@ public function updateData(): array
172172
'price' => 31337,
173173
'store_id' => 0,
174174
'sku' => self::VIRTUAL_PRODUCT_SKU,
175-
'price_from' => $fromDate
175+
'price_from' => $fromDate,
176+
'price_to' => false
176177
]
177178
],
178179
];
@@ -196,7 +197,7 @@ public function deleteData(): array
196197
'store_id' => 0,
197198
'sku' => self::SIMPLE_PRODUCT_SKU,
198199
'price_from' => $fromDate,
199-
'price_to' => $toDate,
200+
'price_to' => $toDate
200201
]
201202
],
202203
[
@@ -205,7 +206,8 @@ public function deleteData(): array
205206
'price' => 3057,
206207
'store_id' => 0,
207208
'sku' => self::SIMPLE_PRODUCT_SKU,
208-
'price_from' => $fromDate
209+
'price_from' => $fromDate,
210+
'price_to' => false
209211
]
210212
],
211213
];

0 commit comments

Comments
 (0)