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

Dynamic Filter [Support Thread]

Views: 652,533

Results 561 to 580 of 809
20 Mar 2015, 8:12 PM
#561
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Dynamic Filter [Support Thread]

I have this installed on a Zen Cart 1.5.4 using your tip to 'skip the functions_genral.php file'

I'm having one issue. The filtering is only offering the manufacturer and price options and none of the attributes. My understanding is leaving the Include Options and Exclude Options blank would add any attributes that exist (on the product category being viewed) as filtering options.

Is that incorrect, or is there something else going on?

26 Mar 2015, 11:57 PM
#562
xergos055 avatar

xergos055

New Zenner

Join Date:
Nov 2008
Posts:
36
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Design75:

Nope. Still working on a strange bug when filtering categories and manufacturers, and my time is limited. Paying customers go first :cool:

You can use the latest version for now, and skip the edits on the functions_genral.php file

Hi!

To resolve the strange problem when filtering categories and manufacturers, in catalog/includes/templates/YOUR_TEMPLATE/sideboxes/tpl_dynamic_filter.php
after: if (count($unfilteredCategories) > 0) {
insert
$group = DYNAMIC_FILTER_PREFIX . str_replace(' ', '', DYNAMIC_FILTER_CATEGORY_GROUP);

**AND **

after: if (count($unfilteredManufacturers) > 0) {
insert
$group = DYNAMIC_FILTER_PREFIX . str_replace(' ', '', DYNAMIC_FILTER_MANUFACTURER_GROUP);

27 Mar 2015, 7:08 AM
#563
design75 avatar

design75

Totally Zenned

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

Re: Dynamic Filter [Support Thread]

xergos055:

Hi!

To resolve the strange problem when filtering categories and manufacturers, in catalog/includes/templates/YOUR_TEMPLATE/sideboxes/tpl_dynamic_filter.php
after: if (count($unfilteredCategories) > 0) {
insert
$group = DYNAMIC_FILTER_PREFIX . str_replace(' ', '', DYNAMIC_FILTER_CATEGORY_GROUP);

**AND **

after: if (count($unfilteredManufacturers) > 0) {
insert
$group = DYNAMIC_FILTER_PREFIX . str_replace(' ', '', DYNAMIC_FILTER_MANUFACTURER_GROUP);

Thank you for your input. It it very much appreciated.:thumbsup: Those line were already present in the code, but in rearranging the code were moved to "includes/modules/sideboxes/YOUR_TEMPLATE/dynamic_filter.php".
I will update the code and test it. After that the only hurdle is to update the documentation.

Edit: the change in the code works :clap:

27 Mar 2015, 11:05 AM
#564
xergos055 avatar

xergos055

New Zenner

Join Date:
Nov 2008
Posts:
36
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

With welcome!

28 Mar 2015, 12:36 AM
#565
darkmen avatar

darkmen

New Zenner

Join Date:
Jan 2013
Posts:
45
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Did it work? I installed this module to 1.5.4 version and I have a problem to finsh this instalation. When I insert SQL code for finish, system write always WARNING: An Error occurred, please refresh the page and try again. I changed functions_general.php also, but no changes. Does anybody know where is a problem?

5 Apr 2015, 10:09 AM
#566
uriii avatar

uriii

New Zenner

Join Date:
Apr 2015
Location:
España
Posts:
4
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

hello I need your help, I have zencart 1.5.3 and the plugin I've tested and works correctly, but the problem is that I have deactivated left and right columns, then I need to visualize the plugin on top of each category, which is the php code that calls the function or could do? I tried with css but it still fails and this plugin is essential for me ... please help thanks !!!!

5 Apr 2015, 10:21 AM
#567
design75 avatar

design75

Totally Zenned

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

Re: Dynamic Filter [Support Thread]

uriii:

hello I need your help, I have zencart 1.5.3 and the plugin I've tested and works correctly, but the problem is that I have deactivated left and right columns, then I need to visualize the plugin on top of each category, which is the php code that calls the function or could do? I tried with css but it still fails and this plugin is essential for me ... please help thanks !!!!

Sorry to tell you, but currently the one column feature is not yet supported by this module. It is on my (very long) to do list, but I really can't promise any time frame. I you are haing some spare time, feel free to help with this module, and I'll add your code to it.

5 Apr 2015, 4:24 PM
#568
uriii avatar

uriii

New Zenner

Join Date:
Apr 2015
Location:
España
Posts:
4
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Design75:

Sorry to tell you, but currently the one column feature is not yet supported by this module. It is on my (very long) to do list, but I really can't promise any time frame. I you are haing some spare time, feel free to help with this module, and I'll add your code to it.

if possible I would compensate by paypal, thank you in advance !!!!!:D

9 Apr 2015, 9:03 AM
#569
pompidompie avatar

pompidompie

Zen Follower

Join Date:
Mar 2015
Posts:
105
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

When looking for a nice filter for my product pages (instead of the filter by alphabeth) I come across this one. I like it allot, because it solves a lot of problems like:
I would like to have a left colomn, but only with something usefull in it and wauw this is it!
I think the most important thing for customers is to be able to sort by price. The most user friendly one, i think, is the option to choise from 0 - 50 dollar, 50 - 100 dollar etc. No dropdown, not have to move your big finger over the little screan from left to right, and so on.

What i could not find with the search button for this thread is how and if it shows on mobile phones.
(I am using zencart 1.5.4. with the westminster new template)

9 Apr 2015, 12:37 PM
#570
pompidompie avatar

pompidompie

Zen Follower

Join Date:
Mar 2015
Posts:
105
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

I started with winmerge to compage the files from the dynimac filter, to the ones from my webshop.
But after that i don´t know what else to do, because the readme is not working.
Can someone copie that for me, or tell me what it says?

9 Apr 2015, 12:57 PM
#571
pompidompie avatar

pompidompie

Zen Follower

Join Date:
Mar 2015
Posts:
105
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

I'm sorry for having another question this quick :blush:

I have some files te changes but I don't know how to, because i have not enough experience.

For example this one:
Featured products header

[PHP]<?php
/**
 * Featured Products
 *
 * @package page
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: header_php.php 6912 2007-09-02 02:23:45Z drbyte $
 */
require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
$breadcrumb->add(NAVBAR_TITLE);
// display order dropdown
$disp_order_default = PRODUCT_FEATURED_LIST_SORT_DEFAULT;

require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_LISTING_DISPLAY_ORDER));

$featured_products_array = array();

// bof dynamic filter 1 of 1
include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_DYNAMIC_FILTER));

$listing_sql = "SELECT p.products_id, p.products_type, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name, 
                  p.products_model, p.products_quantity, p.products_weight, p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status, p.master_categories_id, m.manufacturers_id";

$listing_sql .= " FROM " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id" .
               " LEFT JOIN " . TABLE_FEATURED . " f on p.products_id = f.products_id" .
               " LEFT JOIN " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on p.products_id = p2c.products_id" .
               " LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.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 f.status = 1 and pd.language_id = :languagesID " .
$filter . " GROUP BY p.products_id " . $having . $order_by;
$listing_sql = $db->bindVars($listing_sql, ':languagesID', $_SESSION['languages_id'], 'integer');
$featured_products_split = new splitPageResults($listing_sql, MAX_DISPLAY_PRODUCTS_FEATURED_PRODUCTS);
// eof dynamic filter 1 of 1

//check to see if we are in normal mode ... not showcase, not maintenance, etc
$show_submit = zen_run_normal();

// check whether to use multiple-add-to-cart, and whether top or bottom buttons are displayed
if (PRODUCT_FEATURED_LISTING_MULTIPLE_ADD_TO_CART > 0 and $show_submit == true and $featured_products_split->number_of_rows > 0) {

  // check how many rows
  $check_products_all = $db->Execute($featured_products_split->sql_query);
  $how_many = 0;
  while (!$check_products_all->EOF) {
    if (zen_has_product_attributes($check_products_all->fields['products_id'])) {
    } else {
      // needs a better check v1.3.1
      if ($check_products_all->fields['products_qty_box_status'] != 0) {
        if (zen_get_products_allow_add_to_cart($check_products_all->fields['products_id']) !='N') {
          if ($check_products_all->fields['product_is_call'] == 0) {
            if ((SHOW_PRODUCTS_SOLD_OUT_IMAGE == 1 and $check_products_all->fields['products_quantity'] > 0) or SHOW_PRODUCTS_SOLD_OUT_IMAGE == 0) {
              if ($check_products_all->fields['products_type'] != 3) {
                if (zen_has_product_attributes($check_products_all->fields['products_id']) < 1) {
                  $how_many++;
                }
              }
            }
          }
        }
      }
    }
    $check_products_all->MoveNext();
  }

  if ( (($how_many > 0 and $show_submit == true and $featured_products_split->number_of_rows > 0) and (PRODUCT_FEATURED_LISTING_MULTIPLE_ADD_TO_CART == 1 or  PRODUCT_FEATURED_LISTING_MULTIPLE_ADD_TO_CART == 3)) ) {
    $show_top_submit_button = true;
  } else {
    $show_top_submit_button = false;
  }
  if ( (($how_many > 0 and $show_submit == true and $featured_products_split->number_of_rows > 0) and (PRODUCT_FEATURED_LISTING_MULTIPLE_ADD_TO_CART >= 2)) ) {
    $show_bottom_submit_button = true;
  } else {
    $show_bottom_submit_button = false;
  }
}
?>
```\[/PHP]

Has to go into this one (my file)
```php
<?php
/**Single Listing Template mod v1.8
 * Featured Products header_php.php
 *
 * @package page
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: header_php.php 6912 2007-09-02 02:23:45Z drbyte $
 */
