HI all,
i want to display products only in Grid view and disable the list display how it possible ?
Please help
It will involve editing several template files (basically any tpl file that has the option to switch between list/grid)
It will also involve swapping some code and removing some javascript from the above tpl files.
example on one file catalog/view/theme/default/template/product/category.tpl
find & delete
find
change to
find & delete
It will also involve swapping some code and removing some javascript from the above tpl files.
example on one file catalog/view/theme/default/template/product/category.tpl
find & delete
Code: Select all
<div class="display"><b><?php echo $text_display; ?></b> <?php echo $text_list; ?> <b>/</b> <a onclick="display('grid');"><?php echo $text_grid; ?></a></div>
Code: Select all
<div class="product-list">
Code: Select all
<div class="product-grid">
Code: Select all
<script type="text/javascript"><!--
function display(view) {
$('.product-list').attr('class', 'product-grid');
$('.product-grid > div').each(function(index, element) {
html = '';
var image = $(element).find('.image').html();
if (image != null) {
html += '<div class="image">' + image + '</div>';
}
html += '<div class="name">' + $(element).find('.name').html() + '</div>';
html += '<div class="description">' + $(element).find('.description').html() + '</div>';
var price = $(element).find('.price').html();
if (price != null) {
html += '<div class="price">' + price + '</div>';
}
var rating = $(element).find('.rating').html();
if (rating != null) {
html += '<div class="rating">' + rating + '</div>';
}
html += '<div class="cart">' + $(element).find('.cart').html() + '</div>';
html += '<div class="wishlist">' + $(element).find('.wishlist').html() + '</div>';
html += '<div class="compare">' + $(element).find('.compare').html() + '</div>';
$(element).html(html);
});
$('.display').html('<b><?php echo $text_display; ?></b> <a onclick="display(\'list\');"><?php echo $text_list; ?></a> <b>/</b> <?php echo $text_grid; ?>');
$.cookie('display', 'grid');
}
}
view = $.cookie('display');
if (view) {
display(view);
} else {
display('list');
}
//--></script>
Hey, there is also a CR2 Grid Enabler which means if you enable it then the list view disappears and every thing displays in Grid format.
Check it out here: http://www.opencart.com/index.php?route ... on_id=3204
Aaron
Check it out here: http://www.opencart.com/index.php?route ... on_id=3204
Aaron
Who is online
Users browsing this forum: No registered users and 4 guests