Datafeedr Support Forums  

Go Back   Datafeedr Support Forums > Current Version (V3) Forum > Questions
Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Important - The support forums are now in "read-only" mode as we transition to an alternative help desk solution. Feel free to contact us here with any of your questions or search the forums for an existing solution.
 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old August 18th, 2014, 10:24 AM
alankarsale alankarsale is offline
 
Join Date: Jul 2014
Posts: 20
Default Search Code not working

Hello,

My search form is not working properly. It will do products but my merchants are coming up with any products. Can you help?

Code:
<?php
function dfr_get_merchants() {
    global $wpdb;
    $merchants = $wpdb->get_results("SELECT merchant, merchant_id FROM ".$wpdb->prefix."dfr_shop_products GROUP BY merchant");
    $html = '<option value="">Select all Merchants</option>';
    foreach ($merchants as $k => $v) {
        if (trim($v->merchant) != "") {
            $selected = (strip_tags($_GET['merchant_id'])==$v->merchant_id) ? ' selected="selected"' : '';
            $html .= '<option value="'.$v->merchant_id.'"'.$selected.'>'.$v->merchant.'</option>';
        }
    }
    return $html;
}
?>

[search.form]
<div class="store_search_form">
  <p class="keyword">
    <label for="word">Keyword</label> [search.word]
  </p>
  <p class="merchant">
    <label for="word">Merchant</label>
    <select name="merchant_id">
      <?php echo dfr_get_merchants(); ?>
    </select>
  </p>
  <p class="category">
    <label for="category">Category</label> 
    <select name="c">
      <option value=""> Select all categories </option>
      [category.list before='' after='']
        <option value="[category.id]"><?php echo str_repeat ('-', (($depth-1)*2) ); ?> &nbsp; [category.name]</option>
        [category.repeat]
      [/category.list]
    </select>
  </p>
  <p class="price">
   <label for="price">Price</label> [search.selectprice options='any, Below $10(-5), $10 - $20, $20 - $30, $30 - $40, more than 40 (40+)']
  </p>
  <p class="button">[search.submit title='Find it!']</p>
</div>
[/search.form]
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Short Code not Working rj3494 Problems 5 May 17th, 2012 09:27 PM
Search box code ccgmark Tips, Tricks & Tutorials 10 May 13th, 2011 02:15 PM
Search form not working fashion Problems 7 May 12th, 2011 02:00 PM


All times are GMT -5. The time now is 01:08 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.