add default account to frontend
This commit is contained in:
@@ -99,15 +99,15 @@ $discountOptions = mkOptions( ArrayHelper::map($discounts, 'id_discount', 'name'
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class='col-md-4'>
|
||||
<?php echo Html::a(Yii::t("frontend/product","Sell product"),null,['class' => 'btn btn-success', 'id' => 'btn_sell'] );?>
|
||||
<?php echo Html::a(Yii::t("frontend/product","Sell product"),null,['class' => 'btn btn-success btn-block', 'id' => 'btn_sell'] );?>
|
||||
</div>
|
||||
<div class='col-md-4'>
|
||||
<?php echo Html::a(Yii::t("frontend/product","To cart"),null,['class' => 'btn btn-success', 'id' => 'btn_sell_append'] );?>
|
||||
<?php echo Html::a(Yii::t("frontend/product","To cart"),null,['class' => 'btn btn-success btn-block', 'id' => 'btn_sell_append'] );?>
|
||||
</div>
|
||||
<div class='col-md-4'>
|
||||
<?php
|
||||
if ( isset($model->card) ){
|
||||
echo Html::a(Yii::t("frontend/product","Write up"),null,['class' => 'btn btn-success', 'id' => 'btn_add_to_customer_cart'] );
|
||||
if ( $receptionForm->isCardWithCustomer() ){
|
||||
echo Html::a(Yii::t("frontend/product","Write up"),null,['class' => 'btn btn-success btn-block', 'id' => 'btn_add_to_customer_cart'] );
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
@@ -33,4 +33,8 @@ use yii\bootstrap\Html;
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo Html::a(Yii::t('frontend/product', "Paid"),null,[ 'id' => 'btn_pay_user_cart', 'class' => 'btn btn-primary' ]) ?>
|
||||
<div class='row' >
|
||||
<div class='col-md-3'>
|
||||
<?php echo Html::a(Yii::t('frontend/product', "Paid"),null,[ 'id' => 'btn_pay_user_cart', 'class' => 'btn btn-primary btn-block' ]) ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -9,6 +9,8 @@ use yii\helpers\Url;
|
||||
use yii\bootstrap\ActiveForm;
|
||||
use yii\helpers\ArrayHelper;
|
||||
use common\models\Discount;
|
||||
use frontend\components\ReceptionWidget;
|
||||
use common\models\Account;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $form yii\bootstrap\ActiveForm */
|
||||
@@ -26,7 +28,7 @@ if ( isset($model->card) ){
|
||||
$options['customer_cart'] = $model->customerCart;
|
||||
}
|
||||
$options['discounts'] = Discount::modelsToArray($discounts);
|
||||
|
||||
$options['id_account'] = Account::readDefault();
|
||||
|
||||
|
||||
$this->registerJs ( 'new ProductSell( '. json_encode($options).');' );
|
||||
@@ -67,21 +69,15 @@ $this->registerJs ( 'new ProductSell( '. json_encode($options).');' );
|
||||
|
||||
</style>
|
||||
|
||||
<div class='row'>
|
||||
<div class='col-md-3'>
|
||||
<?php echo ReceptionMenuWidget::widget( [ 'customer' => $customer, 'card' => $card] ) ?>
|
||||
</div>
|
||||
<div class='col-md-4'>
|
||||
<?php echo ReceptionCardNumberWidget::widget( [ 'customer' => $customer, 'card' =>$card, 'route' => ['product/sale'] ] )?>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo ReceptionWidget::widget( ['form' => $receptionForm, 'route' => ['customer/reception'] ] )?>
|
||||
|
||||
<div class='row '>
|
||||
<div class='col-md-6 product-form'>
|
||||
<h1><?php echo Yii::t('frontend/product','Sell product')?></h1>
|
||||
<?php echo $this->render('_sale_form' ,['model' =>$model , 'lookupModel' =>$lookupModel, 'currencies' => $currencies, 'accounts' => $accounts,'discounts' => $discounts ]) ?>
|
||||
<?php echo $this->render('_sale_form' ,[ 'receptionForm' => $receptionForm, 'model' =>$model , 'lookupModel' =>$lookupModel, 'currencies' => $currencies, 'accounts' => $accounts,'discounts' => $discounts ]) ?>
|
||||
</div>
|
||||
<div class='col-md-6'>
|
||||
<?php if ( isset($card) ){ ?>
|
||||
<?php if ( $receptionForm->isCardWithCustomer() ){ ?>
|
||||
<?php echo $this->render('_customer_cart' ) ?>
|
||||
<?php }?>
|
||||
<?php echo $this->render('_user_cart' ) ?>
|
||||
|
||||
Reference in New Issue
Block a user