Jump to content

[Solved] Gridview and Listview Display At Same Time


apislerr

Recommended Posts

Im using prestashop 1.6.0.9.
i make root category for product

 

Product

- category 1

- category 2

- category 3

 

After view product in category 1 it display well product list with grid view or list view

then, after view root product it display sub category

- category 1

- category 2

- category 3

 

but it display product list in  grid view and list view at the same time. how to fix that or how to remove product list from the root product?

 

 

 

Edited by apislerr (see edit history)
Link to comment
Share on other sites

what javascript?

As I said, view source on your browser and the semicolon will be missing at line 160. It's embeded in html, not in external .js file. This is that part:

<script type="text/javascript">
                    jQuery(document).ready(function($){
                    
                    $(".category-products .grid").click(function(e) {
                    $("#products_wrapper ol.products-list").hide();
                    $("#products_wrapper ul.products-grid").show();
                    $('.category-products .list').removeClass('list-mode-active');
                    $(this).addClass('grid-mode-active');
                    e.preventDefault();
                });
   

                $(".category-products .list").click(function(e) {
                $("#products_wrapper ol.products-list").show();
                $("#products_wrapper ul.products-grid").hide();
                $(this).addClass('list-mode-active');
                $('.category-products  .grid').removeClass('grid-mode-active');
                e.preventDefault(); });

        

})
   
 
jQuery(document).ready(function($){
$("#products_wrapper ol.products-list").hide();
$("#products_wrapper ul.products-grid").show();
$('.category-products .list').removeClass('list-mode-active');
$('.category-products .grid').addClass('grid-mode-active');
});
    
 </script>

It should be:

<script type="text/javascript">
                    jQuery(document).ready(function($){
                    
                    $(".category-products .grid").click(function(e) {
                    $("#products_wrapper ol.products-list").hide();
                    $("#products_wrapper ul.products-grid").show();
                    $('.category-products .list').removeClass('list-mode-active');
                    $(this).addClass('grid-mode-active');
                    e.preventDefault();
                });
   

                $(".category-products .list").click(function(e) {
                $("#products_wrapper ol.products-list").show();
                $("#products_wrapper ul.products-grid").hide();
                $(this).addClass('list-mode-active');
                $('.category-products  .grid').removeClass('grid-mode-active');
                e.preventDefault(); });

        

});
   
 
jQuery(document).ready(function($){
$("#products_wrapper ol.products-list").hide();
$("#products_wrapper ul.products-grid").show();
$('.category-products .list').removeClass('list-mode-active');
$('.category-products .grid').addClass('grid-mode-active');
});
    
 </script>
Link to comment
Share on other sites

 

As I said, view source on your browser and the semicolon will be missing at line 160. It's embeded in html, not in external .js file. This is that part:

<script type="text/javascript">
                    jQuery(document).ready(function($){
                    
                    $(".category-products .grid").click(function(e) {
                    $("#products_wrapper ol.products-list").hide();
                    $("#products_wrapper ul.products-grid").show();
                    $('.category-products .list').removeClass('list-mode-active');
                    $(this).addClass('grid-mode-active');
                    e.preventDefault();
                });
   

                $(".category-products .list").click(function(e) {
                $("#products_wrapper ol.products-list").show();
                $("#products_wrapper ul.products-grid").hide();
                $(this).addClass('list-mode-active');
                $('.category-products  .grid').removeClass('grid-mode-active');
                e.preventDefault(); });

        

})
   
 
jQuery(document).ready(function($){
$("#products_wrapper ol.products-list").hide();
$("#products_wrapper ul.products-grid").show();
$('.category-products .list').removeClass('list-mode-active');
$('.category-products .grid').addClass('grid-mode-active');
});
    
 </script>

It should be:

<script type="text/javascript">
                    jQuery(document).ready(function($){
                    
                    $(".category-products .grid").click(function(e) {
                    $("#products_wrapper ol.products-list").hide();
                    $("#products_wrapper ul.products-grid").show();
                    $('.category-products .list').removeClass('list-mode-active');
                    $(this).addClass('grid-mode-active');
                    e.preventDefault();
                });
   

                $(".category-products .list").click(function(e) {
                $("#products_wrapper ol.products-list").show();
                $("#products_wrapper ul.products-grid").hide();
                $(this).addClass('list-mode-active');
                $('.category-products  .grid').removeClass('grid-mode-active');
                e.preventDefault(); });

        

});
   
 
jQuery(document).ready(function($){
$("#products_wrapper ol.products-list").hide();
$("#products_wrapper ul.products-grid").show();
$('.category-products .list').removeClass('list-mode-active');
$('.category-products .grid').addClass('grid-mode-active');
});
    
 </script>

i dont know what file name that have this js

Link to comment
Share on other sites

Remove this javascript from header.tpl file and put it in footer.tpl file. Looks like now the javascript part is good, just it doesn't execute at $(document).ready() event. Maybe putting it to the bottom of your page (in footer.tpl) will solve your problem. Give it a try.

Link to comment
Share on other sites

Remove this javascript from header.tpl file and put it in footer.tpl file. Looks like now the javascript part is good, just it doesn't execute at $(document).ready() event. Maybe putting it to the bottom of your page (in footer.tpl) will solve your problem. Give it a try.

look same

Link to comment
Share on other sites

The problem is that $(document).ready() isn't executed. Sometimes, it helps to put all javascript files and then all javascript code to the end of file, sometimes some other modules causes this problem. But it's hard to debug your javascript code without having access to your files.

Link to comment
Share on other sites

The problem is that $(document).ready() isn't executed. Sometimes, it helps to put all javascript files and then all javascript code to the end of file, sometimes some other modules causes this problem. But it's hard to debug your javascript code without having access to your files.

but, why it looks fine when i view subcagetory?

Link to comment
Share on other sites

×
×
  • Create New...