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
  #1  
Old October 3rd, 2012, 05:57 AM
johngibb123 johngibb123 is offline
 
Join Date: Aug 2012
Posts: 329
Default Brand filter widgets not displaying in some parent categories

Hi,

Why its not displaying Brand filters here:


and why is it displaying only here:

I didnt uderstood its behavior..
  #2  
Old October 3rd, 2012, 08:13 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

Try using this instead in your functions.php file:
PHP Code:
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;

And this in your view in the Factory:
HTML Code:
<ul>
<?php 
$brands = dfr_get_brands_list($category);
foreach ($brands as $brand) : ?>
  <li><a href="[server.url type='fullpage' query='brand=$brand']"><?php echo $brand; ?></a></li>
<?php endforeach; ?>
</ul>
Eric
  #3  
Old October 3rd, 2012, 09:16 AM
johngibb123 johngibb123 is offline
 
Join Date: Aug 2012
Posts: 329
Default

Its displaying all Brands now incase of parent categories... It means if anyone clicks on any brand, it displays even unrelated items as well!

how to display only those brandfilters in parent categories that are used by sub-categories..?

Last edited by johngibb123 : October 3rd, 2012 at 09:18 AM.
  #4  
Old October 3rd, 2012, 09:52 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi,

It seems to be working for me. Can you give me an example of what is not working?

Eric
  #5  
Old October 3rd, 2012, 10:11 AM
johngibb123 johngibb123 is offline
 
Join Date: Aug 2012
Posts: 329
Default

Quote:
Originally Posted by Eric View Post
Hi,

It seems to be working for me. Can you give me an example of what is not working?

Eric

Its working fine,, i didnt seen it clealry due to many brands..

thanks!
  #6  
Old August 7th, 2013, 10:55 PM
tcsar757 tcsar757 is offline
 
Join Date: Dec 2010
Posts: 47
Default

Is there a way to make this specific way of showing brands work in a drop down menu?
  #7  
Old August 8th, 2013, 07:27 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi,

I'm sorry, I don't understand what you mean.

Eric
  #8  
Old August 8th, 2013, 08:55 PM
tcsar757 tcsar757 is offline
 
Join Date: Dec 2010
Posts: 47
Default

The code above works good for me but it is a long html list, Can it made to be a dropdown list?
  #9  
Old August 8th, 2013, 10:41 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

You could try this in your view in the Factory:

HTML Code:
<select name="brand">
<?php 
$brands = dfr_get_brands_list($category);
foreach ($brands as $brand) : ?>
  <option value="<?php echo $brand; ?>"><?php echo $brand; ?></option>
<?php endforeach; ?>
</select>
  #10  
Old August 8th, 2013, 11:11 PM
tcsar757 tcsar757 is offline
 
Join Date: Dec 2010
Posts: 47
Default

That shows the dropdown menu good but there is no go button.
  #11  
Old August 8th, 2013, 11:33 PM
tcsar757 tcsar757 is offline
 
Join Date: Dec 2010
Posts: 47
Default

Nevermind i read another post on this and figured it out. Thank You so Much...Again You guys are awesome
  #12  
Old January 8th, 2014, 05:21 PM
lukasbrisman lukasbrisman is offline
 
Join Date: Dec 2013
Posts: 19
Default

Can you give me the code to make the merchant list "content aware" as well?
  #13  
Old January 8th, 2014, 06:37 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 mean.

Eric
  #14  
Old January 9th, 2014, 01:42 AM
lukasbrisman lukasbrisman is offline
 
Join Date: Dec 2013
Posts: 19
Default

Ah sorry, my bad

The code above works great to make a filter dropdown for brands and only show the brands in a list depending on which products that are showing in the active category. Would be great if i could get the merchant-list for my category page filters to act/work in the same way and only display the merchants for the products from the active category.

Sorry about my quick line yesterday, was pretty tired :P
  #15  
Old January 9th, 2014, 09:09 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi,

I see what you mean. I've documented that here:
http://www.datafeedr.com/forums/show...6179#post36179

Eric
  #16  
Old April 8th, 2014, 04:40 PM
bombpetite bombpetite is offline
 
Join Date: Jan 2014
Posts: 53
Default

Hi Eric,

I used this code to create the Brands drop down..

http://bptestdev.com/shop (login to the site using pwd: temppassword)

As you can see it doesn't work when you display all clothing.

Also, it half-works when you click on a specific category - ie. it shows the 'active' brands for that category but it can't get it to actually filter when you select / click on a brand in the drop down.

Can you please help?

Many Thanks

Eugene
  #17  
Old April 8th, 2014, 05:11 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi Eugene,

This filter can only display brands that are in the current category. If you are not in a category or a category has sub-categories, you will have unexpected results.

Since this is a brand new site and if this functionality is a must, I might suggest our new product which imports into WooCommerce. Then your brand filters will work more like you expect: http://www.datafeedr.com/wc

Eric
  #18  
Old April 9th, 2014, 05:42 AM
bombpetite bombpetite is offline
 
Join Date: Jan 2014
Posts: 53
Default

Hi Eric,

Quote:
Since this is a brand new site and if this functionality is a must, I might suggest our new product which imports into WooCommerce. Then your brand filters will work more like you expect: http://www.datafeedr.com/wc
This looks great and something we'll definitely try in the future. However we just completed the shop and this looks like a lot of work. So for now we are looking for a quick solution to filtering.

Quote:
This filter can only display brands that are in the current category. If you are not in a category or a category has sub-categories, you will have unexpected results.
Is there a way to fix this without WooComm plugin? We would be very grateful for your help!

Many Thanks,

Eugene
  #19  
Old April 9th, 2014, 07:18 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi Eugene,

Currently there is no fix for this.

Eric
  #20  
Old May 6th, 2014, 10:16 AM
affiliater affiliater is offline
 
Join Date: Jan 2013
Posts: 72
Default

Hi
Is there a way to reset the filter option?

And i'd like to only show the merchants for the current category(i figured out how to do that with brands via another thread)

Thanks!
 


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
Custom Widgets not Displaying arizonius Problems 2 June 20th, 2012 06:03 PM
Merchant and Brand filter Widgets Nugerama Tips, Tricks & Tutorials 13 March 7th, 2012 05:01 PM
Parent categories expand to show sub categories? gorman101 Problems 1 February 27th, 2012 08:24 PM
'Remove Price filter' like brand filter Giftoly Questions 1 January 20th, 2012 10:48 AM


All times are GMT -5. The time now is 09:11 AM.


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