Datafeedr Support Forums  

Go Back   Datafeedr Support Forums > Current Version (V3) Forum > Problems
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
  #1  
Old November 25th, 2012, 11:23 AM
johngibb123 johngibb123 is offline
 
Join Date: Aug 2012
Posts: 329
Default brand filter not working..

HI,

could u pls tell me why brand filter not getting for this..?


as far as I know i done evrything correct..

store id: 40399

what went wrong..?
  #2  
Old November 25th, 2012, 11:46 AM
johngibb123 johngibb123 is offline
 
Join Date: Aug 2012
Posts: 329
Default

I just copy pasted my code.... whatelse I missed...

Quote:
function dfr_get_brands_list($category) {
global $wpdb;
$cat_query = "";
if ($category) {
$in = array();
$in[] = $category->id;
if (!empty($category->children)) {
foreach ($category->children as $child => $id) {
$in[] = $id;
}
}
$category_ids = implode(",", $in);
$cat_query = "WHERE p2c.cat_id IN (".$category_ids.") ";
}
$brands = $wpdb->get_results("
SELECT brand, p2c.cat_id
FROM ".$wpdb->prefix."dfr_shop_products AS p
INNER JOIN ".$wpdb->prefix."dfr_shop_p2c AS p2c ON p.id = p2c.id
$cat_query
GROUP BY brand
");
$list = array();
foreach ($brands as $brands) {
$brand = trim($brands->brand);
if ($brand != "") {
$list[] = $brand;
}
}
return $list;
}

Quote:
<form method="get">

<?php if (@$_GET['price']){ echo '<input type="hidden" name="price" value="'.strip_tags($_GET['price']).'" />'; } ; ?>


<select id="brand" name="brand" onchange="gotoPage()">

<?php
$brands = dfr_get_brands_list($category);
foreach ($brands as $brand) : ?>

<option value="<?php echo $brand; ?>" ><?php echo $brand; ?></option>

<?php endforeach; ?>

</select>

</form>
Quote:

<script>

function gotoPage(){
var url = "<?php echo $_SERVER['PATH_INFO']; ?>";
var sel = document.getElementById("brand");
var brand = sel.options[sel.selectedIndex].text;
window.location.href = url + "?brand=" + brand;
}

</script>
  #3  
Old November 25th, 2012, 12:48 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

You've mixed up the code for an HTML list with the code for a <select> drop down menu: http://www.datafeedr.com/forums/showthread.php?t=6778
  #4  
Old November 25th, 2012, 02:26 PM
johngibb123 johngibb123 is offline
 
Join Date: Aug 2012
Posts: 329
Default

Quote:
Originally Posted by Eric View Post
You've mixed up the code for an HTML list with the code for a <select> drop down menu: http://www.datafeedr.com/forums/showthread.php?t=6778
BUT the above same code I used for my another site: (its working)
LaptopsIsland.com store id: 40155

Not understanding why the same above code not working for this new site....
  #5  
Old November 25th, 2012, 05:29 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi,

I don't know what you have on your other site however you are using the dfr_get_brands_list function for the <select> menu. You should be using the dfr_get_brands instead.

Eric
 


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
Brand Filter - old brands still in the filter rickagter Questions 2 September 20th, 2012 09:43 AM
Brand Filter not working correctly sdc247 Problems 6 February 14th, 2012 09:46 PM
'Remove Price filter' like brand filter Giftoly Questions 1 January 20th, 2012 10:48 AM
brand filter stop working primitip Questions 7 August 9th, 2011 11:18 AM
Brand filter? sylviathewitch Problems 3 March 8th, 2011 08:43 AM


All times are GMT -5. The time now is 03:34 PM.


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