diff --git a/common/components/SmsSender.php b/common/components/SmsSender.php index f4efb63..226a0fc 100755 --- a/common/components/SmsSender.php +++ b/common/components/SmsSender.php @@ -14,14 +14,14 @@ class SmsSender extends Component public function send($tel, $text) { - $text = iconv('windows-1251', 'utf-8', htmlspecialchars($text)); + // $text = iconv('windows-1251', 'utf-8', htmlspecialchars($text)); $description = iconv('windows-1251', 'utf-8', htmlspecialchars($tel . ' description')); $start_time = 'AUTO'; // отправить немедленно или ставим дату и время в формате YYYY-MM-DD HH:MM:SS $end_time = 'AUTO'; // автоматически рассчитать системой или ставим дату и время в формате YYYY-MM-DD HH:MM:SS $rate = 1; // скорость отправки сообщений (1 = 1 смс минута). Одиночные СМС сообщения отправляются всегда с максимальной скоростью. $lifetime = 4; // срок жизни сообщения 4 часа - $source = 'extremstyle'; // Alfaname + $source = 'rukzachok'; // Alfaname $recipient = $tel; $user = '380674064008'; $password = 'smsartweb2012'; diff --git a/common/config/main.php b/common/config/main.php index ca5185f..589ca3b 100755 --- a/common/config/main.php +++ b/common/config/main.php @@ -12,6 +12,10 @@ return [ ], ], + 'sms' => [ + 'class' => 'common\components\SmsSender', + ], + 'cache' => [ 'class' => 'yii\caching\FileCache', ], diff --git a/frontend/controllers/BasketController.php b/frontend/controllers/BasketController.php index 9e3863b..f563ce4 100755 --- a/frontend/controllers/BasketController.php +++ b/frontend/controllers/BasketController.php @@ -120,6 +120,9 @@ class BasketController extends Controller ] ]); + $text = "# zakaz: ". $order->id .". V blijayshee vremya menedjer svyajetsya s Vami. (044) 303 90 15"; + Yii::$app->sms->send($order->phone, $text); + return $this->render('success',[ 'order' => $order, 'variants' => $productV, diff --git a/frontend/widgets/Seo.php b/frontend/widgets/Seo.php index 0848c41..0c1d64f 100755 --- a/frontend/widgets/Seo.php +++ b/frontend/widgets/Seo.php @@ -81,43 +81,7 @@ class Seo extends Widget // return $filter_row; // } - if(!empty($filter)) { - - $array = [ - 'category' => $this->category_name - ]; - - - if (isset($filter['brands']) && count($filter['brands']) == 1) { - $model = Brand::find()->where(['alias' => $filter['brands'][0]])->one(); - - $array['brand'] = $model->name; - } - - if (isset($filter['options']["pol"]) && count($filter['options']["pol"]) == 1) { - - $model = TaxOption::find()->where(['alias' => $filter['options']["pol"]])->one(); - $array['sex'] = $model->value->value; - - - } - - if (isset($filter['options']["naznacenie"]) && count($filter['options']["naznacenie"]) == 1) { - - $model = TaxOption::find()->where(['alias' => $filter['options']["naznacenie"]])->one(); - $array['naz'] = $model->value->value; - - } - - if (isset($filter['options']["god"]) && count($filter['options']["god"]) == 1) { - - $model = TaxOption::find()->where(['alias' => $filter['options']["god"]])->one(); - $array['year'] = $model->value->value; - - } - return $this->getTitleString($array); - - } else if (!empty($title)) { + if (!empty($title)) { return $title; } else { return $this->project_name; -- libgit2 0.21.4