Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Ok, now Im able to delete the double filtervalue, but if I delete one, both disappears. If I continue with this both to add a searchvalue, it appears four times... But finaly the filter works at the frontend :)

 

SEE YA

Denzel.

Link to comment
Share on other sites

  • Replies 70
  • Created
  • Last Reply

Hi @@Tsimi

 

Now I had time for a deeper look into the code. Seems that the values are stored in the database correctly, but the query for display the searches in admin/categories_filters.php is buggy:

  $searches = "select cfs.*, cf.categories_filters_name, cf.categories_filters_id from categories_filters_searches cfs left join categories_filters_values cfv on cfs.categories_filters_values_id = cfv.categories_filters_values_id left join categories_filters cf on cfv.categories_filters_id = cf.categories_filters_id where cfs.language_id = '" . (int)$languages_id . "' order by cfs.categories_filters_searches_id desc";

In my database in categories_filters_searches table, there are only two entrys: One search in two languages. But the categories_filters page shows four results from the above searches query... All the same: for language id 2  :wacko:

 

SEE YA

Denzel.

Link to comment
Share on other sites

Ok, I think Ive got it now... In admin/categories_filters.php in 1053 I have changed the $searches query so it looks like this:

  $searches = "select cfs.*, cf.categories_filters_name, cf.categories_filters_id from categories_filters_searches cfs left join categories_filters_values cfv on (cfs.categories_filters_values_id = cfv.categories_filters_values_id and cfs.language_id = cfv.language_id) left join categories_filters cf on (cfv.categories_filters_id = cf.categories_filters_id and cfs.language_id = cf.language_id) where cfs.language_id = '" . (int)$languages_id . "' order by cfv.values_sort_order";

and above the $values query changed to:

    $values = "select cfv.categories_filters_values_id, cfv.categories_filters_values_name, cf.categories_filters_id, cfv.values_sort_order from categories_filters_values cfv left join categories_filters cf on (cf.categories_filters_id = cfv.categories_filters_id and cfv.language_id = cf.language_id) where cfv.language_id = '" . (int)$languages_id . "' order by cfv.values_sort_order";

Now only the actually chosen admin-language is displayed. For correct editing the different languages I had to change the update query:

          tep_db_query("update categories_filters_searches set products_column = '" . tep_db_input($products_column) . "', categories_filters_searches_type = '" . tep_db_input($search_type) . "', categories_filters_searches_wildcard = '" . tep_db_input($search_wildcard) . "', categories_filters_searches_value = '" . tep_db_input($value_name) . "', categories_filters_searches_and_operator = '" . (int)$and_operator . "' where categories_filters_values_id = '" . (int)$value_id . "' and language_id = '" . (int)$languages[$i]['id'] . "'");

and change the way of displaying them at line 1157:

          $search_value = tep_db_query("select categories_filters_searches_value from categories_filters_searches where categories_filters_values_id = '" . (int)$searches_values['categories_filters_values_id'] . "' and language_id = '" . (int)$languages[$i]['id'] . "'");
          $search_value = tep_db_fetch_array($search_value);
          $inputs .= $languages[$i]['code'] . ': <input type="text" name="value_name[' . $languages[$i]['id'] . ']" size="15" value="' . htmlentities($search_value['categories_filters_searches_value']) . '"> <br />';

Maybe anyone can confirm this, so it can added to the download section. 

 

SEE YA

Denzel.

Link to comment
Share on other sites

  • 2 months later...

Hi all,

 

Thank you @@Tsimi for the add-on and thank you @@Denzel for the corrections. I noticed the same issues and now I don't have the double filtervalues again. I can also delete without having the 1054 error. I think you should upload it.

 

Now I have to figure how to configure this filters...

Link to comment
Share on other sites

Hi again,

 

Is it possible to add other "Products Columns" ? To have filters like colors or size for exemple.

 

In my old shop I had the "product specifications" add-on which created automatically new "products columns" which we completed in the page where we add a product.

Link to comment
Share on other sites

@@aurelou

 

Thanks for your feedback. I will test the changes that Denzel posted and then update the addon.

 

