9
9
use Magento \CatalogInventory \Helper \Minsaleqty as MinsaleqtyHelper ;
10
10
use Magento \Framework \App \Config \ScopeConfigInterface ;
11
11
use Magento \Catalog \Model \ProductTypes \ConfigInterface ;
12
+ use Magento \Store \Model \ScopeInterface ;
12
13
use Magento \Store \Model \StoreManagerInterface ;
13
14
14
15
/**
@@ -131,6 +132,8 @@ class Configuration implements StockConfigurationInterface
131
132
protected $ storeManager ;
132
133
133
134
/**
135
+ * Configuration constructor.
136
+ *
134
137
* @param ConfigInterface $config
135
138
* @param ScopeConfigInterface $scopeConfig
136
139
* @param MinsaleqtyHelper $minsaleqtyHelper
@@ -149,7 +152,7 @@ public function __construct(
149
152
}
150
153
151
154
/**
152
- * { @inheritdoc}
155
+ * @inheritdoc
153
156
*/
154
157
public function getDefaultScopeId ()
155
158
{
@@ -159,6 +162,8 @@ public function getDefaultScopeId()
159
162
}
160
163
161
164
/**
165
+ * Is Qty Type Ids
166
+ *
162
167
* @param int|null $filter
163
168
* @return array
164
169
*/
@@ -182,6 +187,8 @@ public function getIsQtyTypeIds($filter = null)
182
187
}
183
188
184
189
/**
190
+ * Is Qty
191
+ *
185
192
* @param int $productTypeId
186
193
* @return bool
187
194
*/
@@ -201,25 +208,29 @@ public function canSubtractQty($store = null)
201
208
{
202
209
return $ this ->scopeConfig ->isSetFlag (
203
210
self ::XML_PATH_CAN_SUBTRACT ,
204
- \ Magento \ Store \ Model \ ScopeInterface::SCOPE_STORE ,
211
+ ScopeInterface::SCOPE_STORE ,
205
212
$ store
206
213
);
207
214
}
208
215
209
216
/**
217
+ * Get Min Qty
218
+ *
210
219
* @param null|string|bool|int|\Magento\Store\Model\Store $store
211
220
* @return float
212
221
*/
213
222
public function getMinQty ($ store = null )
214
223
{
215
224
return (float )$ this ->scopeConfig ->getValue (
216
225
self ::XML_PATH_MIN_QTY ,
217
- \ Magento \ Store \ Model \ ScopeInterface::SCOPE_STORE ,
226
+ ScopeInterface::SCOPE_STORE ,
218
227
$ store
219
228
);
220
229
}
221
230
222
231
/**
232
+ * Get Min Sale Qty
233
+ *
223
234
* @param null|string|bool|int|\Magento\Store\Model\Store $store
224
235
* @param int $customerGroupId
225
236
* @return float
@@ -230,27 +241,31 @@ public function getMinSaleQty($store = null, $customerGroupId = null)
230
241
}
231
242
232
243
/**
244
+ * Get Max Sale Qty
245
+ *
233
246
* @param null|string|bool|int|\Magento\Store\Model\Store $store
234
247
* @return float|null
235
248
*/
236
249
public function getMaxSaleQty ($ store = null )
237
250
{
238
251
return (float )$ this ->scopeConfig ->getValue (
239
252
self ::XML_PATH_MAX_SALE_QTY ,
240
- \ Magento \ Store \ Model \ ScopeInterface::SCOPE_STORE ,
253
+ ScopeInterface::SCOPE_STORE ,
241
254
$ store
242
255
);
243
256
}
244
257
245
258
/**
259
+ * Get Notify Stock Qty
260
+ *
246
261
* @param null|string|bool|int|\Magento\Store\Model\Store $store
247
262
* @return float
248
263
*/
249
264
public function getNotifyStockQty ($ store = null )
250
265
{
251
266
return (float ) $ this ->scopeConfig ->getValue (
252
267
self ::XML_PATH_NOTIFY_STOCK_QTY ,
253
- \ Magento \ Store \ Model \ ScopeInterface::SCOPE_STORE ,
268
+ ScopeInterface::SCOPE_STORE ,
254
269
$ store
255
270
);
256
271
}
@@ -264,22 +279,24 @@ public function getNotifyStockQty($store = null)
264
279
*/
265
280
public function getEnableQtyIncrements ($ store = null )
266
281
{
267
- return ( bool ) $ this ->scopeConfig ->getValue (
282
+ return $ this ->scopeConfig ->isSetFlag (
268
283
self ::XML_PATH_ENABLE_QTY_INCREMENTS ,
269
- \ Magento \ Store \ Model \ ScopeInterface::SCOPE_STORE ,
284
+ ScopeInterface::SCOPE_STORE ,
270
285
$ store
271
286
);
272
287
}
273
288
274
289
/**
290
+ * Get Qty Increments
291
+ *
275
292
* @param null|string|bool|int|\Magento\Store\Model\Store $store
276
293
* @return float
277
294
*/
278
295
public function getQtyIncrements ($ store = null )
279
296
{
280
297
return (float )$ this ->scopeConfig ->getValue (
281
298
self ::XML_PATH_QTY_INCREMENTS ,
282
- \ Magento \ Store \ Model \ ScopeInterface::SCOPE_STORE ,
299
+ ScopeInterface::SCOPE_STORE ,
283
300
$ store
284
301
);
285
302
}
@@ -294,7 +311,7 @@ public function getBackorders($store = null)
294
311
{
295
312
return (int ) $ this ->scopeConfig ->getValue (
296
313
self ::XML_PATH_BACKORDERS ,
297
- \ Magento \ Store \ Model \ ScopeInterface::SCOPE_STORE ,
314
+ ScopeInterface::SCOPE_STORE ,
298
315
$ store
299
316
);
300
317
}
@@ -309,7 +326,7 @@ public function getManageStock($store = null)
309
326
{
310
327
return (int ) $ this ->scopeConfig ->isSetFlag (
311
328
self ::XML_PATH_MANAGE_STOCK ,
312
- \ Magento \ Store \ Model \ ScopeInterface::SCOPE_STORE ,
329
+ ScopeInterface::SCOPE_STORE ,
313
330
$ store
314
331
);
315
332
}
@@ -325,7 +342,7 @@ public function getCanBackInStock($store = null)
325
342
{
326
343
return $ this ->scopeConfig ->isSetFlag (
327
344
self ::XML_PATH_CAN_BACK_IN_STOCK ,
328
- \ Magento \ Store \ Model \ ScopeInterface::SCOPE_STORE ,
345
+ ScopeInterface::SCOPE_STORE ,
329
346
$ store
330
347
);
331
348
}
@@ -340,7 +357,7 @@ public function isShowOutOfStock($store = null)
340
357
{
341
358
return $ this ->scopeConfig ->isSetFlag (
342
359
self ::XML_PATH_SHOW_OUT_OF_STOCK ,
343
- \ Magento \ Store \ Model \ ScopeInterface::SCOPE_STORE ,
360
+ ScopeInterface::SCOPE_STORE ,
344
361
$ store
345
362
);
346
363
}
@@ -355,14 +372,13 @@ public function isAutoReturnEnabled($store = null)
355
372
{
356
373
return $ this ->scopeConfig ->isSetFlag (
357
374
self ::XML_PATH_ITEM_AUTO_RETURN ,
358
- \ Magento \ Store \ Model \ ScopeInterface::SCOPE_STORE ,
375
+ ScopeInterface::SCOPE_STORE ,
359
376
$ store
360
377
);
361
378
}
362
379
363
380
/**
364
- * Get 'Display product stock status' option value
365
- * Shows if it is necessary to show product stock status ('in stock'/'out of stock')
381
+ * Display product stock status. Shows if it is necessary to show product stock status in stock/out of stock.
366
382
*
367
383
* @param null|string|bool|int|\Magento\Store\Model\Store $store
368
384
* @return bool
@@ -371,12 +387,14 @@ public function isDisplayProductStockStatus($store = null)
371
387
{
372
388
return $ this ->scopeConfig ->isSetFlag (
373
389
self ::XML_PATH_DISPLAY_PRODUCT_STOCK_STATUS ,
374
- \ Magento \ Store \ Model \ ScopeInterface::SCOPE_STORE ,
390
+ ScopeInterface::SCOPE_STORE ,
375
391
$ store
376
392
);
377
393
}
378
394
379
395
/**
396
+ * Get Default Config Value
397
+ *
380
398
* @param string $field
381
399
* @param null|string|bool|int|\Magento\Store\Model\Store $store
382
400
* @return string|null
@@ -385,20 +403,22 @@ public function getDefaultConfigValue($field, $store = null)
385
403
{
386
404
return $ this ->scopeConfig ->getValue (
387
405
self ::XML_PATH_ITEM . $ field ,
388
- \ Magento \ Store \ Model \ ScopeInterface::SCOPE_STORE ,
406
+ ScopeInterface::SCOPE_STORE ,
389
407
$ store
390
408
);
391
409
}
392
410
393
411
/**
412
+ * Get Stock Threshold Qty
413
+ *
394
414
* @param null|string|bool|int|\Magento\Store\Model\Store $store
395
415
* @return string|null
396
416
*/
397
417
public function getStockThresholdQty ($ store = null )
398
418
{
399
419
return $ this ->scopeConfig ->getValue (
400
420
self ::XML_PATH_STOCK_THRESHOLD_QTY ,
401
- \ Magento \ Store \ Model \ ScopeInterface::SCOPE_STORE ,
421
+ ScopeInterface::SCOPE_STORE ,
402
422
$ store
403
423
);
404
424
}
0 commit comments