Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to remove 'sort by - grid - list'


Recommended Posts

Posted

Setting up a new CE Phoenix BS4 shop.

Want to maintain current grid view of products but want to completely remove the 'sort by - grid - list' container from pages.

Any ideas gratefully received.

Posted
3 hours ago, Heatherbell said:

Want to maintain current grid view of products but want to completely remove the 'sort by - grid - list' container from pages.

admin > modules > header_tags > "grid/list" > {uninstall}

That should do it - I'm pretty sure that was the same in Frozen.  I'm not sure if that would have unintended consequences though.

Posted
2 minutes ago, Heatherbell said:

hoping for an answer.

I turned off the HT module as described above, this created an output of "grid", but with the list content...

lgi.jpg.badbe0390b9e57bc86f5830541dee68c.jpg

to combat that, make a new file called "ggi.php", with this content;

class hook_shop_siteWide_ggi {
  var $ggi = null;
	  function listen_injectSiteEnd() {
    $this->ggi .= <<<eod
<script>
$('#products .item').removeClass('l-g-i').addClass('g-g-i');
</script>
eod;
    return $this->ggi;
  }
}

and upload into /includes/hooks/shop/siteWide/

 

Posted

@burt Just implemented your code, works fine - but maybe you misunderstand, in my original question at top of page (if you can wade through the politics) "want to completely remove the 'sort by - grid - list' container from pages."

I want that whole container to disappear, sort by and everything.

Posted

@Heatherbell

Is this what you want?

311494633_ScreenCapture-2019-07-05.jpg.415cf1c16e15380e5fc0f97ba937d95a.jpg

To completely remove the entire 'Sort By / List / Grid / Manufactures' container?

To do this required a lot of editing of the /includes/modules/product_listing.php file. @burt may have a way to do this without core changes, but if not, are you willing to do core changes?

M

Posted

@ArtcoInc Many thanks for your reply - that is exactly what I want - always easier said than done! Core changes now seem to be frowned upon but I am willing to do anything (up to a point :))

Posted

OK, I did miss that...

You've a couple of options, note that I have not tried any of them so syntax may be a little out - but it should give you ideas;

A.  remove the code by amending core code (note that is nothing "bad" about core code changes, I just advise to do it as little as possible and then to try to remember what you did for future reference). 
- remove this block of code: 
https://github.com/gburton/Responsive-osCommerce/blob/master/includes/modules/product_listing.php#L40-L103

B. hide that same block of code using .css
- add this to user.css:  
div.alert-filters { display: none !important; }

C. hide that same block of code using javascript
- add this to that ggi.php that I had you create earlier in the thread: 
$('div.alert-filters').hide();

As mentioned, syntax may be out but gives the general idea.  Of the three, I'd likely do it in the .css if it was me.

 

 

Posted

You could also put something like this in the .css (for reminder);

/* removes grid/list entirely, see www.oscommerce.com/forums/topic/493639-how-to-remove-sort-by-grid-list */
div.alert-filters { display: none !important; }

 

Posted
2 minutes ago, burt said:

You could also put something like this in the .css (for reminder);


/* removes grid/list entirely, see www.oscommerce.com/forums/topic/493639-how-to-remove-sort-by-grid-list */
div.alert-filters { display: none !important; }

 

Great advice - I am an idiot and I need to adopt this practice for everything I do from now on, especially with my shiny new Phoenix!

Archived

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

×
×
  • Create New...