Ejemplo n.º 1
0
            <p>
                <?php 
foreach ($model->images as $image) {
    ?>
                    <?php 
    echo Html::a(Html::img('/admin/images/products/galleries/' . $image->name, ['alt' => $image->alt, 'width' => 70, 'height' => 70, 'class' => 'img-thumbnail']), ['/admin/images/products/galleries/' . $image->name], ['data-lightbox' => 'product-gallery']);
    ?>
 
                <?php 
}
?>
            </p>
            <p><?php 
echo StarRating::widget(['name' => 'rating', 'value' => $model->rating, 'disabled' => $isRatingDisabled, 'pluginOptions' => ['size' => 'sm', 'showClear' => false, 'showCaption' => false], 'pluginEvents' => ["rating.change" => "function () {\n                        console.log(\$(this).val()); \n                        \$.ajax({\n                            type: 'POST',\n                            url: '/site/product-rating',\n                            data: {rating: \$(this).val(), id: {$model->id}},\n                            success: function(res) {\n                                // if (res === 'forbidden') {\n                                //     \$('.star-rating').removeClass('rating-active');\n                                //     \$('.star-rating').addClass('rating-disabled');\n                                //     \$('#w0').prop('disabled', true);\n                                //     return;\n                                // }\n                                location.reload();\n                            }\n                        });\n                        return false;\n                    }"]]);
?>
</p>
            <?php 
echo ProductHelper::getButtons($model);
?>
        </article>

    </div>
</div>







Ejemplo n.º 2
0
                    <h2 class="product-list"><?php 
    echo Html::a($product->title, ['/' . $product->slug_ru]);
    ?>
</h2>
                    <p><?php 
    echo Html::a(Html::img('/admin/images/products/titles/' . $product->image, ['alt' => $product->image_alt, 'width' => 150, 'height' => 150, 'class' => 'leftimg img-thumbnail']), ['/' . $product->slug_ru]);
    echo nl2br($product->short_description, false);
    ?>
</p>
                    <p><?php 
    echo Html::a('Подробнее &raquo;', ['/' . $product->slug_ru], ['class' => 'btn btn-default']);
    ?>
</p>
                    <div class="clearfix"></div>
                    <p><?php 
    echo StarRating::widget(['name' => 'rating', 'value' => $product->rating, 'disabled' => true, 'pluginOptions' => ['size' => 'sm', 'showClear' => false, 'showCaption' => false]]);
    ?>
</p>
                    <?php 
    echo ProductHelper::getButtons($product);
    ?>
                </article>
                <hr>
            <?php 
}
?>
        </div>

    </div>
</div>