Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Grid/List Grid as default?


Recommended Posts

I was wondering how your guys default view for the product_listing.php page is?

 

When i open my browser and access my product_listing.php the first time it is always in list view and of course once changed it stays.

Then i close the browser window and open it again click ctrl+F5 and again i access my shops listing and again the list is showing first.

How can i force it to show the grid view first?

 

This is my current code inside the grid/list header_tags module.

$oscTemplate->addBlock('<script>
$(function() { 
	var cc = $.cookie(\'list_grid\'); 
	if (cc == \'grid\') { 
		$(\'#product-listing .inline-span\').removeClass(\'one-across fluid-one-across\').addClass(\''. MODULE_HEADER_TAGS_GRID_LIST_VIEW_DEFAULT .'-across fluid-'. MODULE_HEADER_TAGS_GRID_LIST_VIEW_MOBILE .'-across\'); 
	} else { 
		$(\'#product-listing .inline-span\').removeClass(\''. MODULE_HEADER_TAGS_GRID_LIST_VIEW_DEFAULT .'-across fluid-'. MODULE_HEADER_TAGS_GRID_LIST_VIEW_MOBILE .'-across\').addClass(\'one-across fluid-one-across\'); 
	} 
}); 
$(document).ready(function() { 
	$(\'#list\').click(function(event){
		event.preventDefault();
		  $(\'#product-listing .inline-span\').fadeOut(300,function(){
			$(\'#product-listing .inline-span\').removeClass(\''. MODULE_HEADER_TAGS_GRID_LIST_VIEW_DEFAULT .'-across fluid-'. MODULE_HEADER_TAGS_GRID_LIST_VIEW_MOBILE .'-across\').addClass(\'one-across fluid-one-across\').fadeIn()//updated
		});
		//$(\'#product-listing .inline-span\').removeClass(\''. MODULE_HEADER_TAGS_GRID_LIST_VIEW_DEFAULT .'-across fluid-'. MODULE_HEADER_TAGS_GRID_LIST_VIEW_MOBILE .'-across\').addClass(\'one-across fluid-one-across\');	
		$.cookie(\'list_grid\', \'list\');
	}); 
	$(\'#grid\').click(function(event){
		event.preventDefault();
		$(\'#product-listing .inline-span\').fadeOut(300,function(){
		   $(\'#product-listing .inline-span\').removeClass(\'one-across fluid-one-across\').addClass(\''. MODULE_HEADER_TAGS_GRID_LIST_VIEW_DEFAULT .'-across fluid-'. MODULE_HEADER_TAGS_GRID_LIST_VIEW_MOBILE .'-across\').fadeIn()//updated
		});
		//$(\'#product-listing .inline-span\').removeClass(\'one-across fluid-one-across\').addClass(\''. MODULE_HEADER_TAGS_GRID_LIST_VIEW_DEFAULT .'-across fluid-'. MODULE_HEADER_TAGS_GRID_LIST_VIEW_MOBILE .'-across\');
		$.cookie(\'list_grid\', \'grid\');
	});
});
</script>' . "\n", $this->group);

i tried also the standard code that came with the BS version, same result.

 

Link to comment
Share on other sites

Hi Dan

 

Yes it does, all osC BS do. At first I thought it is something that i have done but i tried to revert everything back and the situation is still same.

It doesn't happen on my other test shop that I have setup which is near untouched osC BS GOLD.

I doubt it but could it be css related?

 

Or should ask then how to setup the default view? Let's say if grid would be the default how to set it to list view in default? That answer to that would be the solution to my issue...

Link to comment
Share on other sites

I knew you will answer me that. :devil:

This whole grid/list stuff is your thing...and you recently worked with it...:P

 

 

you must "learn to read" ....

 

read? i can read normal languages (...sometimes) BUT read javascript/jquery or code is another story...So things just needed to be switched. Cool, thanks H! And thanks for the explanation.

Link to comment
Share on other sites

i not made that.

 

yes i know, if I am not mistaken, you where working on a different grid/list to make it better. so your understanding of this whole thing is probably the most superior compare to others in here. ;)

Link to comment
Share on other sites

Be aware that the code version of the grid_list HT module you posted was updated to make it "simpler" on Dec 7th, prior to Gold release.  

 

You might want to update to the newer version. 

Link to comment
Share on other sites

  • 1 year later...

@@tmccaff

 

I am a bit rusty. I haven't touched osC stuff for months. As far I can recall the default view is "list" not sure if that has been changed by now or if there is a setting somewhere in the admin. But worst cast just hide the grid/list button.

Link to comment
Share on other sites

@@tmccaff

Hello @@Tsimi,

 

 I know this is an old thread, but I was wondering how only to show as list instead of grid? Wasn't there a module in admin to change from grid or list view at one point?

 

see post here: http://www.oscommerce.com/forums/topic/410656-how-do-i-change-product-view-to-list-instead-of-grid/#entry1752372

My Add-ons
Advanced Cache Control Tool for osCommerce 2.3.x (non-bootstrap) Download Support
Ajax Product Listing for osC 2.3.4 (bootstrap) Download Support
Category New Products Carousel for osC 2.3.4 (bootstrap) Download Support
Category Popular Products Carousel for osC 2.3.4 (bootstrap) Download Support
Customer Testimonials for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download Support
Front Page New Products Carousel for osC 2.3.4 (bootstrap) Download Support

Index Nested - Product Listing for osC 2.3.4 (bootstrapDownload Support
Match Categories in Search Results for osCommerce versions 2.3.x (non-bootstrap) Download Support
Modular Category Page for osC 2.3.4 (bootstrap)
Download Support

NEW Australia Post Shipping Modules for osCommerce 2.3.x (non-bootstrap) Download Support
NEW Equal Height Module for osC 2.3.4 (bootstrapDownload Support
Products Low Stock Report for osC 2.3.x (bootstrap and non-bootstrap) Download Support
Twitter Typeahead Autocomplete Search for osCommerce 2.3.4 (bootstrap and non-bootstrap)
Download Support

Upcoming Products Modules for osC 2.3.4 (bootstrap) Download Support

 
Assisted Add-ons
Scroll Boxes for osCommerce 2.3.x (bootstrap and non-bootstrap) Download Support
 
Bootstrap Add-ons created by other members
osCommerce Bootstrap Addons and Code

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...