hmmm,..as far I know you can filter by a certain word or attribute that is present inside the database.

If you have installed the sample filters look in the admin area there you see how they are setup.

As you can see for example

 

Audio : Dolby Surround 5.1       pd.products_description       like       both       dolby surround 5.1

 

That means it will look for products that have the word "Dolby Surround 5.1" inside the "products_description" field.

Similar goes for the product name and so on.

You could create a new fields in the database like products_color and products_size and then inside the product registration page add new input fields like Colors: or Size: and then you could add them as filters too. But there is no easy way with this addon. There is/was a commercial solution by gadlol that allowed you to use product attributes as filters which was cool and way easier to setup. Or you stick with Kymations Products Specification addon for now.

 

I think Rudolf is working on a filter solution but I he just started and it might still take a while.

http://www.oscommerce.com/forums/topic/410284-smart-filtering/

Link to comment
Share on other sites

Hello, @@Tsimi

 

Very interesting addon!

But I found one error for categories_filters_searches.

If you do the price $30-$40 ::::: '>=' '30' and '<=' '40', I always get  '>=' '30' end '>=' '30', or  '<='  '40' and '<='  '40'.

Can you fix it?

Thank you!

No outside url's in signatures allowed - thanks

Link to comment
Share on other sites

Can you once try the older addon package.

Click on the history tab and download the first zip package.

Only replace the admin file.

 

I installed the old file categories.filters.php

It works with the old file without error.

No outside url's in signatures allowed - thanks

Link to comment
Share on other sites

@@spidometrs

 

Ok, thanks for testing.

So looks like the old file works but you don't have multilingual support with it. If you don't have a multilingual shop use that for now and meanwhile I will look deeper into it and see what went wrong with the newer version.

Link to comment
Share on other sites

@@spidometrs

 

I had time to take a look at it and I cannot recreate the same problem in my test shop. I added new filters or edited old filters all looks good here.

Not sure what exactly happened at your end but if the old categories_filters.php file works use that.

Link to comment
Share on other sites

Hi @@Tsimi

 

Now I had exactly the same issue as @@spidometrs.

 

It occurred when I wanted to modify the filters in the 3rd step. I managed to set correctly my filters by deleting both the lines concerned by the problem and put them again correctly. If I want to modify it again, the problem will repeat.

Link to comment
Share on other sites

Hello,

 

I implemented @@auzStar 's solution for ajax refresh (see : http://www.oscommerce.com/forums/topic/408337-products-filter-bs/?p=1742963). It's very good, thank you.

 

Now I have two questions :

 

- How can we disable showing filters when there's no product for the value ? For exemple I have filters for colors and I don't need to show every color filter if I have only yellow and green products. I want to show only filters values when products are available for it (or put them in grey when not available).

 

- Also, in mobile version, when we have more than 2 or 3 filters, the text doesn't show well, it superimposes (see image attached).

 

Is there a way to put dropdown selections instead of checkbox ? Which set in line in desktop size and one above the other in mobile size. Or a better solution ?

 

Thank you very much for your help.

post-329508-0-78492000-1476867609_thumb.jpg

Link to comment
Share on other sites

  • 2 months later...

@@Tsimi

 

I created screenshots.

 

Screenshot 1 - as it should be. http://spido.ru/edit_1.png

Screenshot 2 - I edit data. http://spido.ru/edit_2.png

Screenshot 3 -  receives the same data in two fields, after editing one field. http://spido.ru/edit_3.png

Hi @@Tsimi,

 

I have got the same issue with v1.0 with no change.

Is there a known fix for it ?

Osc v2.3.4 BS "custom"
PHP 7.3 compatible (710 modified files => o_O')

Link to comment
Share on other sites

@@milerwan

 

Sorry buddy.

No fix at the moment.

I didn't create that code I just converted that addon to be compatible for BS shops.

If someone is willing to take a look at it and fix it be my guest. I just have no time at the moment to look deeper into it.

And even if I would I probably wouldn't be able to fix it. Query stuff is not my forte.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...