require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
$breadcrumb->add(NAVBAR_TITLE);
// display order dropdown
$disp_order_default = PRODUCT_FEATURED_LIST_SORT_DEFAULT;

require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_LISTING_DISPLAY_ORDER));

$featured_products_array = array();

$listing_sql = "SELECT p.products_id, p.products_type, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name, p.products_model, p.products_quantity, p.products_weight, p.product_is_call,
                                  p.product_is_always_free_shipping, p.products_qty_box_status,
                                  p.master_categories_id, m.manufacturers_id
                                  FROM (" . TABLE_PRODUCTS . " p
                                  LEFT JOIN " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " .
TABLE_PRODUCTS_DESCRIPTION . " pd
                                  LEFT JOIN " . TABLE_FEATURED . " f on pd.products_id = f.products_id )
                                  WHERE p.products_status = 1 and p.products_id = f.products_id and f.status = 1
                                  AND p.products_id = pd.products_id and pd.language_id = :languagesID " .
$order_by;

$listing_sql = $db->bindVars($listing_sql, ':languagesID', $_SESSION['languages_id'], 'integer');
$featured_products_split = new splitPageResults($featured_products_query_raw, MAX_DISPLAY_PRODUCTS_FEATURED_PRODUCTS);

//check to see if we are in normal mode ... not showcase, not maintenance, etc
  $show_submit = zen_run_normal();

$define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
  'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
  'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
  'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
  'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
  'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
  'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE);

  /*                         ,
  'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);
  */
  asort($define_list);
  reset($define_list);
  $column_list = array();
  foreach ($define_list as $key => $value)
  {
    if ($value > 0) $column_list[] = $key;
  }
?>

I see where bof 1 of 1 begins and ends, but because my file looks so differend i really don't know wich is wich and what i should replace.
I don't want to break anything offcorse. It's just that I never build websites and therefor can not read the code :blush:

