add customer cart

This commit is contained in:
2015-10-21 17:57:16 +02:00
parent baf7c79d04
commit 23a0390a27
14 changed files with 467 additions and 16 deletions

View File

@@ -0,0 +1,24 @@
<?php
namespace common\components;
use yii\base\Behavior;
use common\models\Currency;
class CurrencyAwareBehavior extends Behavior{
public function getCurrencyName(){
$result = "";
$currency = $this->owner->currency;
if (isset($currency)){
$result = $currency->name;
}
return $result;
}
public function getCurrency(){
return $this->owner->hasOne( Currency::className(), ["id_currency" =>"id_currency" ] ) ;
}
}