Results 1 to 10 of 809

Hybrid View

  1. #1
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,845
    Plugin Contributions
    25

    Default Re: Help with Dynamic filter 1.1

    Quote Originally Posted by Kevin205 View Post
    Thank you for confirming that.

    I think the error is getting from the following file at around line 54, I am trying to make sense out of it.
    Basically what happens is that the single and double are entered in to the query, and thus causing errors. We need to figure a way to tell the script to add an escape to certain characters before adding them to the query.
    It shouldn't be that difficult, but my skills are still limited, and am learning on the way :)

  2. #2
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: Help with Dynamic filter 1.1

    Quote Originally Posted by Design75 View Post
    but my skills are still limited, and am learning on the way :)
    Same here.

    I tried escaping the " and or '. No luck.

    The only thing that does not produce an error, is the following format:
    1& #39;-2& #34; x 1& #39;-2& #34;
    But try to tell a shop owner to look at the following and do your additions, deletions, edits and audits and etc.

    5&# 39;-7& #34; x 3& #39;-11& #34;
    1& #39;-2& #34; x 1& #39;-2& #34;
    12& #39;-4& #34; x 6& #39;-6& #34;
    1&# 39;-2& #34; x 1& #39;-2& #34;
    2&# 39;-9& #34; x 5& #39;-3& #34;
    .
    .
    .
    How is that for head spin?

    I am trying to figure out a way also.

    Thanks.




    ps. Spaces between & and # are left out, so it displays here.
    Last edited by Kevin205; 26 May 2013 at 05:25 PM.
    Using Zen Cart 1.5.1

  3. #3
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,845
    Plugin Contributions
    25

    Default Re: Help with Dynamic filter 1.1

    Quote Originally Posted by Kevin205 View Post
    Same here.

    I tried escaping the " and or '. No luck.

    The only thing that does not produce an error, is the following format:


    But try to tell a shop owner to look at the following and do your additions, deletions, edits and audits and etc.


    How is that for head spin?

    I am trying to figure out a way also.

    Thanks.




    ps. Spaces between & and # are left out, so it displays here.
    Here's a quick solution,

    find in includes/modules/YUOR_TEMPLATE/dynamic_filter.php

    PHP Code:
              $having .= ' FIND_IN_SET("' $key $value '", GROUP_CONCAT(CONCAT(REPLACE(po.products_options_name, " ", ""), pov.products_options_values_name)))'
    replace with:
    PHP Code:
              $value preg_replace('/"/','\\"',$value);
              
    $value preg_replace('/&acute/','\\&acute',$value);
              
    $having .= ' FIND_IN_SET("' $key $value '", GROUP_CONCAT(CONCAT(REPLACE(po.products_options_name, " ", ""), pov.products_options_values_name)))'
    more values can be added if needed

  4. #4
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: Help with Dynamic filter 1.1

    I will test your solution in my environment.

    And this is what I came up with. It seems to be working for all attributes.
    before
    PHP Code:
              }
              
    $having .= ' FIND_IN_SET("' $key $value '", GROUP_CONCAT(CONCAT(REPLACE(po.products_options_name, " ", ""), pov.products_options_values_name)))';
              
    $filter_attr true;
              
    $prvHaving $key;
            }
          }
        }
      }
      if(
    $filter != ''$filter .= ')'
    After
    PHP Code:
              }
    $var1 addslashes($value);
              
    $having .= ' FIND_IN_SET("' $key $var1 '", GROUP_CONCAT(CONCAT(REPLACE(po.products_options_name, " ", ""), pov.products_options_values_name)))';
              
    $filter_attr true;
              
    $prvHaving $key;
            }
          }
        }
      }
      if(
    $filter != ''$filter .= ')'
    What do you think?

    I don't know whether it will have issues later on!
    Using Zen Cart 1.5.1

  5. #5
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,845
    Plugin Contributions
    25

    Default Re: Help with Dynamic filter 1.1

    Very nice !

    but it can be written as:

    PHP Code:
              $having .= ' FIND_IN_SET("' $key addslashes($value) . '", GROUP_CONCAT(CONCAT(REPLACE(po.products_options_name, " ", ""), pov.products_options_values_name)))'

  6. #6
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: Help with Dynamic filter 1.1

    Which one would you use, yours solution or mine?

    I really appreciate your help on this.
    Using Zen Cart 1.5.1

  7. #7
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,845
    Plugin Contributions
    25

    Default Re: Help with Dynamic filter 1.1

    Quote Originally Posted by Kevin205 View Post
    Which one would you use, yours solution or mine?

    I really appreciate your help on this.
    Yours, with my improvement (see previous post)

  8. #8
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,303
    Plugin Contributions
    1

    Default Re: Help with Dynamic filter 1.1

    Quote Originally Posted by Design75 View Post
    Very nice !

    but it can be written as:

    PHP Code:
              $having .= ' FIND_IN_SET("' $key addslashes($value) . '", GROUP_CONCAT(CONCAT(REPLACE(po.products_options_name, " ", ""), pov.products_options_values_name)))'
    Do you think you could explain how this works, which special characters does it escape? Looks like it might be just ["]. If so how would I amend the code to escape other characters? (I have html code in products_options_values_name so there may be more characters to address)

    I'm also having trouble getting products to display when characters such as comma and decimal point are in products_options_values_name (no html code in these)

    How would I amend the code to convert, I guess

    , to & #44;
    . to & #46;
    (spaces added after &)

    Thanks
    Last edited by simon1066; 1 Sep 2013 at 11:29 AM. Reason: space added to html spec. char.

  9. #9
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,303
    Plugin Contributions
    1

    Default Re: Help with Dynamic filter 1.1

    Whilst looking at this further it seems that although there was definitely an issue with using a comma, the no show of some products may be related to the number of characters in products_options_values_name.

    It all seems a bit odd, so I'm off to check that file merging was done properly

 

 

Similar Threads

  1. Hebrew Support - latest release [Support Thread]
    By eranariel in forum Addon Language Packs
    Replies: 22
    Last Post: 26 Jan 2026, 06:47 AM
  2. Empty Dynamic Filter
    By LadyoftheCave in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 6 Jun 2016, 12:47 PM
  3. v150 Dynamic filter
    By Dinoleix in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 13 Aug 2013, 10:23 AM
  4. v150 Dynamic filter - All pages
    By Okkwebmedia in forum Addon Sideboxes
    Replies: 0
    Last Post: 8 Jul 2013, 08:52 AM
  5. v138a Dynamic Filter
    By SoftCorpse in forum All Other Contributions/Addons
    Replies: 9
    Last Post: 18 Jun 2012, 01:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg