예제 #1
0
 protected function loadProduct()
 {
     $product_id = $this->param('id');
     $product = shopProduct::find($product_id);
     if (!$product) {
         return $this->controller->run('404');
     }
     return $product;
 }
예제 #2
0
파일: routes.php 프로젝트: romanov-acc/shop
use Firestarter\Shop\Models\Currency;
use Firestarter\Shop\Models\Settings;
Route::group(['prefix' => 'license'], function () {
    Route::get('order/webmoney/wmz', function () {
        /**
          Нужны все валюты
        */
        $currencies = Currency::get()->keyBy('id')->toArray();
        /**
           Это предварительный запрос?
        */
        if (post('LMI_PREREQUEST') == 1) {
            /**
                Есть ли такой товар в базе?
            */
            if (!($product = Product::find(post('SHOP_USER_PRODUCT_ID'))->toArray())) {
            }
            die("ERROR: НЕТ ТАКОГО ТОВАРА");
            /**
                Строка с пользователем?
            */
            if (!post('SHOP_USER_NAME') or post('SHOP_USER_NAME') == '') {
                die("ERROR: НЕ УКАЗАН ПОЛЬЗОВАТЕЛЬ");
            }
            /**
                Строка с почтой?
            */
            if (!post('SHOP_USER_EMAIL') or post('SHOP_USER_EMAIL') == '') {
                die("ERROR: НЕ УКАЗАН EMAIL");
            }
            /**
예제 #3
0
파일: Order.php 프로젝트: romanov-acc/shop
 public function getProductIdOptions()
 {
     return Product::lists('name', 'id');
 }
예제 #4
0
 public function onRun()
 {
     $this->currencies = $this->page['currencies'] = Currency::get()->toArray();
     $this->products = $this->page['products'] = Product::get()->toArray();
 }