Zen Cart Logo
Forums / Addon Sideboxes / Dynamic Filter [Support Thread]

Dynamic Filter [Support Thread]

Views: 652,518

Results 381 to 400 of 809
09 Jan 2014, 04:12
#381
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Dynamic Filter [Support Thread]

Justrimless:

Further to the above,

With some categories, products search OK with some colours but return (incorrectly) zero results with others.
I'm nonplussed and would appreciate any help. are my attributes munged up somehow?

I don't know if it is relevant to the problem, but I did note that one of your 'Light Browns' is a radio button, but most others are dropdowns.

You could try changing that for consistency.

Cheers
Rod

09 Jan 2014, 14:43
#382
justrimless avatar

justrimless

Zen Follower

Join Date:
Aug 2006
Posts:
127
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Thanks for the input, they are all pull downs but where there is only one available option they appear as radio.

Other categories have other peculiarities, for example in the Rimless category I seem to be able to filter successfully on Blue, Brown and Black, but all other colours return zero results.

I may start from scratch and make a new attribute set for colours, see if that fixes it.

13 Jan 2014, 22:59
#383
kitten091182 avatar

kitten091182

Zen Follower

Join Date:
May 2007
Posts:
110
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

I have had a look, but can't find an answer for this. I have downloaded a mod called "Editable Centerboxes" which I want to use to display the dynamic filter in a centerbox above the product listings. I need to find a way to make the dynamic filters sit next to each other, side by side in the centerbox, rather than as a list going downwards? I hope this makes sense? Sort of like this: www.autotrader.co.uk/used-cars I have used float:left with .dFilter and it makes them sit next to each other, but they slope downwards from left to right with a weird border on top of them? can somebody help please

14 Jan 2014, 08:50
#384
kitten091182 avatar

kitten091182

Zen Follower

Join Date:
May 2007
Posts:
110
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

kitten091182:

I have had a look, but can't find an answer for this. I have downloaded a mod called "Editable Centerboxes" which I want to use to display the dynamic filter in a centerbox above the product listings. I need to find a way to make the dynamic filters sit next to each other, side by side in the centerbox, rather than as a list going downwards? I hope this makes sense? Sort of like this: www.autotrader.co.uk/used-cars I have used float:left with .dFilter and it makes them sit next to each other, but they slope downwards from left to right with a weird border on top of them? can somebody help please
Ok, I have managed to figure it out if anybody else wants this effect. You need to download editable centerboxes, and set the dynamic filter to display in box position 8. The basic stylesheet changes are hr {display: none;} .dFilter{float: left; width:40px; height:80px;margin-right:1em} #dynamicfilterContent{ width:900px;height:200px} some of the sizes might be different for your site, but if you put that in your stylesheet you would get an idea of what to change. Oh and use dropdowns for the filters, it makes it sit better

17 Jan 2014, 16:24
#385
beep avatar

beep

New Zenner

Join Date:
Nov 2008
Location:
London
Posts:
94
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

davowave:

Hi there, I'm using dynamic filter mod by damian taylor - which is an awesome mod btw, you can see it at work on his website http://www.snowrepublic.co.uk/ (click on a category). It's a product filter for prices, manufacturer, attributes etc...

I am trying to acheive the layout of attributes on my product page like you have on the site linked above. Specifically, the way that the 'for display only' attribute is greyed out and is in a dropdown style box even though it appears to be the only value for that attribute. The problem I am having is threefold;

  • How to display the attibute as a dropdown when there is only one value? It appears to revert to a radio button if I have only one value.
  • How do you make the attribute greyed out and non-selectable?
  • How do I stack the attributed neatly like on the above site? Mine is staggered.

Here is an example product page: https://www.ragandmagpie.co.uk/vintage-womenswear/vintage-womens-suits/1950s-blue-striped-dress-and-jacket-suit

17 Jan 2014, 19:27
#386
beep avatar

beep

New Zenner

Join Date:
Nov 2008
Location:
London
Posts:
94
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

beep:

Here is an example product page: https://www.ragandmagpie.co.uk/vintage-womenswear/vintage-womens-suits/1950s-blue-striped-dress-and-jacket-suit

Correction: I have removed attributes to that product, please view this one instead: http://www.ragandmagpie.co.uk/archive/1950s-grey-furleen-faux-fur-stole

Any help massively appreciated :)

17 Jan 2014, 22:06
#387
kitten091182 avatar

kitten091182

Zen Follower

Join Date:
May 2007
Posts:
110
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

beep:

