add customer cart

This commit is contained in:
2015-10-23 20:39:10 +02:00
parent 23a0390a27
commit 0c92fdf167
11 changed files with 293 additions and 81 deletions

View File

@@ -19,8 +19,12 @@ ProductSellAsset::register($this);
$options = [];
$options['lookup_product_url'] = Url::toRoute(['product/lookup']);
$options['clear_list_url'] = Url::toRoute(['product/clear-list']);
$options['sold_items'] = $userTransfers;
$options['url_pay_user_cart'] = Url::toRoute(['product/payout-user-cart']);
$options['user_cart'] = $userTransfers;
if ( isset($model->card) ){
$options['url_pay_customer_card'] = Url::toRoute(['product/payout-customer-cart','number' => $model->card->number]);
$options['customer_cart'] = $model->customerCart;
}
$options['discounts'] = Discount::modelsToArray($discounts);
@@ -77,14 +81,10 @@ $this->registerJs ( 'new ProductSell( '. json_encode($options).');' );
<?php echo $this->render('_sale_form' ,['model' =>$model , 'lookupModel' =>$lookupModel, 'currencies' => $currencies, 'accounts' => $accounts,'discounts' => $discounts ]) ?>
</div>
<div class='col-md-6'>
<?php echo $this->render('_customer_cart' ) ?>
<h1><?php echo Yii::t('frontend/product','Cart')?></h1>
<?php echo $this->render('_sold_items' ) ?>
<?php echo Html::a(Yii::t('frontend/product', "Paid"),null,[ 'id' => 'btn_paid', 'class' => 'btn btn-primary' ]) ?>
<?php if ( isset($card) ){ ?>
<?php echo $this->render('_customer_cart' ) ?>
<?php }?>
<?php echo $this->render('_user_cart' ) ?>
</div>
</div>