♥Tsimi Posted March 4, 2015 Posted March 4, 2015 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.
Dan Cole Posted March 4, 2015 Posted March 4, 2015 Based on that code I assume it is using a cookie to store the view you've selected. Do you know if it is being set? Dan Need help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix) here.
♥Tsimi Posted March 4, 2015 Author Posted March 4, 2015 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...
♥Tsimi Posted March 4, 2015 Author Posted March 4, 2015 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.
♥Tsimi Posted March 4, 2015 Author Posted March 4, 2015 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. ;)
burt Posted March 4, 2015 Posted March 4, 2015 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.
♥Tsimi Posted March 4, 2015 Author Posted March 4, 2015 @@burt Thanks for the reminder. :thumbsup: It's time to take a look at the commits again...
tmccaff Posted January 19, 2017 Posted January 19, 2017 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?
♥Tsimi Posted January 20, 2017 Author Posted January 20, 2017 @@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.
auzStar Posted January 20, 2017 Posted January 20, 2017 @@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-onsAdvanced Cache Control Tool for osCommerce 2.3.x (non-bootstrap) Download SupportAjax Product Listing for osC 2.3.4 (bootstrap) Download SupportCategory New Products Carousel for osC 2.3.4 (bootstrap) Download SupportCategory Popular Products Carousel for osC 2.3.4 (bootstrap) Download SupportCustomer Testimonials for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download SupportFront Page New Products Carousel for osC 2.3.4 (bootstrap) Download SupportIndex Nested - Product Listing for osC 2.3.4 (bootstrap) Download SupportMatch Categories in Search Results for osCommerce versions 2.3.x (non-bootstrap) Download SupportModular Category Page for osC 2.3.4 (bootstrap) Download SupportNEW Australia Post Shipping Modules for osCommerce 2.3.x (non-bootstrap) Download SupportNEW Equal Height Module for osC 2.3.4 (bootstrap) Download SupportProducts Low Stock Report for osC 2.3.x (bootstrap and non-bootstrap) Download SupportTwitter Typeahead Autocomplete Search for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download SupportUpcoming Products Modules for osC 2.3.4 (bootstrap) Download Support Assisted Add-onsScroll Boxes for osCommerce 2.3.x (bootstrap and non-bootstrap) Download Support Bootstrap Add-ons created by other membersosCommerce Bootstrap Addons and Code
Recommended Posts
Archived
This topic is now archived and is closed to further replies.