@@ -158,7 +158,8 @@ private function retrieveValidPrices(array $prices)
158
158
159
159
foreach ($ prices as $ key => $ price ) {
160
160
if (!$ price ->getSku () || in_array ($ price ->getSku (), $ failedSkus )) {
161
- $ errorMessage = 'The product that was requested doesn \'t exist. Verify the product and try again. ' ;
161
+ $ errorMessage = 'The product that was requested doesn \'t exist. Verify the product and try again. '
162
+ . 'Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo. ' ;
162
163
$ this ->addFailedItemPrice ($ price , $ key , $ errorMessage , []);
163
164
}
164
165
$ this ->checkStore ($ price , $ key );
@@ -184,14 +185,16 @@ private function retrieveValidPrices(array $prices)
184
185
private function checkStore (SpecialPriceInterface $ price , int $ key ): void
185
186
{
186
187
if ($ this ->catalogData ->isPriceGlobal () && $ price ->getStoreId () !== 0 ) {
187
- $ errorMessage = 'Could not change non global Price when price scope is global. ' ;
188
+ $ errorMessage = 'Could not change non global Price when price scope is global. '
189
+ . 'Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo. ' ;
188
190
$ this ->addFailedItemPrice ($ price , $ key , $ errorMessage , []);
189
191
}
190
192
191
193
try {
192
194
$ this ->storeRepository ->getById ($ price ->getStoreId ());
193
195
} catch (NoSuchEntityException $ e ) {
194
- $ errorMessage = 'Requested store is not found. ' ;
196
+ $ errorMessage = 'Requested store is not found. '
197
+ . 'Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo. ' ;
195
198
$ this ->addFailedItemPrice ($ price , $ key , $ errorMessage , []);
196
199
}
197
200
}
@@ -208,7 +211,8 @@ private function checkStore(SpecialPriceInterface $price, int $key): void
208
211
private function checkDate (SpecialPriceInterface $ price , $ value , $ label , $ key )
209
212
{
210
213
if ($ value && !$ this ->isCorrectDateValue ($ value )) {
211
- $ errorMessage = 'Invalid attribute %label = %priceTo. ' ;
214
+ $ errorMessage = 'Invalid attribute %label = %priceTo. '
215
+ . 'Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo. ' ;
212
216
$ this ->addFailedItemPrice ($ price , $ key , $ errorMessage , ['label ' => $ label ]);
213
217
}
214
218
}
@@ -226,7 +230,8 @@ private function checkDate(SpecialPriceInterface $price, $value, $label, $key)
226
230
private function checkPrice (SpecialPriceInterface $ price , int $ key ): void
227
231
{
228
232
if (null === $ price ->getPrice () || $ price ->getPrice () < 0 ) {
229
- $ errorMessage = 'Invalid attribute Price = %price. ' ;
233
+ $ errorMessage = 'Invalid attribute Price = %price. '
234
+ . 'Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo. ' ;
230
235
$ this ->addFailedItemPrice ($ price , $ key , $ errorMessage , ['price ' => $ price ->getPrice ()]);
231
236
}
232
237
}
@@ -256,14 +261,7 @@ private function addFailedItemPrice(
256
261
$ additionalInfo ['priceFrom ' ] = $ price ->getPriceFrom ();
257
262
$ additionalInfo ['priceTo ' ] = $ price ->getPriceTo ();
258
263
259
- $ this ->validationResult ->addFailedItem (
260
- $ key ,
261
- __ (
262
- $ message . ' Row ID: SKU = %SKU, Store ID: %storeId, Price From: %priceFrom, Price To: %priceTo. ' ,
263
- $ additionalInfo
264
- ),
265
- $ additionalInfo
266
- );
264
+ $ this ->validationResult ->addFailedItem ($ key , __ ($ message , $ additionalInfo ), $ additionalInfo );
267
265
}
268
266
269
267
/**
0 commit comments