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:
@@ -20,7 +20,7 @@ use common\models\Discount;
|
||||
$types = TicketType::findAll(['status' => TicketType::STATUS_ACTIVE ,'installment_enabled' => '1']);
|
||||
$types = HtmlHelper::mkTicketTypeOptions($types);
|
||||
|
||||
$discounts = Discount::read();
|
||||
$discounts = Discount::readTicketDiscounts();
|
||||
$discounts = ['' => ''] + HtmlHelper::mkDiscountOptions($discounts);
|
||||
|
||||
?>
|
||||
|
||||
@@ -3,6 +3,7 @@ use yii\helpers\Html;
|
||||
use yii\bootstrap\ActiveForm;
|
||||
use yii\helpers\ArrayHelper;
|
||||
use common\models\Transfer;
|
||||
use common\components\Helper;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model frontend\models\ProductSaleForm */
|
||||
@@ -110,7 +111,9 @@ $discountOptions = mkOptions( ArrayHelper::map($discounts, 'id_discount', 'name'
|
||||
<?php echo Html::a(Yii::t("frontend/product","Sell"),null,['class' => 'btn btn-danger btn-block', 'id' => 'btn_sell'] );?>
|
||||
</div>
|
||||
<div class='col-md-4'>
|
||||
<?php if ( Helper::isUserCartOn()){ ?>
|
||||
<?php echo Html::a(Yii::t("frontend/product","To cart"),null,['class' => 'btn btn-success btn-block', 'id' => 'btn_sell_append'] );?>
|
||||
<?php }?>
|
||||
</div>
|
||||
<div class='col-md-4'>
|
||||
<?php
|
||||
|
||||
@@ -7,6 +7,7 @@ use frontend\components\ReceptionWidget;
|
||||
use yii\bootstrap\ActiveForm;
|
||||
use yii\helpers\Url;
|
||||
use yii\helpers\ArrayHelper;
|
||||
use common\components\Helper;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $form yii\bootstrap\ActiveForm */
|
||||
@@ -30,6 +31,9 @@ if ( isset($model->card) ){
|
||||
$options['discounts'] = Discount::modelsToArray($discounts);
|
||||
$options['id_account'] = Account::readDefault();
|
||||
|
||||
$options['product_sale_default_focus'] = Helper::getProductSaleDefaultFocus();
|
||||
$options['user_cart_on'] = Helper::isUserCartOn();
|
||||
|
||||
|
||||
$this->registerJs ( 'new ProductSell( '. json_encode($options).');' );
|
||||
|
||||
@@ -97,7 +101,9 @@ $this->params['breadcrumbs'][] = Yii::t('frontend/product', 'Sale');
|
||||
<?php if ( $receptionForm->isCardWithCustomer() ){ ?>
|
||||
<?php echo $this->render('_customer_cart' , ['model' => $model]) ?>
|
||||
<?php }?>
|
||||
<?php if ( Helper::isUserCartOn()) {?>
|
||||
<?php echo $this->render('_user_cart' ) ?>
|
||||
<?php }?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user