Correction: I have removed attributes to that product, please view this one instead: http://www.ragandmagpie.co.uk/archive/1950s-grey-furleen-faux-fur-stole

Any help massively appreciated :)

I can't see any attributes on that page?
I think you can achieve what you want through admin-configuration-dynamic filter

17 Jan 2014, 23:57
#388
beep avatar

beep

New Zenner

Join Date:
Nov 2008
Location:
London
Posts:
94
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

kitten091182:

I can't see any attributes on that page?
I think you can achieve what you want through admin-configuration-dynamic filter

Hi. I looked in admin-configuration-dynamic filter but couldn't find any options to achieve this.
The attributes are down under the description by the add to cart button.

22 Jan 2014, 11:17
#389
congerman avatar

congerman

Zen Follower

Join Date:
Oct 2008
Posts:
392
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Hi, I have installed the dynamic filter. All seems good in admin but the filter sidebox is not displaying on the site. Layout box's controller has it set to display left column sort order 5 dynamic filter settings are all on

Any clues please?

22 Jan 2014, 14:09
#390
congerman avatar

congerman

Zen Follower

Join Date:
Oct 2008
Posts:
392
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Ok I have now got it to display But I really need it to display on the home page as well as all the others.

Can someone please advise how to display the dynamic filter on the home page?

22 Jan 2014, 14:18
#391
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Dynamic Filter [Support Thread]

Congerman:

Ok I have now got it to display But I really need it to display on the home page as well as all the others.

Can someone please advise how to display the dynamic filter on the home page?

That is not possible with the current module

22 Jan 2014, 14:31
#392
congerman avatar

congerman

Zen Follower

Join Date:
Oct 2008
Posts:
392
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Dam OK I will have to have a re think on this then as my customer is insisting he wants that sort of filter on the home page.

Thanks for your speedy reply

28 Jan 2014, 17:28
#393
beep avatar

beep

New Zenner

Join Date:
Nov 2008
Location:
London
Posts:
94
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Hello. This mod looked like just what I needed but I just can't seem to get it working. I intstalled this mod around two weeks ago on v1.3.9h, at first it seemed fine but as I have dug deeper during setting up my attributes it is now evident that something is wrong. Quite wrong.

I would like to filter by the following attributes which I already have set up for all products; Colour, Motif/Print and Era. I wish to excude all the rest of my attributes which are for product options only (e.g. size, available colours, etc). I also wish to at present disable the filter by manufacturer option for now. These problems seem to be occuring;

