'iutbay\yii2imagecache\ThumbAction',
];
}
public function actionIndex()
{
// $catalogs = Catalog::find()->where(['parent_id'=>'0'])->all();
$modelText = Page::find()->where(['translit'=>'home'])->one();
// $news = News::find()->orderBy('id DESC')->limit(4)->all();
// $products_new = Products::find()->where(['new'=>'1'])->orderBy('id DESC')->innerJoinWith(['cost'])->groupBy('id')->limit(4)->all();
// //print_r($products_new);
// $products_top = Products::find()->where(['top'=>'1'])->orderBy('id DESC')->innerJoinWith(['cost'])->groupBy('id')->limit(4)->all();
// //print_r($products_top);
// //$products_sale = Products::find()->where(['sale'=>'1'])->innerJoinWith(['cost'])->orderBy('id DESC')->limit(4)->all();
// $products_akciya = Products::find()->where(['akciya'=>'1'])->innerJoinWith(['cost'])->orderBy('id DESC')->limit(4)->all();
return $this->render('index', [
'text'=>$modelText,
// 'catalogs'=>$catalogs,
// 'news'=>$news,
// 'products_new'=>$products_new,
// 'products_top'=>$products_top,
// 'products_akciya'=>$products_akciya,
]);
}
public function actionError(){
return $this->render('error', [
'code'=>Yii::$app->errorHandler->exception->statusCode,
'message'=>Yii::$app->errorHandler->exception->getMessage(),
]);
}
public function actionPriceparam ()
{
$category_alias = Yii::$app->request->get('category');
$is_count = Yii::$app->request->get('count', false);
if ( !($category = CategorySearch::findByAlias($category_alias)))
{
throw new HttpException(404, 'Данной страницы не существует!');
}
$products = $category->products;
if ($is_count) {
print (count($products));
exit;
}
set_time_limit (0);
header ("Content-Type: text/xml");
print '';
print "";
print "" . date ("Y-m-d h:m") . "";
print "Rukzachok";
print "";
print "";
print "";
print "";
print "" . $category->category_id . "";
print "";
print "" . $category->name . "";
print "";
print "";
print "";
/** @var Product $product */
foreach ($products as $product) {
/** @var ProductVariant $variant */
foreach ($product->enabledVariants as $variant) {
print "- ";
print "" . htmlspecialchars($variant->product_variant_id) . "";
print "" . htmlspecialchars($product->category->category_id) . "";
print "" . $product->brand->name . "";
print "
" . htmlspecialchars($variant->sku) . "
";
print "" . htmlspecialchars(substr($category->name, 0, -2)) . " ";
print "" . htmlspecialchars($product->name) . " ";
print "" . $variant->name . " ";
print "" . htmlspecialchars($product->description) . "";
print "http://rukzachok.com.ua{$product->url}#{$variant->product_variant_id}";
print "http://rukzachok.com.ua{$variant->imageUrl}";
print "" . $variant->price . "";
print "" . $variant->price_old . "";
print "";
print "В наличии";
print "";
print " ";
}
}
print "";
print "";
}
public function actionPrice()
{
$category_alias = Yii::$app->request->get('category');
$is_count = Yii::$app->request->get('count', false);
if ( !($category = CategorySearch::findByAlias($category_alias)))
{
throw new HttpException(404, 'Данной страницы не существует!');
}
$products = $category->products;
if ($is_count) {
print (count($products));
exit;
}
//var_dump($products);die();
set_time_limit (0);
header ("Content-Type: text/xml");
print '';
print "";
print "" . date ("Y-m-d h:m") . "";
print "Rukzachok";
print "";
print "";
print "";
print "";
print "" . $category->category_id . "";
print "";
print "" . $category->name . "";
print "";
print "";
print "";
/** @var Product $product */
foreach ($products as $product)
{
/** @var ProductVariant $variant */
foreach ($product->enabledVariants as $variant) {
print "- ";
print "" . htmlspecialchars($variant->product_variant_id) . "";
print "" . htmlspecialchars($product->category->category_id) . "";
print "" . $product->brand->name . "";
print "
" . htmlspecialchars($variant->sku) . "
";
print "" . htmlspecialchars($product->name) . " ";
print "" . htmlspecialchars($product->description) . "";
print "http://rukzachok.com.ua{$product->url}#{$variant->product_variant_id}";
print "http://rukzachok.com.ua{$variant->imageUrl}";
print "" . $variant->price . "";
print "" . $variant->price_old . "";
print "";
print "В наличии";
print "";
print " ";
}
}
print "";
print "";
}
}