Fix hide reception cart

- add property user_cart_on
- add property product_sale_default_focus
- add property ticket_create-price_editable
- add discount product/ticket enabled
This commit is contained in:
2016-02-28 15:48:30 +01:00
parent b476febb10
commit 2e3a8d53ca
18 changed files with 175 additions and 143 deletions

View File

@@ -6,6 +6,7 @@ use frontend\components\HtmlHelper;
use kartik\widgets\DatePicker;
use common\models\Account;
use common\models\Transfer;
use common\components\Helper;
/* @var $this yii\web\View */
/* @var $model common\models\Ticket */
@@ -65,7 +66,15 @@ use common\models\Transfer;
<?= $form->field($model, 'max_usage_count')->input('number') ?>
<?= $form->field($model, 'price_brutto')->input('number') ?>
<?php
if ( Helper::isTicketCreatePriceEditable()){
echo $form->field($model, 'price_brutto')->input('number' );
}else{
echo $form->field($model, 'price_brutto')->input('number' ,['readonly' => true] );
}
?>
<?= $form->field($model, 'comment')->textarea(['maxlength' => true]) ?>
@@ -74,7 +83,12 @@ use common\models\Transfer;
<?php echo Html::a(Yii::t("frontend/ticket","Fizetve"),null,['class' => 'btn btn-danger btn-block', 'id' => 'btn_sell'] );?>
</div>
<div class='col-md-4'>
<?php echo Html::a(Yii::t("frontend/ticket","To cart"),null,['class' => 'btn btn-success btn-block', 'id' => 'btn_add_to_user_cart'] );?>
<?php
if ( Helper::isUserCartOn()){
echo Html::a(Yii::t("frontend/ticket","To cart"),null,['class' => 'btn btn-success btn-block', 'id' => 'btn_add_to_user_cart'] );
}
?>
</div>
<div class='col-md-4'>
<?php

View File

@@ -7,6 +7,7 @@ use frontend\assets\TicketSellAsset;
use common\models\TicketType;
use yii\helpers\Url;
use frontend\components\ReceptionWidget;
use common\components\Helper;
/* @var $this yii\web\View */
@@ -68,7 +69,11 @@ $this->registerJs ( 'new TicketSell( '. json_encode($options).');' );
<?php if ( $receptionForm->isCardWithCustomer() ){ ?>
<?php echo $this->render('_customer_cart' ,['model' => $receptionForm]) ?>
<?php }?>
<?php echo $this->render('_user_cart' ) ?>
<?php
if ( Helper::isUserCartOn() ) {
echo $this->render('_user_cart' ) ;
}
?>
</div>
</div>
</div>