Ich versuche von einer Produkt Page die Tags ( Namen ) vom Artikel zu bekommen, da im Default nur die ID des Tags ausgeben wird.
Dafür hing ich mich an folgendes How-To:
Ich bekomme aber nichts zurück, bzw einfach nur ein leeres data array. Das ist meine kleine Method
public function getAllTags(ProductPageLoadedEvent $event): void
{
// returns an array of the tagIds
$tagIds = $event->getPage()->getProduct()->getTagIds();
$criteria = new Criteria();
$criteria->addFilter(new EqualsAnyFilter('id', $tagIds));
$tagResults = $this->productRepository->searchIds($criteria, $event->getContext());
dd($tagResults);
$event->getPage()->addExtension('tags', null);
}
$tagIds gibt zurück:
array:1 [▼
0 => "61d6b646da614e2c98925857e7efb27a"
]
Final gibt $tagResults zurück:
Shopware\Core\Framework\DataAbstractionLayer\Search\IdSearchResult {#5934 ▼
#data: []
#total: 0
#criteria: Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria {#5312 ▶}
#context: Shopware\Core\Framework\Context {#1812 ▶}
#ids: []
#extensions: []
}
Hat jemand eine Ahnung was ich falsch mache?