Jump to content



Latest News: (loading..)

- - - - -

Printer Ink & Toner Filter


  • Please log in to reply
59 replies to this topic

#1   nsb

nsb
  • Members
  • 21 posts
  • Real Name:Adam Gersbach
  • Gender:Male
  • Location:Blue Mountains, Australia

Posted 16 November 2009 - 09:46 AM

http://addons.oscommerce.com/info/7116

Provides a complete printer filter for ink and toner products.

Very simple install.

Includes sample database with many of the major printer makes and models.

Optional empty database that could be used as a filter system for any type of products associated with a make and/or model such as products for vehicles.

Live test example is here

Video of filter in action

http://addons.oscommerce.com/info/7116

This is only V1 so feel free to improve and share any changes here.

#2   majerfra

majerfra
  • Members
  • 64 posts
  • Real Name:F. Majer

Posted 17 November 2009 - 07:42 AM

Hello,

very useful contribution, thanx!!!!
Is it possible to arrange to associate products by model not by products ID?

Regards
F. Majer

#3   nsb

nsb
  • Members
  • 21 posts
  • Real Name:Adam Gersbach
  • Gender:Male
  • Location:Blue Mountains, Australia

Posted 17 November 2009 - 08:32 AM

Thank you I hope you can find good use for it.

The products are displayed using the product listing file, includes/modules/product_listing.php with sorting settings in admin.

To sort by model could be done quite easily editing the catalog/filter_printer.php file. To have the option to do this is a good idea for next version.

I may wait a week or so and see if more ideas come up before I upload a new version.

Thanks,
Adam

#4   nsb

nsb
  • Members
  • 21 posts
  • Real Name:Adam Gersbach
  • Gender:Male
  • Location:Blue Mountains, Australia

Posted 17 November 2009 - 09:43 AM

If you wanted to sort by model now with a quick hack you can do this.

Open catalog/filter_printer.php

Find:
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and FIND_IN_SET(p.products_id,'".$productids."')";

Replace with:
$listing_sql = "select " . $select_column_list . " p.products_id, p.products_model, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and FIND_IN_SET(p.products_id,'".$productids."') order by products_model";

By doing this you are just including p.products_model in the string then at the end of the string you are adding order by products_model

Hope this helps.

#5   nsb

nsb
  • Members
  • 21 posts
  • Real Name:Adam Gersbach
  • Gender:Male
  • Location:Blue Mountains, Australia

Posted 17 November 2009 - 10:04 AM

View Postmajerfra, on 17 November 2009 - 07:42 AM, said:

Hello,

very useful contribution, thanx!!!!
Is it possible to arrange to associate products by model not by products ID?

Regards
F. Majer
Hi, thanks I'm happy you think Printer Ink & Toner Filter is useful :)

I'm just learning how to use this forum and I actually replied twice to your question but created a new thread, the answers are there.... ooops.

#6   alejovel

alejovel
  • Members
  • 1 posts
  • Real Name:Alex Lopez

Posted 19 November 2009 - 08:13 PM

View Postnsb, on 17 November 2009 - 10:04 AM, said:

Hi, thanks I'm happy you think Printer Ink & Toner Filter is useful :)

I'm just learning how to use this forum and I actually replied twice to your question but created a new thread, the answers are there.... ooops.

NSB, this contribution is just perfect, I can't thank you enough. I like it so much that I would love to use it directly in my index, so customers are able to find it right away. Is there anyway to put the dropdown menus in a box on the left, or somewhere in the index?

#7   opty

opty
  • Members
  • 1 posts
  • Real Name:Karen Lee

Posted 27 November 2009 - 01:19 PM

Hi, thanks for the post!

I'm testing Printer Ink & Toner Filter on Windows XP with the following testing environment:
○ Apache 2.2.12 (IPv6 enabled) + OpenSSL 0.9.8k
○ MySQL 5.1.37 + PBXT engine
○ PHP 5.3.0
○ phpMyAdmin 3.2.0.1

