Example #1
0
 private function _row($item)
 {
     if (is_string($item)) {
         return html::tag('li', $item);
     }
     $columns = [];
     $product = $item->getModel();
     $allOptions = $product->getCartOptions();
     $cartElName = $product->getCartName();
     if ($this->showOptions && $item->getOptions()) {
         $options = '';
         foreach ($item->getOptions() as $optionId => $valueId) {
             if ($optionData = $allOptions[$optionId]) {
                 $option = $optionData['name'];
                 $value = $optionData['variants'][$valueId];
                 $options .= Html::tag('div', Html::tag('strong', $option) . ':' . $value);
             }
         }
         $cartElName .= Html::tag('div', $options, ['class' => 'pistol88-cart-show-options']);
     }
     if (!empty($this->otherFields)) {
         foreach ($this->otherFields as $fieldName => $field) {
             $cartElName .= Html::tag('p', Html::tag('small', $fieldName . ': ' . $product->{$field}));
         }
     }
     if ($this->columns == 4) {
         $columns[] = Html::tag('div', $cartElName, ['class' => 'col-lg-6 col-md-6 col-xs-6']);
         $columns[] = Html::tag('div', ChangeCount::widget(['model' => $item, 'showArrows' => $this->showCountArrows]), ['class' => 'col-lg-3 col-xs-3']);
         $columns[] = Html::tag('div', $this->_getCostFormatted($item->getCost(false)), ['class' => 'col-lg-2 col-xs-2']);
     } else {
         $columns[] = Html::tag('div', $cartElName, ['class' => 'col-lg-8 col-md-8 col-xs-8']);
         $columns[] = Html::tag('div', $this->_getCostFormatted($item->getCost(false)) . ChangeCount::widget(['model' => $item, 'showArrows' => $this->showCountArrows]), ['class' => 'col-lg-3 col-md-3 col-xs-3']);
     }
     $columns[] = Html::tag('div', DeleteButton::widget(['model' => $item, 'lineSelector' => 'pistol88-cart-row ', 'cssClass' => 'delete']), ['class' => 'shop-cart-delete col-lg-1 col-md-1 col-xs-1']);
     $return = html::tag('div', implode('', $columns), ['class' => ' row']);
     return Html::tag('li', $return, ['class' => 'pistol88-cart-row ']);
 }
Example #2
0
    echo $element->getModel()->getCartName();
    ?>
 (<?php 
    echo $element->getModel()->getCartPrice();
    ?>
 р.)</strong>
                <?php 
    echo ChangeOptions::widget(['model' => $element, 'type' => 'radio']);
    ?>
            </div>
            <div class="col-lg-4 col-xs-4">
                <?php 
    echo ChangeCount::widget(['model' => $element]);
    ?>
            </div>
            <div class="col-lg-2 col-xs-2">
                <?php 
    echo DeleteButton::widget(['model' => $element, 'lineSelector' => '.row']);
    ?>
            </div>
        </div>
    <?php 
}
?>
    <div class="total">
        <?php 
echo CartInformer::widget(['htmlTag' => 'h3']);
?>
    </div>
</div>