/** * {@inheritdoc} */ public function getCurrentCategoryIdentifier() { if ($this->hasCurrentCategory()) { return $this->currentCategory->getId(); } return null; }
/** * Returns a dataset of products recommended for category * * @param CategoryInterface $category * * @return array */ public function getProductRecommendationsForCategory(CategoryInterface $category) { $conditions = new ConditionsCollection(); $conditions->add(new Eq('category', $category->getId())); return $this->dataset->getResult('datagrid', ['limit' => 3, 'order_by' => 'name', 'order_dir' => 'asc', 'conditions' => $conditions]); }