ajax_items.php 2.02 KB
<?php
use yii\widgets\ActiveForm;
use yii\helpers\Html;
?>
<?php $form = ActiveForm::begin(['enableClientScript' => false,  'options' => [
    'class' => 'basket_form2'
]]); ?>
<?php foreach($basket_mods as $i=>$item):?>
<div class="basket_item">
    <?php echo $form->field($item,'['.$i.']id')->hiddenInput()->label(false); ?>
    <div style="display: table-cell;vertical-align: middle;"><a href="#" data-id="<?=$item->id?>" class="delete_button" style="margin-right:20px;"></a></div>
    <div class="img_ajax_basket" style="width:100px;height:100px;display: table-cell;vertical-align: middle; border:1px solid #d2d2d2;text-align:center;margin-left:10px;margin-right:10px;">
        <?= \common\components\artboximage\ArtboxImageHelper::getImage($item->imageUrl, 'product_basket')?>
    </div>
    <div style="display: table-cell;vertical-align: middle; font-size:15px;width:210px; font-weight:normal;padding-left:15px;">
        <div><?=$item->product_name?></div>
        <div style="text-transform:none; margin-top:20px; font-weight:bold;">
            <?php if($item->price_old>0):?><div style="text-decoration:line-through;font-size:13px;"><?=$item->price_old?> грн.</div><?php endif;?>
            <div style="font-size:15px;color:#f75d50;"><?=$item->price?> грн.</div>
        </div>
    </div>
    <div style="display: table-cell;vertical-align: middle;">
        <a href="#" style="color:#95ba2f" class="minus"></a><?php echo $form->field($item,'['.$i.']count',['template'=>'{input}'])->textInput(['type'=>'number','class' => 'item_num','disabled1'=>true])->label(false); ?><a href="#" style="color:#95ba2f" class="plus"></a>
    </div>
    <div style="display: table-cell;vertical-align: middle; font-size:16px;color:#f75d50; font-weight:bold; padding-left:40px;"><?=$item->sum_cost?> грн.</div>
    <div  style="clear:both;"></div>
</div>
<?php endforeach;?>

    <div class="basket_sum">
        <div class="sum_text" style="float:left;">Всего: <span><?=$modelMod->getSumCost()?> грн.</span></div>
    </div>
<?php ActiveForm::end(); ?>