9 Apr 2015, 2:35 PM
#572
pompidompie avatar

pompidompie

Zen Follower

Join Date:
Mar 2015
Posts:
105
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Seeing the files in color in my post above, made it easyer for me to see what i am doing. SO i tryed to change the 4 files i still needed to do and then installed the sql.

It did not work, had to use the second one given by design in this thread.

Then i turned on the dynamic filter in the layout contole and there it is, BUT
I now see brand, color and name, but i swear i just saw a lot more before i refreshed the page. Am I going crazy or....
Am I doing something wrong? (i don't have a readme so i don't know)

10 Apr 2015, 7:16 AM
#573
pompidompie avatar

pompidompie

Zen Follower

Join Date:
Mar 2015
Posts:
105
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

I need a little help again :blush:

For the westminster new template I had to install this file:
includes/modules/pages/specials/header.php
I know have to change is for the dynamic filter to work.
But because the code is so very different, i don't know how to do that.

This is the westminster specials header

<?php
/** Single Listing template mod v1.8
 * Specials header_php.php
 *
 * @package page
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: header_php.php 3000 2006-02-09 21:11:37Z wilt $
 */

require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
$breadcrumb->add(NAVBAR_TITLE);
//lines25-71 moved to main_template_vars
//bof Single Listing Template
if (MAX_DISPLAY_SPECIAL_PRODUCTS > 0 ) {
	$disp_order_default = PRODUCT_ALL_LIST_SORT_DEFAULT;
	require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_LISTING_DISPLAY_ORDER));
	$order_by = isset($order_by) ? $order_by : 'ORDER BY s.specials_date_added DESC';
	if (MAX_DISPLAY_SPECIAL_PRODUCTS > 0 ) {
			$listing_sql = "SELECT p.products_id, p.products_image, pd.products_name,
                          p.master_categories_id, m.manufacturers_name, p.products_model, p.products_quantity, p.products_weight
                         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))
                         WHERE p.products_id = s.products_id and p.products_id = pd.products_id and p.products_status = '1'
                         AND s.status = 1
                         AND pd.language_id = :languagesID
                         ORDER BY s.specials_date_added DESC";

		$listing_sql = $db->bindVars($listing_sql, ':languagesID', $_SESSION['languages_id'], 'integer');
		//check to see if we are in normal mode ... not showcase, not maintenance, etc
		$show_submit = zen_run_normal();

		$define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
		'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
		'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
		'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
		'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
		'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
		'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE);

		/*                         ,
		'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);
		*/
		asort($define_list);
		reset($define_list);
		$column_list = array();
		foreach ($define_list as $key => $value)
		{
			if ($value > 0) $column_list[] = $key;
		}
	}
}//eof Single Listing Template
?>

And this is the specials file with a BOF I have to put in the westminster specials header file

<?php
/**
 * Specials
 *
 * @package page
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: header_php.php 3000 2006-02-09 21:11:37Z wilt $
 */

require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
$breadcrumb->add(NAVBAR_TITLE);

// bof dynamic filter 1 of 1
if (MAX_DISPLAY_SPECIAL_PRODUCTS > 0 ) {
  include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_DYNAMIC_FILTER));

  $listing_sql = "SELECT DISTINCT p.products_id, p.products_image, pd.products_name, p.master_categories_id, p.manufacturers_id";

  $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" .
	" LEFT 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 s.status = 1" .
    " AND pd.language_id = :languagesID" . $filter . " GROUP BY p.products_id " . $having . 'ORDER BY s.specials_date_added DESC';

  $listing_sql = $db->bindVars($listing_sql, ':languagesID', $_SESSION['languages_id'], 'integer');
  $specials_split = new splitPageResults($listing_sql, MAX_DISPLAY_SPECIAL_PRODUCTS);
}
// eof dynamic filter 1 of 1 
?>

Can someone help me with this? I have everything working fine, except for this file so now I get a blanc page on the specials.