- My attributes Colour, Motif/Print and Era are not displaying in the filter column. These attributes are read-only but it makes no difference if I change then to dropdown or checkbox, they still don't display in the filter column. If I remove them from 'include options' in configuration then all attributes appear (size, available colours, etc) as expected.

  • The filter only works when set to Filter Style > Link. On every other setting when you click the filter button the page refreshes to the homepage. I wish to use the Checkbox - Multi filter style. :(

Website: http://www.ragandmagpie.co.uk/index.php?main_page=products_all (once working I plan to use the filter on all category pages. For now I'm baffled.

Note: 'Colours' is for filtering and 'Available colours' is for customer to select preferred colour to purchase.
Note: I have flexible attributes installed and the Colour, Motif/Print and Era attributes are hidden from the product info pages.

Help muchly appreciated. I'd be interested to know if anyone else has had a similar problem.

31 Jan 2014, 00:15
#394
tbsm avatar

tbsm

New Zenner

Join Date:
Sep 2007
Posts:
65
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Hi there,

I have an installed and working version of the Dynamic Filter module installed on my Zen Cart v1.5.1 install and is working properly at present. What I am looking to do is modify the Zen Cart advanced search SQL query so that I can order the search results by relevance (something which should be a core part of ZC IMO).
I have done this in the past in v1.5.1 and can do so with the filter turned off by using a MATCH(pd.products_name) AGAINST('$defined_keywords') AS rank then using the alias rank to order the results in descending order.
When the Dynamic Filter module is activated for search pages it seems to overwrite the ZC search SELECT sql meaning that my alias is not created and causing the search to result in a 1054 error.
Does anyone know if/where the filter module rewrites the search SQL? I have tried adding the code below into tpl_dynamic_filter.php however it does not seem to execute my MATCH AGAINST command.

if ($current_page_base != 'advanced_search_result') {
	$unfiltered_sql = str_replace(array($filter, $having), array("",""), "SELECT p.products_id, p.products_price_sorter, p.master_categories_id, p.manufacturers_id" . substr($listing_sql, $pos_from, ($pos_where - $pos_from)) . substr($listing_sql, $pos_where, ($pos_group - $pos_where)));
	$unfiltered = $db->Execute($unfiltered_sql);
	}
	else {
		$unfiltered_sql = str_replace(array($filter, $having), array("",""), "SELECT p.products_id, p.products_price_sorter, p.master_categories_id, p.manufacturers_id, MATCH(pd.products_name) AGAINST('$keywords') AS rank1, MATCH(pd.products_description) AGAINST('$keywords') AS rank2 " . substr($listing_sql, $pos_from, ($pos_where - $pos_from)) . substr($listing_sql, $pos_where, ($pos_group - $pos_where)));
	$unfiltered = $db->Execute($unfiltered_sql);
	}

I have tried adding an x to MATCH in the second section which breaks the query and shows that the keyword values are populated however when I remove the x it is like it is not there at all...

Any help would be great.
Thank you!

31 Jan 2014, 05:35
#395
tbsm avatar

tbsm

New Zenner

Join Date:
Sep 2007
Posts:
65
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Never mind! Managed to work this one out and now have a search which sorts results by relevance woo!

05 Feb 2014, 23:59
#396
xav2 avatar

xav2

New Zenner

Join Date:
Jun 2013
Posts:
47
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

hello, i want to add "By Quantity:" (the values from products_quantity in table zen_products) to this mod,
is there anyone could help?

06 Feb 2014, 01:08
#397
xav2 avatar

xav2

New Zenner

Join Date:
Jun 2013
Posts:
47
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

another question, what do i make the url more beautiful?

06 Feb 2014, 15:30
#398
xav2 avatar

xav2

New Zenner

Join Date:
Jun 2013
Posts:
47
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

the price, manufacturers, attributes filter display in the sidebox, but my categories filter doesn't display, is there anything i missed?

06 Feb 2014, 16:04
#399
dharrison avatar

dharrison

Zen Follower

Join Date:
Mar 2009
Location:
Essex, UK
Posts:
448
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Hi

I did post in the other support thread, so apologies for sounding like a stuck record, but is there a way that the coding can be tweaked to include the individual unit price as well as the total product price?

The unit price is listed on the shopping cart page, and I would like the dynamic price updater to display the unit price on the product page along with the total cost (which includes Quantity).

I am good with basic PHP so long as I can be shown what needs to be added to where. All I seek is good guidance. Please could anyone help?

Thanks in Advance

06 Feb 2014, 22:14
#400
xav2 avatar

xav2

New Zenner

Join Date:
Jun 2013
Posts:
47
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

hello, the file default_filter.php conflicts with my existing addon, could you help me modifying the code?

Dynamic Filter default_filter.php

<?php
  if (!isset($select_column_list)) $select_column_list = "";
   // show the products of a specified manufacturer
  if (isset($_GET['manufacturers_id']) && $_GET['manufacturers_id'] != '' ) {
 
// bof dynamic filter 2 of 2
    if (isset($_GET['filter_id']) && zen_not_null($_GET['filter_id']) || isset($_GET[DYNAMIC_FILTER_PREFIX . $categoryGroup])) {
// We are asked to show only a specific category
      $listing_sql = "SELECT DISTINCT " . $select_column_list . " p.products_id, p.products_type, p.master_categories_id,
       p.manufacturers_id, m.manufacturers_name, p.products_price, p.products_tax_class_id, pd.products_description,
       if(s.status = 1, s.specials_new_products_price, NULL) AS specials_new_products_price, IF(s.status = 1, s.specials_new_products_price,
       p.products_price) as final_price, p.products_sort_order, p.product_is_call, p.product_is_always_free_shipping,
       p.products_qty_box_status";

      $listing_sql .= " FROM " . TABLE_PRODUCTS . " p" .
     " LEFT JOIN " . TABLE_SPECIALS . " s on p.products_id = s.products_id" .
     " LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id" .
     " LEFT JOIN " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id" .
     " JOIN " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on p.products_id = p2c.products_id" .
       ($filter_attr == true ? " JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " p2a on p.products_id = p2a.products_id" .
       " JOIN " . TABLE_PRODUCTS_OPTIONS . " po on p2a.options_id = po.products_options_id" .
       " JOIN " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov on p2a.options_values_id = pov.products_options_values_id" .
       (defined('TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK') ? " JOIN " . TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK . " p2as on p.products_id = p2as.products_id " : "") : '');

      $listing_sql .= " WHERE p.products_status = 1" .
         " AND m.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'" .
         " AND pd.language_id = '" . (int)$_SESSION['languages_id'] . "'" .
         $filter .
         " GROUP BY p.products_id " .
         $having .
         $alpha_sort;
    } else {
// We show them all
      $listing_sql = "SELECT DISTINCT " . $select_column_list . " p.products_id, p.products_type, p.master_categories_id, p.manufacturers_id,
       p.products_price, p.products_tax_class_id, pd.products_description, IF(s.status = 1, s.specials_new_products_price, NULL) as
       specials_new_products_price, IF(s.status = 1, s.specials_new_products_price, p.products_price) as final_price,
       p.products_sort_order, p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status";

      $listing_sql .= " FROM " . TABLE_PRODUCTS . " p" .
     " LEFT JOIN " . TABLE_SPECIALS . " s on p.products_id = s.products_id" .
     " LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id" .
     " LEFT JOIN " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id" .
       ($filter_attr == true ? " JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " p2a on p.products_id = p2a.products_id" .
       " JOIN " . TABLE_PRODUCTS_OPTIONS . " po on p2a.options_id = po.products_options_id" .
     " JOIN " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov on p2a.options_values_id = pov.products_options_values_id" .
     (defined('TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK') ? " JOIN " . TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK . " p2as on p.products_id = p2as.products_id " : "") : '');

      $listing_sql .= " WHERE p.products_status = 1
       and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
       and m.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'" .
       $filter .
     " GROUP BY p.products_id " .
     $having .
     $alpha_sort;
    }
  } else {
// show the products in a given category
    if (isset($_GET['filter_id']) && zen_not_null($_GET['filter_id']) || isset($_GET[DYNAMIC_FILTER_PREFIX . $manufacturerGroup])) {
// We are asked to show only specific category
      $listing_sql = "SELECT DISTINCT " . $select_column_list . " p.products_id, p.products_type, p.master_categories_id, p.manufacturers_id,
       p.products_price, p.products_tax_class_id, pd.products_description, IF(s.status = 1, s.specials_new_products_price, NULL) as
       specials_new_products_price, IF(s.status = 1, s.specials_new_products_price, p.products_price) as final_price,
       p.products_sort_order, p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status";

      $listing_sql .= " FROM " . TABLE_PRODUCTS . " p" .
     " LEFT JOIN " . TABLE_SPECIALS . " s on p.products_id = s.products_id" .
     " LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id" .
     " LEFT JOIN " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id" .
     " JOIN " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on p.products_id = p2c.products_id" .
       ($filter_attr == true ? " JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " p2a on p.products_id = p2a.products_id" .
       " JOIN " . TABLE_PRODUCTS_OPTIONS . " po on p2a.options_id = po.products_options_id" .
     " JOIN " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov on p2a.options_values_id = pov.products_options_values_id" .
     (defined('TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK') ? " JOIN " . TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK . " p2as on p.products_id = p2as.products_id " : "") : '');

      $listing_sql .= " WHERE p.products_status = 1" .
       " and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'" .
       " and p2c.categories_id = '" . (int)$current_category_id . "'" .
       $filter .
     " GROUP BY p.products_id " .
     $having .
       $alpha_sort;
    } else {
// We show them all
      $listing_sql = "SELECT DISTINCT " . $select_column_list . " p.products_id, p.products_type, p.master_categories_id,
       p.manufacturers_id, p.products_price, p.products_tax_class_id, pd.products_description, IF(s.status = 1,
       s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status =1, s.specials_new_products_price,
       p.products_price) as final_price, p.products_sort_order, p.product_is_call, p.product_is_always_free_shipping,
       p.products_qty_box_status";

      $listing_sql .= " FROM " . TABLE_PRODUCTS . " p" .
     " LEFT JOIN " . TABLE_SPECIALS . " s on p.products_id = s.products_id" .
     " LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id" .
     " JOIN " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on p.products_id = p2c.products_id" .
       ($filter_attr == true ? " JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " p2a on p.products_id = p2a.products_id" .
       " JOIN " . TABLE_PRODUCTS_OPTIONS . " po on p2a.options_id = po.products_options_id" .
     " JOIN " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov on p2a.options_values_id = pov.products_options_values_id" .
     (defined('TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK') ? " JOIN " . TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK . " p2as on p.products_id = p2as.products_id " : "") : '');

      $listing_sql .= " WHERE p.products_status = 1
       and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
       and p2c.categories_id = '" . (int)$current_category_id . "'" .
       $filter .
     " GROUP BY p.products_id " .
     $having .
       $alpha_sort;
    }
  }
// eof dynamic filter 2 of 2
?>

Existing addon default_filter.php

<?php
  if (!isset($select_column_list)) $select_column_list = "";
   // show the products of a specified manufacturer
  if (isset($_GET['manufacturers_id']) && $_GET['manufacturers_id'] != '' ) {
    if (isset($_GET['filter_id']) && zen_not_null($_GET['filter_id'])) {
// We are asked to show only a specific category
      $listing_sql = "select " . $select_column_list . " p.products_id, p.products_type, p.master_categories_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, pd.products_description, if(s.status = 1, s.specials_new_products_price, NULL) AS specials_new_products_price, IF(s.status = 1, s.specials_new_products_price, p.products_price) as final_price, p.products_sort_order, p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status
       from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id , " .
       TABLE_PRODUCTS_DESCRIPTION . " pd, " .
       TABLE_MANUFACTURERS . " m, " .
       TABLE_PRODUCTS_TO_CATEGORIES . " p2c
       where p.products_status = 1
         and p.manufacturers_id = m.manufacturers_id
         and m.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'
         and p.products_id = p2c.products_id
         and pd.products_id = p2c.products_id
         and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'

         ";/*BOF CUSTOM MODULE 1 of 4*/
         if(!empty($sub_cats)) 
         	$listing_sql .=  "and p2c.categories_id IN($sub_cats)" .
         $alpha_sort;
         else 
         /*EOF CUSTOM MODULE 1 of 4*/ $listing_sql .=  "

         and p2c.categories_id = '" . (int)$_GET['filter_id'] . "'" .
         $alpha_sort;
    } else {
// We show them all
      $listing_sql = "select " . $select_column_list . " p.products_id, p.products_type, p.master_categories_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, pd.products_description, IF(s.status = 1, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status = 1, s.specials_new_products_price, p.products_price) as final_price, p.products_sort_order, p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status
      from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " .
      TABLE_PRODUCTS_DESCRIPTION . " pd, " .
      TABLE_MANUFACTURERS . " m
      where p.products_status = 1
        and pd.products_id = p.products_id
        and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'

         ";/*BOF CUSTOM MODULE 2 of 4*/
         if(!empty($sub_cats)) 
         	$listing_sql .=  "and p2c.categories_id IN($sub_cats)" .
         $alpha_sort;
         else 
         /*EOF CUSTOM MODULE 2 of 4*/ $listing_sql .=  "

        and p.manufacturers_id = m.manufacturers_id
        and m.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'" .
        $alpha_sort;
    }
  } else {
// show the products in a given category
    if (isset($_GET['filter_id']) && zen_not_null($_GET['filter_id'])) {
// We are asked to show only specific category
      $listing_sql = "select " . $select_column_list . " p.products_id, p.products_type, p.master_categories_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, pd.products_description, IF(s.status = 1, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status = 1, s.specials_new_products_price, p.products_price) as final_price, p.products_sort_order, p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status
      from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " .
      TABLE_PRODUCTS_DESCRIPTION . " pd, " .
      TABLE_MANUFACTURERS . " m, " .
      TABLE_PRODUCTS_TO_CATEGORIES . " p2c
      where p.products_status = 1
        and p.manufacturers_id = m.manufacturers_id
        and m.manufacturers_id = '" . (int)$_GET['filter_id'] . "'
        and p.products_id = p2c.products_id
        and pd.products_id = p2c.products_id
        and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'

         ";/*BOF CUSTOM MODULE 3 of 4*/
         if(!empty($sub_cats)) 
         	$listing_sql .=  "and p2c.categories_id IN($sub_cats)" .
         $alpha_sort;
         else 
         /*BOF CUSTOM MODULE 3 of 4*/ $listing_sql .=  "

        and p2c.categories_id = '" . (int)$current_category_id . "'" .
        $alpha_sort;
    } else {
// We show them all
      $listing_sql = "select " . $select_column_list . " p.products_id, p.products_type, p.master_categories_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, pd.products_description, IF(s.status = 1, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status =1, s.specials_new_products_price, p.products_price) as final_price, p.products_sort_order, p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status
       from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " .
       TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " .
       TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p2c.products_id = s.products_id
       where p.products_status = 1
         and p.products_id = p2c.products_id
         and pd.products_id = p2c.products_id
         and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'

         ";/*BOF CUSTOM MODULE 4 of 4*/
         if(!empty($sub_cats)) 
         	$listing_sql .=  "and p2c.categories_id IN($sub_cats)" .
         $alpha_sort;
         else 
         /*BOF CUSTOM MODULE 4 of 4*/ $listing_sql .=  "

         and p2c.categories_id = '" . (int)$current_category_id . "'" .
         $alpha_sort;
    }
  }
?>