Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Community Contributed Add-Ons / All Other Contributions/Addons / Modifying the "advanced_search_resu;t" page gives me weird results

Modifying the "advanced_search_resu;t" page gives me weird results

Started by retched on 29 Jun 2014, 2:27 AM · Views: 1,139

Results 1 to 2 of 2
29 Jun 2014, 2:27 AM
#1
retched avatar

retched

Totally Zenned

Join Date:
Jun 2007
Location:
Bronx, New York, United States
Posts:
949
Plugin Contributions:
3

Post #1 by retched

I'm not sure how I can go about fixing this problem. I modified my advanced_search_result header.php file to accomodate for a product type and searches against the data table where the information is. Here is the new modified form.

After much and some scrambling, I managed to modify my advanced_search_results/header.php file so that is now searches the database and does a proper LEFT JOIN of the tables in question. I now get a proper set of results.

However, what I noticed is that if you click on any of the navigation helpers (either the next button or page numbers) instead of returning this limited section of results, ZenCart returns the entire dump of the products table:

Here's something else I noticed, here is the address bar of the first page of results:

http://www.localhost.com/zencart/index.php?main_page=advanced_search_result&keyword=&search_in_description=1&categories_id=&inc_subcat=1&manufacturers_id=&pfrom=&pto=&dfrom=mm%2Fdd%2Fyyyy&dto=mm%2Fdd%2Fyyyy&ufs_card_type_is=yes&ufs_card_type=&ufs_card_rarity_is=yes&ufs_card_rarity=&ufs_resources_is=all&ufs_resources%5B%5D=evil&ufs_resources%5B%5D=order&ufs_comp_direction=eq&ufs_difficulty=&ufs_keyword_exact=any&ufs_block_mod=&ufs_block_level=&ufs_atk_speed=&ufs_atk_level=&ufs_atk_dmg=&x=43&y=22

Now here's the page in the address bar when I try to go to the next page:
http://www.localhost.com/zencart/index.php?main_page=advanced_search_result&search_in_description=1&inc_subcat=1&dfrom=mm%2Fdd%2Fyyyy&dto=mm%2Fdd%2Fyyyy&ufs_card_type_is=yes&ufs_card_rarity_is=yes&ufs_resources_is=all&ufs_comp_direction=eq&ufs_keyword_exact=any&sort=20a&page=2

So I'm thinking the problem is, where's the rest of my search? Could it be because I included two sets of [] of array builders in the get request that ZenCart sanitized the URL and disabled them? (I used the ufs_resources[] method to build an array of checked of indexes. If anyone else has an idea about how to about this, I'm all ears.)

Can anyone figure out how do I go about fixing this?

30 Jul 2014, 11:51 PM
#2
retched avatar

retched

Totally Zenned

Join Date:
Jun 2007
Location:
Bronx, New York, United States
Posts:
949
Plugin Contributions:
3

Post #2 by retched

retched:

Here's something else I noticed, here is the address bar of the first page of results:

http://www.localhost.com/zencart/index.php?main_page=advanced_search_result&keyword=&search_in_description=1&categories_id=&inc_subcat=1&manufacturers_id=&pfrom=&pto=&dfrom=mm%2Fdd%2Fyyyy&dto=mm%2Fdd%2Fyyyy&ufs_card_type_is=yes&ufs_card_type=&ufs_card_rarity_is=yes&ufs_card_rarity=&ufs_resources_is=all&ufs_resources%5B%5D=evil&ufs_resources%5B%5D=order&ufs_comp_direction=eq&ufs_difficulty=&ufs_keyword_exact=any&ufs_block_mod=&ufs_block_level=&ufs_atk_speed=&ufs_atk_level=&ufs_atk_dmg=&x=43&y=22

Now here's the page in the address bar when I try to go to the next page:
http://www.localhost.com/zencart/index.php?main_page=advanced_search_result&search_in_description=1&inc_subcat=1&dfrom=mm%2Fdd%2Fyyyy&dto=mm%2Fdd%2Fyyyy&ufs_card_type_is=yes&ufs_card_rarity_is=yes&ufs_resources_is=all&ufs_comp_direction=eq&ufs_keyword_exact=any&sort=20a&page=2

Evidently this "problem" was fixed in ZenCart 1.5.3. zen_get_all_get_params will now retrieve the arrays that were being built in the first place. My main problem, I've since come up with a work around making bitfields to "correct" this situation. Now I need to get rid of those [] in the value. So far I tried to add the field with and without the [] at the end of it but they still are output to the screen. Any one with any suggestions on how I should get rid of them? Granted they don't mess with the code since it ignores it but I'd at least like them gone.