From 03af9c8130f7ebd6d502f7e77f9f956a9f3f6913 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20FOUCRET?= Date: Fri, 16 Feb 2018 15:32:26 +0100 Subject: [PATCH 1/2] Avoid duplicate category fields. --- .../Indexer/Fulltext/Datasource/CategoryData.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/module-elasticsuite-virtual-category/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/CategoryData.php b/src/module-elasticsuite-virtual-category/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/CategoryData.php index c893303f3..0663a7aa6 100644 --- a/src/module-elasticsuite-virtual-category/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/CategoryData.php +++ b/src/module-elasticsuite-virtual-category/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/CategoryData.php @@ -81,15 +81,21 @@ private function getBaseSelect($productIds, $storeId) private function getVirtualSelect($productIds) { $select = $this->getConnection()->select() - ->from(['cpi' => $this->getTable(ProductPositionResourceModel::TABLE_NAME)], []) - ->where('cpi.product_id IN(?)', $productIds) + ->from(['p' => $this->getTable(ProductPositionResourceModel::TABLE_NAME)], []) + ->joinLeft( + ['cpi' => $this->getTable('catalog_category_product_index')], + 'p.product_id = cpi.product_id AND p.category_id = cpi.category_id', + [] + ) + ->where('p.product_id IN(?)', $productIds) + ->where('cpi.product_id IS NULL') ->columns( [ - 'category_id' => 'cpi.category_id', - 'product_id' => 'cpi.product_id', + 'category_id' => 'p.category_id', + 'product_id' => 'p.product_id', 'is_parent' => new \Zend_Db_Expr('0'), 'is_virtual' => new \Zend_Db_Expr('1'), - 'position' => 'cpi.position', + 'position' => 'p.position', ] ); From c6897d98a00183792d3deeb4a16dd4cc31a73d5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20FOUCRET?= Date: Fri, 16 Feb 2018 15:42:00 +0100 Subject: [PATCH 2/2] Fix an artifact in the sorter UI. --- .../view/adminhtml/web/css/source/_module.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/module-elasticsuite-catalog/view/adminhtml/web/css/source/_module.less b/src/module-elasticsuite-catalog/view/adminhtml/web/css/source/_module.less index e5ddf41b7..49a25d9dd 100644 --- a/src/module-elasticsuite-catalog/view/adminhtml/web/css/source/_module.less +++ b/src/module-elasticsuite-catalog/view/adminhtml/web/css/source/_module.less @@ -49,7 +49,7 @@ margin: 20px 0 0; li { - box-sizing: border-box; + box-sizing: content-box; float: left; border: 1px solid #d6d6d6; background: #FFFFFF;