Пример #1
0
 /**
  * @return Currency
  */
 public static function current()
 {
     $code = Data::load('currency', function () {
         /** @var User $user */
         $user = \Yii::$app->user->identity;
         return \Yii::$app->user->isGuest ? static::getDefault()->code : Country::findOne($user->country_id)->currency_code;
     });
     return static::get($code);
 }
Пример #2
0
 /**
  * Gets order address
  * @return static
  */
 public static function get()
 {
     return Data::load('order_address', function () {
         return new static();
     });
 }
Пример #3
0
 /**
  * Gets wish list
  * @return static
  */
 public static function get()
 {
     return Data::load('wish_list', function () {
         return new static();
     });
 }
Пример #4
0
 /**
  * Gets shopping cart
  * @return static
  */
 public static function get()
 {
     return Data::load('shopping_cart', function () {
         return new static();
     });
 }