diff --git a/src/module-elasticsuite-catalog/Model/ResourceModel/Product/FilterableAttribute/Category/Collection.php b/src/module-elasticsuite-catalog/Model/ResourceModel/Product/FilterableAttribute/Category/Collection.php index 0cbf2dc21..f411c14a7 100644 --- a/src/module-elasticsuite-catalog/Model/ResourceModel/Product/FilterableAttribute/Category/Collection.php +++ b/src/module-elasticsuite-catalog/Model/ResourceModel/Product/FilterableAttribute/Category/Collection.php @@ -126,8 +126,9 @@ private function getAdditionalColumns() */ private function getMaxPosition() { + $fullTableName = $this->getResource()->getTable(self::CATEGORY_FILTER_CONFIG_TABLE); $categoryPositionSelect = $this->getConnection()->select() - ->from(self::CATEGORY_FILTER_CONFIG_TABLE, []) + ->from($fullTableName, []) ->columns(['category_max_position' => new \Zend_Db_Expr('MAX(position)')]) ->where($this->getConnection()->quoteInto('entity_id = ?', (int) $this->category->getId())); @@ -167,7 +168,8 @@ private function getAdditionalTableFields() { $type = $this->eavConfig->getEntityType(\Magento\Catalog\Model\Product::ENTITY); $table = $type->getAdditionalAttributeTable(); - $tableDesc = $this->getConnection()->describeTable($table); + $fullTableName = $this->getResource()->getTable($table); + $tableDesc = $this->getConnection()->describeTable($fullTableName); $tableFields = array_keys($tableDesc); return array_diff($tableFields, $this->overridenColumns); diff --git a/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Search/Position.php b/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Search/Position.php index ed5b01e9f..c1d3df5ba 100644 --- a/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Search/Position.php +++ b/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Search/Position.php @@ -60,8 +60,9 @@ public function __construct( */ public function getByProductIds(array $productIds, $storeId) { + $searchQueryTable = $this->getTable('search_query'); $select = $this->getBaseSelect() - ->joinInner($this->getTable('search_query'), 'main_table.query_id = search_query.query_id', []) + ->joinInner($searchQueryTable, "main_table.query_id = {$searchQueryTable}.query_id", []) ->where('product_id IN(?)', $productIds) ->where('store_id = ?', $storeId) ->columns(['product_id', 'query_id', 'position']);