Skip to content

Commit ca97943

Browse files
author
Ganin, Roman(rganin)
committed
Merge pull request #178 from magento-troll/bugfix-GA
[Troll & Dragons] Bugfixes
2 parents 8041c32 + b8a22ae commit ca97943

34 files changed

+180
-233
lines changed

app/code/Magento/CatalogImportExport/Model/Import/Product.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1945,7 +1945,7 @@ protected function _saveStockItem()
19451945
$row['product_id'] = $this->skuProcessor->getNewSku($rowData[self::COL_SKU])['entity_id'];
19461946
$productIdsToReindex[] = $row['product_id'];
19471947

1948-
$row['website_id'] = $this->stockConfiguration->getDefaultWebsiteId();
1948+
$row['website_id'] = $this->stockConfiguration->getDefaultScopeId();
19491949
$row['stock_id'] = $this->stockRegistry->getStock($row['website_id'])->getStockId();
19501950

19511951
$stockItemDo = $this->stockRegistry->getStockItem($row['product_id'], $row['website_id']);

app/code/Magento/CatalogInventory/Api/Data/StockInterface.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ interface StockInterface extends ExtensibleDataInterface
1515
{
1616
const STOCK_ID = 'stock_id';
1717

18-
const WEBSITE_ID = 'website_id';
19-
2018
const STOCK_NAME = 'stock_name';
2119

2220
/**
@@ -34,21 +32,6 @@ public function getStockId();
3432
*/
3533
public function setStockId($stockId);
3634

37-
/**
38-
* Retrieve website identifier
39-
*
40-
* @return int
41-
*/
42-
public function getWebsiteId();
43-
44-
/**
45-
* Retrieve website identifier
46-
*
47-
* @param int $websiteId
48-
* @return $this
49-
*/
50-
public function setWebsiteId($websiteId);
51-
5235
/**
5336
* Retrieve stock name
5437
*

app/code/Magento/CatalogInventory/Api/Data/StockItemInterface.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ interface StockItemInterface extends ExtensibleDataInterface
1717

1818
const ITEM_ID = 'item_id';
1919
const PRODUCT_ID = 'product_id';
20-
const WEBSITE_ID = 'website_id';
2120
const STOCK_ID = 'stock_id';
2221
const QTY = 'qty';
2322
const IS_QTY_DECIMAL = 'is_qty_decimal';
@@ -77,21 +76,6 @@ public function getProductId();
7776
*/
7877
public function setProductId($productId);
7978

80-
/**
81-
* Retrieve Website Id
82-
*
83-
* @return int|null
84-
*/
85-
public function getWebsiteId();
86-
87-
/**
88-
* Set Website Id
89-
*
90-
* @param int $websiteId
91-
* @return $this
92-
*/
93-
public function setWebsiteId($websiteId);
94-
9579
/**
9680
* Retrieve stock identifier
9781
*

app/code/Magento/CatalogInventory/Api/Data/StockStatusInterface.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ interface StockStatusInterface extends ExtensibleDataInterface
1717
* Stock status object data keys
1818
*/
1919
const PRODUCT_ID = 'product_id';
20-
const WEBSITE_ID = 'website_id';
2120
const STOCK_ID = 'stock_id';
2221
const QTY = 'qty';
2322
const STOCK_STATUS = 'stock_status';
@@ -36,17 +35,6 @@ public function getProductId();
3635
*/
3736
public function setProductId($productId);
3837

39-
/**
40-
* @return int
41-
*/
42-
public function getWebsiteId();
43-
44-
/**
45-
* @param int $websiteId
46-
* @return $this
47-
*/
48-
public function setWebsiteId($websiteId);
49-
5038
/**
5139
* @return int
5240
*/

app/code/Magento/CatalogInventory/Api/StockConfigurationInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
interface StockConfigurationInterface
1313
{
1414
/**
15-
* Retrieve Default Website ID
15+
* Retrieve Default Scope ID
1616
*
1717
* @return int
1818
*/
19-
public function getDefaultWebsiteId();
19+
public function getDefaultScopeId();
2020

2121
/**
2222
* @param int $filter

app/code/Magento/CatalogInventory/Api/StockCriteriaInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ interface StockCriteriaInterface extends \Magento\Framework\Api\CriteriaInterfac
2020
public function addCriteria(\Magento\CatalogInventory\Api\StockCriteriaInterface $criteria);
2121

2222
/**
23-
* Add website filter to collection
23+
* Add scope filter to collection
2424
*
25-
* @param int $website
25+
* @param int $scope
2626
* @return bool
2727
*/
28-
public function setWebsiteFilter($website);
28+
public function setScopeFilter($scope);
2929
}

app/code/Magento/CatalogInventory/Api/StockIndexInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
interface StockIndexInterface
1313
{
1414
/**
15-
* Rebuild stock index of the given website
15+
* Rebuild stock index of the given scope
1616
*
1717
* @param int $productId
18-
* @param int $websiteId
18+
* @param int $scopeId
1919
* @return bool
2020
*/
21-
public function rebuild($productId = null, $websiteId = null);
21+
public function rebuild($productId = null, $scopeId = null);
2222
}

app/code/Magento/CatalogInventory/Api/StockItemCriteriaInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ public function setStockStatus($storeId = null);
3636
public function setStockFilter($stock);
3737

3838
/**
39-
* Add website filter to collection
39+
* Add scope filter to collection
4040
*
41-
* @param int $website
41+
* @param int $scope
4242
* @return bool
4343
*/
44-
public function setWebsiteFilter($website);
44+
public function setScopeFilter($scope);
4545

4646
/**
4747
* Add product filter to collection

app/code/Magento/CatalogInventory/Api/StockManagementInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ interface StockManagementInterface
1616
*
1717
* @param int $productId
1818
* @param float $qty
19-
* @param int $websiteId
19+
* @param int $scopeId
2020
* @return bool
2121
*/
22-
public function backItemQty($productId, $qty, $websiteId = null);
22+
public function backItemQty($productId, $qty, $scopeId = null);
2323
}

app/code/Magento/CatalogInventory/Api/StockRegistryInterface.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,68 +12,68 @@
1212
interface StockRegistryInterface
1313
{
1414
/**
15-
* @param int $websiteId
15+
* @param int $scopeId
1616
* @return \Magento\CatalogInventory\Api\Data\StockInterface
1717
*/
18-
public function getStock($websiteId = null);
18+
public function getStock($scopeId = null);
1919

2020
/**
2121
* @param int $productId
22-
* @param int $websiteId
22+
* @param int $scopeId
2323
* @return \Magento\CatalogInventory\Api\Data\StockItemInterface
2424
*/
25-
public function getStockItem($productId, $websiteId = null);
25+
public function getStockItem($productId, $scopeId = null);
2626

2727
/**
2828
* @param string $productSku
29-
* @param int $websiteId
29+
* @param int $scopeId
3030
* @return \Magento\CatalogInventory\Api\Data\StockItemInterface
3131
* @throws \Magento\Framework\Exception\NoSuchEntityException
3232
*/
33-
public function getStockItemBySku($productSku, $websiteId = null);
33+
public function getStockItemBySku($productSku, $scopeId = null);
3434

3535
/**
3636
* @param int $productId
37-
* @param int $websiteId
37+
* @param int $scopeId
3838
* @return \Magento\CatalogInventory\Api\Data\StockStatusInterface
3939
*/
40-
public function getStockStatus($productId, $websiteId = null);
40+
public function getStockStatus($productId, $scopeId = null);
4141

4242
/**
4343
* @param string $productSku
44-
* @param int $websiteId
44+
* @param int $scopeId
4545
* @return \Magento\CatalogInventory\Api\Data\StockStatusInterface
4646
* @throws \Magento\Framework\Exception\NoSuchEntityException
4747
*/
48-
public function getStockStatusBySku($productSku, $websiteId = null);
48+
public function getStockStatusBySku($productSku, $scopeId = null);
4949

5050
/**
5151
* Retrieve Product stock status
5252
*
5353
* @param int $productId
54-
* @param int $websiteId
54+
* @param int $scopeId
5555
* @return int
5656
*/
57-
public function getProductStockStatus($productId, $websiteId = null);
57+
public function getProductStockStatus($productId, $scopeId = null);
5858

5959
/**
6060
* @param string $productSku
61-
* @param int $websiteId
61+
* @param int $scopeId
6262
* @return int
6363
* @throw \Magento\Framework\Exception\NoSuchEntityException
6464
*/
65-
public function getProductStockStatusBySku($productSku, $websiteId = null);
65+
public function getProductStockStatusBySku($productSku, $scopeId = null);
6666

6767
/**
6868
* Retrieves a list of SKU's with low inventory qty
6969
*
70-
* @param int $websiteId
70+
* @param int $scopeId
7171
* @param float $qty
7272
* @param int $currentPage
7373
* @param int $pageSize
7474
* @return \Magento\CatalogInventory\Api\Data\StockStatusCollectionInterface
7575
*/
76-
public function getLowStockItems($websiteId, $qty, $currentPage = 1, $pageSize = 0);
76+
public function getLowStockItems($scopeId, $qty, $currentPage = 1, $pageSize = 0);
7777

7878
/**
7979
* @param string $productSku

app/code/Magento/CatalogInventory/Api/StockStateInterface.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,56 +13,56 @@ interface StockStateInterface
1313
{
1414
/**
1515
* @param int $productId
16-
* @param int $websiteId
16+
* @param int $scopeId
1717
* @return bool
1818
*/
19-
public function verifyStock($productId, $websiteId = null);
19+
public function verifyStock($productId, $scopeId = null);
2020

2121
/**
2222
* @param int $productId
23-
* @param int $websiteId
23+
* @param int $scopeId
2424
* @return bool
2525
*/
26-
public function verifyNotification($productId, $websiteId = null);
26+
public function verifyNotification($productId, $scopeId = null);
2727

2828
/**
2929
* @param int $productId
3030
* @param float $itemQty
3131
* @param float $qtyToCheck
3232
* @param float $origQty
33-
* @param int $websiteId
33+
* @param int $scopeId
3434
* @return int
3535
*/
36-
public function checkQuoteItemQty($productId, $itemQty, $qtyToCheck, $origQty, $websiteId = null);
36+
public function checkQuoteItemQty($productId, $itemQty, $qtyToCheck, $origQty, $scopeId = null);
3737

3838
/**
3939
* Check quantity
4040
*
4141
* @param int $productId
4242
* @param float $qty
43-
* @param int $websiteId
43+
* @param int $scopeId
4444
* @throws \Magento\Framework\Exception\LocalizedException
4545
* @return bool
4646
*/
47-
public function checkQty($productId, $qty, $websiteId = null);
47+
public function checkQty($productId, $qty, $scopeId = null);
4848

4949
/**
5050
* Returns suggested qty that satisfies qty increments and minQty/maxQty/minSaleQty/maxSaleQty conditions
5151
* or original qty if such value does not exist
5252
*
5353
* @param int $productId
5454
* @param float $qty
55-
* @param int $websiteId
55+
* @param int $scopeId
5656
* @return float
5757
*/
58-
public function suggestQty($productId, $qty, $websiteId = null);
58+
public function suggestQty($productId, $qty, $scopeId = null);
5959

6060
/**
6161
* Retrieve stock qty whether product is composite or no
6262
*
6363
* @param int $productId
64-
* @param int $websiteId
64+
* @param int $scopeId
6565
* @return float
6666
*/
67-
public function getStockQty($productId, $websiteId = null);
67+
public function getStockQty($productId, $scopeId = null);
6868
}

