Jump to content
nsb

Printer Ink & Toner Filter

Recommended Posts

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.

Share this post


Link to post
Share on other sites

Hello,

 

very useful contribution, thanx!!!!

Is it possible to arrange to associate products by model not by products ID?

 

Regards

F. Majer

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

 

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 & 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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

 

Dear Adam

 

Thanks for adjustment

 

Now i dont recieve any error but i need ask an otherthing

 

TonerFilter is working with mozailla 3.6.3 perfectly but when i open with IE 7 nothing happens.You can find a picture as attachment.I am waiting your expect valuable comments...

 

Best Regards

 

for_adam.JPG

Share this post


Link to post
Share on other sites

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

 

i can't make it sorry

Share this post


Link to post
Share on other sites

Dear Adam

 

Thanks for adjustment

 

Now i dont recieve any error but i need ask an otherthing

 

TonerFilter is working with mozailla 3.6.3 perfectly but when i open with IE 7 nothing happens.You can find a picture as attachment.I am waiting your expect valuable comments...

 

Best Regards

Your syntax on the link is screwed up.

 

Look at the HTML source and you'll see this:

 

<a "href=http://www.orjinalsarf.com/filter_printer.php?filterid=1>Ink & Toner Finder</a>

It needs to be:

 

<a href="http://www.orjinalsarf.com/filter_printer.php?filterid=1">Ink & Toner Finder</a>


If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Share this post


Link to post
Share on other sites

Your syntax on the link is screwed up.

 

Look at the HTML source and you'll see this:

 

<a "href=http://www.orjinalsarf.com/filter_printer.php?filterid=1>Ink & Toner Finder</a>

It needs to be:

 

<a href="http://www.orjinalsarf.com/filter_printer.php?filterid=1">Ink & Toner Finder</a>

 

Thanks and sorry for any inconvenience caused. I will post an update soon, just very busy and behind schedule with my current project. :)

Share this post


Link to post
Share on other sites

Thanks and sorry for any inconvenience caused. I will post an update soon, just very busy and behind schedule with my current project. :)

Don't misunderstand!

:o

 

I wasn't meaning to "point fingers".

 

I was just offering an explanation for what was happening.

:)


If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×