Have you any ideas why the script would not run on local test machine mentioned above (even though it shows the first drop-down box "Select One" (Find products by selecting the printer make and model)?

Thanks.

#8   spiKRE

spiKRE
  • Members
  • 3 posts
  • Real Name:Peter

Posted 24 February 2010 - 09:25 AM

Hi,

Alt1:
Is it possible to define the length of the fields? It's doesn't look like that nice when the length of the field depends on the category-name. Would it be possible to set the the same?

Alt2:
Is it possible to not make the fields "jump" one line down?

#9   nsb

nsb
  • Members
  • 21 posts
  • Real Name:Adam Gersbach
  • Gender:Male
  • Location:Blue Mountains, Australia

Posted 01 April 2010 - 09:11 AM

View Postopty, on 27 November 2009 - 01:19 PM, said:

Hi, thanks for the post!

I'm testing Printer Ink & Toner Filter on Windows XP with the following testing environment:
○ Apache 2.2.12 (IPv6 enabled) + OpenSSL 0.9.8k
○ MySQL 5.1.37 + PBXT engine
○ PHP 5.3.0
○ phpMyAdmin 3.2.0.1

Have you any ideas why the script would not run on local test machine mentioned above (even though it shows the first drop-down box "Select One" (Find products by selecting the printer make and model)?

Thanks.
I think it may have something to do with the catalog/js/ajaxd.js file may not work as expected locally.

View PostspiKRE, on 24 February 2010 - 09:25 AM, said:

Hi,

Alt1:
Is it possible to define the length of the fields? It's doesn't look like that nice when the length of the field depends on the category-name. Would it be possible to set the the same?
Yes, you could do this with CSS.

In your stylesheet search for:
checkbox, input, radio, select
inside the { } you can set your width. For example: width: 200px;

Alt2:
Is it possible to not make the fields "jump" one line down?


I'm not exactly sure what you mean but you may be able to make the fields appear better with CSS or javascript.

If possible please provide more details or a screenshot.

PS
Sorry for delay in replies but I never received email notifications of any posts

Edited by nsb, 01 April 2010 - 09:13 AM.


#10   nsb

nsb
  • Members
  • 21 posts
  • Real Name:Adam Gersbach
  • Gender:Male
  • Location:Blue Mountains, Australia

Posted 01 April 2010 - 10:36 AM

View Postalejovel, on 19 November 2009 - 08:13 PM, said:

NSB, this contribution is just perfect, I can't thank you enough. I like it so much that I would love to use it directly in my index, so customers are able to find it right away. Is there anyway to put the dropdown menus in a box on the left, or somewhere in the index?
Great ideas and I'm happy you like it :)

Having it sit in the middle of the index page, similar to New Products can be done but would be challenge. A sidebox, with results in the middle of the page,could be done but would be an even bigger challenge.

There are probably several ways it could be done but it really depends on what is on your home page.

A simple solution would be to combine the catalog/index.php file with the catalog/filter_printer.php file to make one single index.php file. Please let me know if you would like this solution and I will do it for you. If your catalog/index.php has been edited at all please post or upload it here.

#11   dukejack

dukejack
  • Members
  • 3 posts
  • Real Name:Lars
  • Gender:Male

Posted 13 April 2010 - 04:39 PM

thanks for the contrib.
In my case I certainly have the following problem: when I go to open a new browser for the link and printer filter. does not the selection. what may be the cause for this? only when I press again on the link does the selection.

here to test live

sorry for my bad englisch

Edited by dukejack, 13 April 2010 - 04:40 PM.


#12   dukejack

dukejack
  • Members
  • 3 posts
  • Real Name:Lars
  • Gender:Male

Posted 13 April 2010 - 08:07 PM

The following error is displayed in IE. calling the first page (on filter_printer.php)after re-click on the link is the wrong way

Details about the error to the site


Message: ':' expected
Line: 235
Sign: 39
Code: 0
URI: "http://www.domain.de/ordner/filter_printer.php?filterid=1?osCsid=1c8bd5b96ea2e9a7e5ca722ae921b541"

Edited by dukejack, 13 April 2010 - 08:08 PM.


#13   dukejack

dukejack
  • Members
  • 3 posts
  • Real Name:Lars
  • Gender:Male

Posted 14 April 2010 - 08:01 PM

have Force Cookie Use on Youtube to true and now it works. Otherwise always depends on the oscID link drann the first Page.

#14   nsb

nsb
  • Members
  • 21 posts
  • Real Name:Adam Gersbach
  • Gender:Male
  • Location:Blue Mountains, Australia

Posted 17 April 2010 - 02:33 AM

Please replace all code in: /includes/boxes/filter_printer.php with the following to avoid the session id problem.

<?php
/*
  catalog/includes/boxes/filter_printer.php 

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 - 2010 osCommerce

  Released under the GNU General Public License
*/
?>
<!-- Printer Filter //-->
		  <tr>
			<td>
<?php
  $info_box_contents = array();
  $info_box_contents[] = array('text' => BOX_HEADING_FILTER_PRINTER);

  new infoBoxHeading($info_box_contents, false, false);

  $info_box_contents = array();
  $info_box_contents[] = array('text' => '<a "href=' . tep_href_link(FILENAME_FILTER_PRINTER_FINDER) . '>Ink &amp; Toner Finder</a>');

  new infoBox($info_box_contents);
?>
			</td>
		  </tr>
<!-- Printer Filter eof //-->


The original file simply had a link to the page.

I will upload this file in the addon section to save future users having this same problem.

#15   Darkayer

Darkayer
  • Members
  • 13 posts
  • Real Name:Niek Rabelink
  • Gender:Male
  • Location:Zutphen / Netherlands

Posted 20 April 2010 - 08:47 AM

Very nice contrib.

I was wondering if it was possible to let the output say something like (No product for this printer) or so when there is no product linked to a model?
Since there is a line in the Text files (TEXT_NO_PRODUCTS) it should be right?

#16   nsb

nsb
  • Members
  • 21 posts
  • Real Name:Adam Gersbach
  • Gender:Male
  • Location:Blue Mountains, Australia

Posted 24 April 2010 - 06:08 AM

View PostDarkayer, on 20 April 2010 - 08:47 AM, said:

Very nice contrib.

I was wondering if it was possible to let the output say something like (No product for this printer) or so when there is no product linked to a model?
Since there is a line in the Text files (TEXT_NO_PRODUCTS) it should be right?
Yes, that's correct. Change the text in the catalog/includes/languages/english/filter_printer.php

#17   BLaCKBuLL

BLaCKBuLL
  • Members
  • 3 posts
  • Real Name:Serdar

Posted 18 May 2010 - 03:39 PM

Hi Adam
First thanks for this useful contirbution...

I am using PHP 5.0.75 and install V1.2 Full Package

I receive

Parse error: syntax error, unexpected '<' in /................../catalog/includes/boxes/filter_printer.php on line 13

on main page...

What do you think about this...

Ty

#18   nsb

nsb
  • Members
  • 21 posts
  • Real Name:Adam Gersbach
  • Gender:Male
  • Location:Blue Mountains, Australia

Posted 19 May 2010 - 12:37 AM

View PostBLaCKBuLL, on 18 May 2010 - 03:39 PM, said:

Hi Adam
First thanks for this useful contirbution...

I am using PHP 5.0.75 and install V1.2 Full Package

I receive

Parse error: syntax error, unexpected '<' in /................../catalog/includes/boxes/filter_printer.php on line 13

on main page...

What do you think about this...

Ty

Sorry about that but I messed up and uploaded the wrong zip file for v1.2. Version 1.2 doesn't work...

Please download and install the new version 1.3.
  
http://addons.oscommerce.com/info/7116

#19   Envelo

Envelo
  • Members
  • 14 posts
  • Real Name:Francisco Jose

Posted 20 May 2010 - 01:13 AM

Hello, Thank for this addon, but i have 2 ideas,

1º take "box seach" on filter_printer_products.php. (when you have to many product this is very important)
2º maybe using ajax will get less loads of the webpage

this is only some ideas, i will try to make this but maybe i do not get it

Thank you

#20   nsb

nsb
  • Members
  • 21 posts
  • Real Name:Adam Gersbach
  • Gender:Male
  • Location:Blue Mountains, Australia

Posted 20 May 2010 - 01:31 AM

View PostEnvelo, on 20 May 2010 - 01:13 AM, said:

Hello, Thank for this addon, but i have 2 ideas,

1º take "box seach" on filter_printer_products.php. (when you have to many product this is very important)
2º maybe using ajax will get less loads of the webpage

this is only some ideas, i will try to make this but maybe i do not get it

Thank you
Great ideas :) and thank you for trying to make it. If you have any questions feel free to ask.