Skip to content

Commit 5bcdb45

Browse files
MAGETWO-96377: Product unassigned from category when store view order is changed
1 parent 577d470 commit 5bcdb45

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/code/Magento/Catalog/Model/ResourceModel/Category.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,14 +486,14 @@ public function getProductsPosition($category)
486486
$this->getCategoryProductTable(),
487487
['product_id', 'position']
488488
)->where(
489-
'catalog_category_product.category_id = ?',
489+
"{$this->getTable('catalog_category_product')}.category_id = ?",
490490
$category->getId()
491491
);
492492
$websiteId = $category->getStore()->getWebsiteId();
493493
if ($websiteId) {
494494
$select->join(
495495
['product_website' => $this->getTable('catalog_product_website')],
496-
'product_website.product_id = catalog_category_product.product_id',
496+
"product_website.product_id = {$this->getTable('catalog_category_product')}.product_id",
497497
[]
498498
)->where(
499499
'product_website.website_id = ?',

app/code/Magento/Catalog/Model/ResourceModel/Category/Flat.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -699,14 +699,14 @@ public function getProductsPosition($category)
699699
$this->getTable('catalog_category_product'),
700700
['product_id', 'position']
701701
)->where(
702-
'catalog_category_product.category_id = ?',
702+
"{$this->getTable('catalog_category_product')}.category_id = ?",
703703
$category->getId()
704704
);
705705
$websiteId = $category->getStore()->getWebsiteId();
706706
if ($websiteId) {
707707
$select->join(
708708
['product_website' => $this->getTable('catalog_product_website')],
709-
'product_website.product_id = catalog_category_product.product_id',
709+
"product_website.product_id = {$this->getTable('catalog_category_product')}.product_id",
710710
[]
711711
)->where(
712712
'product_website.website_id = ?',

0 commit comments

Comments
 (0)