diff --git a/src/Model/AttributeDbProvider.php b/src/Model/AttributeDbProvider.php index 2b237a6..13e0caf 100644 --- a/src/Model/AttributeDbProvider.php +++ b/src/Model/AttributeDbProvider.php @@ -62,13 +62,15 @@ public function getProductAttributes(): array $fieldsUsedInQuery = $this->queryFields->getFieldsUsedInQuery(); $connection = $this->connection->getConnection(); $placeHolders = str_repeat('?,', count($fieldsUsedInQuery) - 1) . '?'; - $sql = "SELECT eav_attribute.attribute_code -FROM eav_attribute -WHERE eav_attribute.attribute_id IN ( - SELECT catalog_eav_attribute.attribute_id - FROM catalog_eav_attribute - WHERE catalog_eav_attribute.is_filterable = 1 -) AND eav_attribute.attribute_code IN ($placeHolders)"; + $eavAttribute = $this->connection->getTableName('eav_attribute'); + $catalogEavAttribute = $this->connection->getTableName('catalog_eav_attribute'); + $sql = "SELECT {$eavAttribute}.attribute_code + FROM {$eavAttribute} + WHERE {$eavAttribute}.attribute_id IN ( + SELECT {$catalogEavAttribute}.attribute_id + FROM {$catalogEavAttribute} + WHERE {$catalogEavAttribute}.is_filterable = 1 + ) AND {$eavAttribute}.attribute_code IN ($placeHolders)"; $query = $connection->query($sql, array_keys($fieldsUsedInQuery)); return $query->fetchAll(\PDO::FETCH_COLUMN); diff --git a/src/Model/Variant/Collection.php b/src/Model/Variant/Collection.php index 3163a16..ba96a4e 100755 --- a/src/Model/Variant/Collection.php +++ b/src/Model/Variant/Collection.php @@ -224,7 +224,7 @@ protected function getChildCollectionMapAndList(): array { $conn = $this->connection->getConnection(); $select = $conn->select() ->from( - ['s' => 'catalog_product_super_link'], + ['s' => $this->connection->getTableName('catalog_product_super_link')], ['product_id', 'parent_id'] ) ->where('s.parent_id IN (?)', $parentIds);