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 March 10th, 2012, 02:40 AM
robibrk robibrk is offline
 
Join Date: Oct 2009
Posts: 11
Default Brand filter adding only to shop pages

I am looking for a way to integrate brand filter only to shop pages. Even better option is, that only brand names showing up at filter, that are actually included in this category.

Example: I am running a baseball site and there are 20+ popular brands for this niche. But not all of this manufacturers are making all the equipment, some are specialized only for one category - example baseball bats.

Why i want this filter option only on store page?

It is simple, if the filter is present on drip pages and the user clicks on it, there is happening nothing, because the filter can work only on shop pages "?brand" query.

Same is true for price filter (?price=xx), it is logical, but my users will be may wired, that my site is not working.

Hope for solution.

Store ID: 36431
Website URL: REMOVEbuybaseballREMOVEequipments.com (remove the REMOVE words)
URL to page in question: REMOVEbuybaseballREMOVEequipments.com (remove the REMOVE words)


Regards,
Robert

Last edited by robibrk : March 10th, 2012 at 02:42 AM.
  #2  
Old March 10th, 2012, 04:01 AM
robibrk robibrk is offline
 
Join Date: Oct 2009
Posts: 11
Default

I have solved my issue with Widget Context plugin, now i can select manually on what pages want an active filter.

Still looking for this:

Even better option is, that only brand names showing up at filter, that are actually included in this category.

Example: I am running a baseball site and there are 20+ popular brands for this niche. But not all of this manufacturers are making all the equipment, some are specialized only for one category - example baseball bats.
  #3  
Old March 10th, 2012, 09:32 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

Adding this to your Brand Filter widget:
PHP Code:
<ul> 
<?php 
$brands 
dfr_get_brands($category->id); 
foreach (
$brands as $brand) {
    if (
$brand != "") {
    
$brand urlencode($brand); 
    
?> 
    <li><a href="[server.url type='fullpage' query='brand=$brand']"><?php echo urldecode($brand); ?></a></li>
  <?php ?>
<?php 
?> 
</ul>
And adding this to your theme's functions.php file:
PHP Code:
function dfr_get_brands($cat=false) {
    global 
$wpdb;
    if (
$cat) { $cat_query "WHERE cat_id = ".$cat." "; }
    
$brands $wpdb->get_results("SELECT brand FROM ".$wpdb->prefix."dfr_shop_products ".$cat_query."GROUP BY brand");
    
$list = array(); 
    foreach (
$brands as $brands) {
        
$list[] = $brands->brand
    }
    return 
$list

Should give you brand that are only available in that category.

Eric
  #4  
Old March 11th, 2012, 06:43 AM
robibrk robibrk is offline
 
Join Date: Oct 2009
Posts: 11
Default

Thanks for fast replay Eric. I have added the provided code and is working fine.
 


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
'Remove Price filter' like brand filter Giftoly Questions 1 January 20th, 2012 10:48 AM
Sort filter: brand? extrazin Questions 1 December 16th, 2011 08:30 AM
problems with brand filter meinehandtasche Questions 2 November 11th, 2011 09:41 AM
Adding a Sort Filter to your Category Pages. Eric Tips, Tricks & Tutorials 19 September 14th, 2011 08:11 AM
Brand filter? sylviathewitch Problems 3 March 8th, 2011 08:43 AM


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


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