Shopware: получить идентификатор текущей категории из обработчика компонентов мира покупок? - PullRequest
0 голосов
/ 09 февраля 2020
// ...

use Shopware\Bundle\EmotionBundle\ComponentHandler\ComponentHandlerInterface;

class MyComponentHandler implements ComponentHandlerInterface
{
    public function prepare(PrepareDataCollection $collection, Element $element, ShopContextInterface $context)
    {
        // Here is where I need the ID of the current/active category - the category that the user
        // is viewing and that includes this component in its shopping world
    }

    // ...
}

Можно ли вообще этого достичь, и если да, то как бы это сделать?

...