コード例 #1
0
ファイル: view.php プロジェクト: pistol88/yii2-shop
                                            <div class="col-md-6"><?php 
                echo $weight;
                ?>
 <?php 
                echo $product->getField('units');
                ?>
</div>
                                        <?php 
            }
            ?>
                                    </div>
                                    <?php 
            if ($price = $relation->price) {
                ?>
                                        <?php 
                echo BuyButton::widget(['model' => $product, 'cssClass' => 'light', 'text' => 'Заказать', 'htmlTag' => 'button']);
                ?>
                                   <?php 
            }
            ?>
                                </div>
                            <?php 
        }
        ?>
                        <?php 
    }
    ?>
                    </div>				
                </div>
            </div>
        </div>
コード例 #2
0
ファイル: products_list.php プロジェクト: pistol88/yii2-order
.pistol88-change-count, .pistol88-cart-buy-button {
    display: inline;
    width: 45%;
}

.products-list select {
    padding: 1px;
    margin: 1px;
    font-size: 12px;
    height: auto;
}
</style>
<div class="products-list">

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['attribute' => 'id', 'options' => ['style' => 'width: 45px;']], ['attribute' => 'name', 'content' => function ($product) {
    $name = Html::tag('div', $product->name, ['style' => 'clear: both;']);
    $count = ChangeCount::widget(['model' => $product->sellModel]);
    if ($product->getCartOptions()) {
        $options = ChangeOptions::widget(['model' => $product]);
    } else {
        $options = null;
    }
    $btn = BuyButton::widget(['model' => $product->sellModel, 'text' => yii::t('order', 'To order'), 'htmlTag' => 'a', 'cssClass' => 'btn btn-success to-order']);
    return Html::tag('div', $name . $options . $count . $btn, ['class' => 'pistol88-order-prodlist-widgets']);
}], 'code', ['attribute' => 'category_id', 'filter' => Html::activeDropDownList($searchModel, 'category_id', $categories, ['class' => 'form-control', 'prompt' => 'Категория']), 'value' => 'category.name'], ['label' => yii::t('order', 'Amount'), 'value' => 'amount'], ['label' => yii::t('order', 'Price'), 'value' => 'price']]]);
?>
    
</div>
コード例 #3
0
ファイル: table.php プロジェクト: pistol88/yii2-service
            ?>
">
                        <input class="service-price" <?php 
            if (!empty($price->description)) {
                echo ' style="border: 1px solid yellow;"';
            }
            ?>
 data-base-price="<?php 
            echo $price->price;
            ?>
" type="text" name="text" value="<?php 
            echo $price->price;
            ?>
" />
                        <?php 
            echo BuyButton::widget(['model' => $price, 'text' => '<i class="glyphicon glyphicon-shopping-cart"></i>', 'htmlTag' => 'a', 'cssClass' => 'btn btn-default']);
            ?>
                    </td>
                <?php 
        }
        ?>
            <?php 
    }
    ?>
        </tr>
    <?php 
}
?>
    <tr>
        <td width="200">Вид услуги</td>
        <?php