47484950515253545556575859606162636465 * @throws NotFoundHttpException
*/
public function actionGuessPath($path)
{
if (preg_match('/all/', $path)) {
preg_match('/(.*?)\//', $path, $matches);
$subPath = $matches[1];
$category = Category::findByPath($subPath);
$subCategories = [];
foreach ($category->getChildren()->all() as $subCategory) {
$subCategories[] = $subCategory->id;
}
$products = $category->getProducts(array_merge(Yii::$app->request->get(), ['subcategories' => $subCategories]));
if (count($products['models']) > 0)
{
return $this->actionCategory($category, $products, Yii::$app->request->get());
}