app/code/Magento/CatalogInventory/Api/StockStatusCriteriaInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ interface StockStatusCriteriaInterface extends \Magento\Framework\Api\CriteriaIn
2020
public function addCriteria(\Magento\CatalogInventory\Api\StockStatusCriteriaInterface $criteria);
2121

2222
/**
23-
* Filter by website(s)
23+
* Filter by scope(s)
2424
*
25-
* @param int $website
25+
* @param int $scope
2626
* @return bool
2727
*/
28-
public function setWebsiteFilter($website);
28+
public function setScopeFilter($scope);
2929

3030
/**
3131
* Add product(s) filter

app/code/Magento/CatalogInventory/Model/Configuration.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,9 @@ public function __construct(
144144
}
145145

146146
/**
147-
* Retrieve Default Website ID
148-
*
149-
* @return int
147+
* {@inheritdoc}
150148
*/
151-
public function getDefaultWebsiteId()
149+
public function getDefaultScopeId()
152150
{
153151
return (int) $this->storeManager->getWebsite()->getId();
154152
}

app/code/Magento/CatalogInventory/Model/ResourceModel/Stock/Item/StockItemCriteria.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ public function setStockFilter($stock)
4545
/**
4646
* @inheritdoc
4747
*/
48-
public function setWebsiteFilter($website)
48+
public function setScopeFilter($scope)
4949
{
50-
$this->data['website_filter'] = $website;
50+
$this->data['website_filter'] = $scope;
5151
return true;
5252
}
5353

app/code/Magento/CatalogInventory/Model/ResourceModel/Stock/Status/StockStatusCriteria.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ public function __construct($mapper = '')
2727
/**
2828
* @inheritdoc
2929
*/
30-
public function setWebsiteFilter($website)
30+
public function setScopeFilter($scope)
3131
{
32-
$this->data['website_filter'] = $website;
32+
$this->data['website_filter'] = $scope;
3333
}
3434

3535
/**

app/code/Magento/CatalogInventory/Model/ResourceModel/Stock/StockCriteria.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ public function __construct($mapper = '')
2525
/**
2626
* @inheritdoc
2727
*/
28-
public function setWebsiteFilter($website)
28+
public function setScopeFilter($scope)
2929
{
30-
$this->data['website_filter'] = $website;
30+
$this->data['website_filter'] = $scope;
3131
return true;
3232
}
3333

0 commit comments

Comments
 (0)