You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to get the virtual categories a product belongs to. The background is that we have a product export which contains the categories of the product. Currently only the normal categories are retrieved based on \Magento\Catalog\Model\Product::getCategoryIds but we would like to include virtual categories as well.
Is there any possible way?
I couldn't come up with a way on how to get the virtual categories based on the product so I currently try to just iterate over all virtual categories and try to get their products. I am trying the following code based on #2268:
But this gives me the following error most of the time:
Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\Collection\Interceptor::addQueryFilter(): Argument #1 ($queryFilter) must be of type Smile\ElasticsuiteCore\Search\Request\QueryInterface, null given
$this->filterProvider->getQueryFilter($category) often returns null the Problem is that null is returned from the cache. I wonder why and tried to set 'virtual_rule' to null to force the generation. With setting it to null it works in way more cases but still not all. What's the issue here?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am trying to get the virtual categories a product belongs to. The background is that we have a product export which contains the categories of the product. Currently only the normal categories are retrieved based on
\Magento\Catalog\Model\Product::getCategoryIds
but we would like to include virtual categories as well.Is there any possible way?
I couldn't come up with a way on how to get the virtual categories based on the product so I currently try to just iterate over all virtual categories and try to get their products. I am trying the following code based on #2268:
But this gives me the following error most of the time:
$this->filterProvider->getQueryFilter($category)
often returnsnull
the Problem is that null is returned from the cache. I wonder why and tried to set'virtual_rule'
tonull
to force the generation. With setting it tonull
it works in way more cases but still not all. What's the issue here?Beta Was this translation helpful? Give feedback.
All reactions