10 Apr 2015, 7:58 AM
#574
design75 avatar

design75

Totally Zenned

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

Re: Dynamic Filter [Support Thread]

Pompidompie:

I need a little help again :blush:

For the westminster new template I had to install this file:
includes/modules/pages/specials/header.php
I know have to change is for the dynamic filter to work.
But because the code is so very different, i don't know how to do that.

This is the westminster specials header

<?php /** Single Listing template mod v1.8 * Specials header_php.php * * @package page * @copyright Copyright 2003-2006 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: header_php.php 3000 2006-02-09 21:11:37Z wilt $ */ require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php')); $breadcrumb->add(NAVBAR_TITLE); //lines25-71 moved to main_template_vars //bof Single Listing Template if (MAX_DISPLAY_SPECIAL_PRODUCTS > 0 ) { $disp_order_default = PRODUCT_ALL_LIST_SORT_DEFAULT; require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_LISTING_DISPLAY_ORDER)); $order_by = isset($order_by) ? $order_by : 'ORDER BY s.specials_date_added DESC'; if (MAX_DISPLAY_SPECIAL_PRODUCTS > 0 ) { $listing_sql = "SELECT p.products_id, p.products_image, pd.products_name, p.master_categories_id, m.manufacturers_name, p.products_model, p.products_quantity, p.products_weight 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)) WHERE p.products_id = s.products_id and p.products_id = pd.products_id and p.products_status = '1' AND s.status = 1 AND pd.language_id = :languagesID ORDER BY s.specials_date_added DESC"; $listing_sql = $db->bindVars($listing_sql, ':languagesID', $_SESSION['languages_id'], 'integer'); //check to see if we are in normal mode ... not showcase, not maintenance, etc $show_submit = zen_run_normal(); $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL, 'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME, 'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER, 'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE, 'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY, 'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT, 'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE); /* , 'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW); */ asort($define_list); reset($define_list); $column_list = array(); foreach ($define_list as $key => $value) { if ($value > 0) $column_list[] = $key; } } }//eof Single Listing Template ?>
> 
> And this is the specials file with a BOF I have to put in the westminster specials header file
> ```php
<?php
/**
 * Specials
 *
 * @package page
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: header_php.php 3000 2006-02-09 21:11:37Z wilt $
 */

require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
$breadcrumb->add(NAVBAR_TITLE);

// bof dynamic filter 1 of 1
if (MAX_DISPLAY_SPECIAL_PRODUCTS > 0 ) {
  include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_DYNAMIC_FILTER));

  $listing_sql = "SELECT DISTINCT p.products_id, p.products_image, pd.products_name, p.master_categories_id, p.manufacturers_id";

  $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" .
    " LEFT 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 s.status = 1" .
    " AND pd.language_id = :languagesID" . $filter . " GROUP BY p.products_id " . $having . 'ORDER BY s.specials_date_added DESC';

  $listing_sql = $db->bindVars($listing_sql, ':languagesID', $_SESSION['languages_id'], 'integer');
  $specials_split = new splitPageResults($listing_sql, MAX_DISPLAY_SPECIAL_PRODUCTS);
}
// eof dynamic filter 1 of 1 
?>

Can someone help me with this? I have everything working fine, except for this file so now I get a blanc page on the specials.

I have not tested it, but i think the code below will work

 <?php
/** Single Listing template mod v1.8
 * Specials header_php.php
 *
 * @package page
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: header_php.php 3000 2006-02-09 21:11:37Z wilt $
 */

require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
$breadcrumb->add(NAVBAR_TITLE);
//lines25-71 moved to main_template_vars
//bof Single Listing Template
// bof dynamic filter 1 of 1
if (MAX_DISPLAY_SPECIAL_PRODUCTS > 0 ) {
  include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_DYNAMIC_FILTER));
    $disp_order_default = PRODUCT_ALL_LIST_SORT_DEFAULT;
    require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_LISTING_DISPLAY_ORDER));
    $order_by = isset($order_by) ? $order_by : 'ORDER BY s.specials_date_added DESC';
    if (MAX_DISPLAY_SPECIAL_PRODUCTS > 0 ) {
            $listing_sql = "SELECT p.products_id, p.products_image, pd.products_name,
                          p.master_categories_id, m.manufacturers_name, p.products_model, p.products_quantity, p.products_weight
                         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
                         LEFT 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 " : "") : '') . "
                         WHERE p.products_id = s.products_id
                         AND p.products_id = pd.products_id
                         AND p.products_status = '1'
                         AND s.status = 1
                         AND pd.language_id = :languagesID " . 
                         $filter . "
                         GROUP BY p.products_id " . 
                         $having . "
                         ORDER BY s.specials_date_added DESC";

        $listing_sql = $db->bindVars($listing_sql, ':languagesID', $_SESSION['languages_id'], 'integer');
        //check to see if we are in normal mode ... not showcase, not maintenance, etc
        $show_submit = zen_run_normal();

        $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
        'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
        'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
        'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
        'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
        'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
        'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE);

        /*                         ,
        'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);
        */
        asort($define_list);
        reset($define_list);
        $column_list = array();
        foreach ($define_list as $key => $value)
        {
            if ($value > 0) $column_list[] = $key;
        }
    }
}//eof Single Listing Template
?> 
10 Apr 2015, 8:43 AM
#575
pompidompie avatar

pompidompie

Zen Follower

Join Date:
Mar 2015
Posts:
105
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Thank you Design.
Before, I got a blanc page witj absolutely nothing.
Now I see my webshop-the specials page again, but WARNING: An Error occurred, please refresh the page and try again.

When looking in the logs it says:
[10-Apr-2015 10:41:34 Europe/Berlin] PHP Warning: mysqli_query(): Empty query in C:\xampp\htdocs\zencart\includes\classes\db\mysql\query_factory.php on line 43

[10-Apr-2015 10:41:34 Europe/Berlin] PHP Fatal error: 0: :: ==> (as called by) C:\xampp\htdocs\zencart\includes\modules\pages\specials\main_template_vars.php on line 29 <== in C:\xampp\htdocs\zencart\includes\classes\db\mysql\query_factory.php on line 155

10 Apr 2015, 8:59 AM
#576
design75 avatar

design75

Totally Zenned

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

Re: Dynamic Filter [Support Thread]

Pompidompie:

Thank you Design.
Before, I got a blanc page witj absolutely nothing.
Now I see my webshop-the specials page again, but WARNING: An Error occurred, please refresh the page and try again.

When looking in the logs it says:
[10-Apr-2015 10:41:34 Europe/Berlin] PHP Warning: mysqli_query(): Empty query in C:\xampp\htdocs\zencart\includes\classes\db\mysql\query_factory.php on line 43

[10-Apr-2015 10:41:34 Europe/Berlin] PHP Fatal error: 0: :: ==> (as called by) C:\xampp\htdocs\zencart\includes\modules\pages\specials\main_template_vars.php on line 29 <== in C:\xampp\htdocs\zencart\includes\classes\db\mysql\query_factory.php on line 155

And if you replace the code from the earlier post with this one??

 <?php
/** Single Listing template mod v1.8
 * Specials header_php.php
 *
 * @package page
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: header_php.php 3000 2006-02-09 21:11:37Z wilt $
 */

require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
$breadcrumb->add(NAVBAR_TITLE);
//lines25-71 moved to main_template_vars
//bof Single Listing Template
// bof dynamic filter 1 of 1
if (MAX_DISPLAY_SPECIAL_PRODUCTS > 0 ) {
  include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_DYNAMIC_FILTER));
    $disp_order_default = PRODUCT_ALL_LIST_SORT_DEFAULT;
    require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_LISTING_DISPLAY_ORDER));
    $order_by = isset($order_by) ? $order_by : 'ORDER BY s.specials_date_added DESC';
    if (MAX_DISPLAY_SPECIAL_PRODUCTS > 0 ) {
            $listing_sql = "SELECT p.products_id, p.products_image, pd.products_name,
                          p.master_categories_id, m.manufacturers_name, p.products_model, p.products_quantity, p.products_weight
                         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
                         LEFT 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 " : "") : '') . "
                         WHERE p.products_id = s.products_id
                         AND p.products_id = pd.products_id
                         AND p.products_status = '1'
                         AND s.status = 1
                         AND pd.language_id = :languagesID " . 
                         $filter . "
                         GROUP BY p.products_id " . 
                         $having . "
                         ORDER BY s.specials_date_added DESC";

        $listing_sql = $db->bindVars($listing_sql, ':languagesID', $_SESSION['languages_id'], 'integer');
        $specials_split = new splitPageResults($listing_sql, MAX_DISPLAY_SPECIAL_PRODUCTS);
        //check to see if we are in normal mode ... not showcase, not maintenance, etc
        $show_submit = zen_run_normal();

        $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
        'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
        'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
        'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
        'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
        'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
        'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE);

        /*                         ,
        'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);
        */
        asort($define_list);
        reset($define_list);
        $column_list = array();
        foreach ($define_list as $key => $value)
        {
            if ($value > 0) $column_list[] = $key;
        }
    }
}//eof Single Listing Template
?> 
10 Apr 2015, 9:03 AM
#577
pompidompie avatar

pompidompie

Zen Follower

Join Date:
Mar 2015
Posts:
105
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

My first language is Dutch.
I see my website, I see the specials page, I see the breadcrums, but nothing below, the warning message is also gone.

But

The second language is English and there, when i click on the specials page, I get a blanc page again.

Logs:
[10-Apr-2015 11:00:54 Europe/Berlin] PHP Parse error: syntax error, unexpected 't' (T_STRING) in C:\xampp\htdocs\zencart\includes\languages\english\specials.php on line 24

10 Apr 2015, 9:30 AM
#578
pompidompie avatar

pompidompie

Zen Follower

Join Date:
Mar 2015
Posts:
105
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

I have removed a line from the languages file that should not be there and tatatatata at a first look everything works again.
Offcorse I still have to test it, to see that there is not still something wrong somewhere, but he, its a start.
Thank you so much Design!

10 Apr 2015, 9:39 AM
#579
design75 avatar

design75

Totally Zenned

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

Re: Dynamic Filter [Support Thread]

Pompidompie:

My first language is Dutch.
I see my website, I see the specials page, I see the breadcrums, but nothing below, the warning message is also gone.

But

The second language is English and there, when i click on the specials page, I get a blanc page again.

Logs:
[10-Apr-2015 11:00:54 Europe/Berlin] PHP Parse error: syntax error, unexpected 't' (T_STRING) in C:\xampp\htdocs\zencart\includes\languages\english\specials.php on line 24

That is not an isssue with the module, but you probably edited that fale and mad an error. Paste the contents and I'll take a look

10 Apr 2015, 9:52 AM
#580
pompidompie avatar

pompidompie

Zen Follower

Join Date:
Mar 2015
Posts:
105
Plugin Contributions:
0

Re: Dynamic Filter [Support Thread]

Yes your right. I had the problem that whem featured products is empty it shows TEXT_NO_PRODUCTS instead off the text sorry no products here (or something) So i fixed that with adding a define TEXT_NO_PRODUCTS to the featured products and specials languages files.
Its was fixing that problem, but then it made a new problem with giving me blanc pages after installing the dynamic filter.
So.... now I removed the Define TEXT_NO_PRODUCTS lines from the featured products and specials languages files. Solved my dynamic filter blanc page problem with that, but it gave me back the problem that the text TEXT_NO_PRODUCTS is showing again.

Keeps me busy :bow: