Datafeedr Support Forums  

Go Back   Datafeedr Support Forums > Current Version (V3) Forum > Tips, Tricks & Tutorials
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 April 26th, 2012, 09:11 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default Add a list of merchant logos to your sidebar

Here's how to add a list of logos to your sidebar like this:



1. Add the following function to your theme's functions.php file:
PHP Code:
function dfr_get_merchant_logos() {
    global 
$wpdb;
    
$merchants $wpdb->get_results("SELECT merchant, merchant_id FROM ".$wpdb->prefix."dfr_shop_products WHERE state = 1 GROUP BY merchant");
    
$html '';
    foreach (
$merchants as $k => $v) {
        if (
trim($v->merchant) != "") {
            
$logo_url dfr_view::merchant_logo_url($v->merchant_id);
            
$html .= '<a href="?merchant_id='.$v->merchant_id.'">';
            
$html .= '<img src="'.$logo_url.'" alt="'.$v->merchant.'" width="150" height="40" />';
            
$html .= '</a>';
        }
    }
    return 
$html;

2. Save your changes.

3. Go here: The Factory > Your Store > VIEWS > WIDGETS > Add a new view

4. Name the new view "Merchant Logos".

5. Add a Text module to the new "Merchant Logos" view.

6. Add the following code to the Text module:
Code:
<?php echo dfr_get_merchant_logos(); ?>
7. Save the Text module.

8. Go here: WordPress Admin Area > Tools > Datafeedr

9. Click the [Update Settings Only] button.

10. Go here: WordPress Admin Area > Appearance > Widgets

11. Add a Datafeedr widget to your sidebar and choose "Merchant Logos" from the drop down list.

If you have missing logos, you will either need to add them yourself or request that they be added in this forum: http://www.datafeedr.com/forums/forumdisplay.php?f=13

Eric
  #2  
Old April 27th, 2012, 01:42 AM
1800HART 1800HART is offline
 
Join Date: Apr 2008
Posts: 487
Default

this is extremely cool and I will come with a massive list of merchant_id logo numbers! But, how can the logos be centered in the sidebar?

/// added /////

Oh nevermind! should've looked at the code
$html .= '<img src="'.$logo_url.'" alt="'.$v->merchant.'" width="150" height="40" />'

\\\ added again \\\

Eric ... when the logos appear in the sidebar, whether front page or product detail page ... how can you fix the link to the merchant? With the above code, if you click any of the logos it goes to [current.url]/?merchant_id link...
e.g.
http://hartmarket.com/?merchant_id=1292
http://hartmarket.com/store/recommen...rchant_id=1292
etc
__________________
| Shop @ HART Markets | Twitter |

Last edited by 1800HART : April 27th, 2012 at 01:51 AM.
  #3  
Old April 27th, 2012, 02:07 AM
1800HART 1800HART is offline
 
Join Date: Apr 2008
Posts: 487
Default

Quote:
Originally Posted by 1800HART View Post
this is extremely cool and I will come with a massive list of merchant_id logo numbers! But, how can the logos be centered in the sidebar?

/// added /////

Oh nevermind! should've looked at the code
$html .= '<img src="'.$logo_url.'" alt="'.$v->merchant.'" width="150" height="40" />'

\\\ added again \\\

Eric ... when the logos appear in the sidebar, whether front page or product detail page ... how can you fix the link to the merchant? With the above code, if you click any of the logos it goes to [current.url]/?merchant_id link...
e.g.
http://hartmarket.com/?merchant_id=1292
http://hartmarket.com/store/recommen...rchant_id=1292
etc
/// while we're at it... ///

Is there a way to list them continuously on the same line that wraps to the next line if runs out of room? EG my sidebar is 300px side, and could fit two 180px logos side by side, or I could place a widget just above the footer below content in a 660px wide content side by side ... I have a few stores with many vendors and linking them down the sidebar takes up too much space
__________________
| Shop @ HART Markets | Twitter |
  #4  
Old April 27th, 2012, 02:26 AM
1800HART 1800HART is offline
 
Join Date: Apr 2008
Posts: 487
Default

[off-topic - i don't know why I can't edit previous comments of mine, and must either Reply or Quote Reply only]

//
Above - when I mentioned it would be nice to click the logos in the sidebar and go to a proper URL .. I meant perhaps, directly to the affiliate store with our affiliate code intact as per settings of that store?
__________________
| Shop @ HART Markets | Twitter |
  #5  
Old April 27th, 2012, 08:56 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi
Quote:
Originally Posted by 1800HART View Post
Is there a way to list them continuously on the same line that wraps to the next line if runs out of room?
They will show on the same line if there is room but having a 300px wide sidebar won't work if it has any padding at all. By default, they will all appear on the same line given the room to do so.

Quote:
Originally Posted by 1800HART View Post
Above - when I mentioned it would be nice to click the logos in the sidebar and go to a proper URL .. I meant perhaps, directly to the affiliate store with our affiliate code intact as per settings of that store?
We don't have that URL so it's not possible, not without writing your own custom function and inserting links to the merchant's site yourself.

Eric
  #6  
Old September 1st, 2012, 01:41 AM
SurveillanceTips SurveillanceTips is offline
 
Join Date: Aug 2012
Posts: 2
Default

Just a quick question. I've been maulling over this code, but I want to know, after listing the products, is there a link on the logo images? where does the link go? extract products of that merchants and display it or what?
  #7  
Old September 1st, 2012, 03:16 AM
1800HART 1800HART is offline
 
Join Date: Apr 2008
Posts: 487
Default

Well now .. that is interesting ..

what USED To happen was that if you clicked on the logo in the sidebar all the products from that merchant would appear in the center column for me.

Now - since the upgrade to version 3.9 --- i just noticed (D'oh!) that all my merchant logo widgets were REPLACED by an empty Tag Cloud widget in all my sidebars.

>> Eric? did something change in the new version? I won't be able to look closer at this until mid week next week //
__________________
| Shop @ HART Markets | Twitter |
  #8  
Old September 1st, 2012, 08:34 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Quote:
Originally Posted by SurveillanceTips View Post
Just a quick question. I've been maulling over this code, but I want to know, after listing the products, is there a link on the logo images? where does the link go? extract products of that merchants and display it or what?
There is no link because we have no link to go to just the merchant's homepage.

Quote:
Originally Posted by 1800HART View Post
Well now .. that is interesting ..

what USED To happen was that if you clicked on the logo in the sidebar all the products from that merchant would appear in the center column for me.

Now - since the upgrade to version 3.9 --- i just noticed (D'oh!) that all my merchant logo widgets were REPLACED by an empty Tag Cloud widget in all my sidebars.

>> Eric? did something change in the new version? I won't be able to look closer at this until mid week next week //
Nothing changed as far as this is concerned.
  #9  
Old November 14th, 2013, 04:09 PM
redfoxdeals redfoxdeals is offline
 
Join Date: Oct 2013
Posts: 13
Default

Store ID: 43393
Website URL: redfoxdeal.com
URL to page in question: http://www.redfoxdeals.com/?q=store/cat/merchants/

Hi! Thanks for this, I have now added a list of Logos to my sidebar, as well as to my "merchants" page, as listed above however, there are a couple things I have not figured out:

1. It appears that there are a limited number of advertisers showing up, although I know you set up all of the logos for me a few weeks ago

2. I would like the list on the merchant page to be a lot neater, more like nice tidy columns rathar than all smooshed together, is this possible?

3. When I click on any of these logos, they all go back to my home page. I can I have them go to a page of products / coupons for that merchant?

4. How do I set up a list of just coupon merchant logos, or just x logos, rather than all of the merchants in my store?

Thanks for looking in to this for me!
  #10  
Old November 14th, 2013, 04:17 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi,

1. There are a total of 11 merchants with products in your store. Two of them appear twice because one is for products and one is for coupons. Therefore only 9 logos will appear on your site. And I see 9 logos on your site.

2. They seem tidy in your sidebar:



If you need further styling, you'll need to apply CSS styling to them.

3. You need to set your Permalink settings to something other than "Default" here: WordPress Admin Area > Settings > Permalinks. I suggest "postname".

4. Just coupon logos is not possible. However if you want to limit the number of logos that appear, change the code from this:

PHP Code:
    $merchants $wpdb->get_results("SELECT merchant, merchant_id FROM ".$wpdb->prefix."dfr_shop_products WHERE state = 1 GROUP BY merchant"); 
To this:

PHP Code:
    $merchants $wpdb->get_results("SELECT merchant, merchant_id FROM ".$wpdb->prefix."dfr_shop_products WHERE state = 1 GROUP BY merchant LIMIT 5"); 
Eric
  #11  
Old November 14th, 2013, 04:27 PM
redfoxdeals redfoxdeals is offline
 
Join Date: Oct 2013
Posts: 13
Default

Thank you,
I am still having issues, though

1. That makes sense why there are that many logos. thanks
2. They do look good in the side bar, but when I have them listed just on the merchant page in the body part of the page, they are not quite so pretty. Some gaps in between them would be nice.

Thank you,
I am still having issues, though

1. That makes sense why there are that many logos. thanks
2. They do look good in the side bar, but when I have them listed just on the merchant page in the body part of the page, they are not quite so pretty. Some gaps in between them would be nice.
3. My permalinks are already set to "postname"
4. Perfect, thanks!
  #12  
Old November 14th, 2013, 04:36 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi,

You're right, you permalinks are set up right. You just need to go to the right URL (ie. no query string).

Here's an example of your links working properly:
http://www.redfoxdeals.com/store/cat...chant_id=40892

Regarding a gap, you could try changing this:
PHP Code:
            $html .= '<img src="'.$logo_url.'" alt="'.$v->merchant.'" width="150" height="40" />'
To this:
PHP Code:
            $html .= '<img src="'.$logo_url.'" alt="'.$v->merchant.'" width="150" height="40" style="display:block;margin:10px;" />'
Eric
  #13  
Old November 18th, 2013, 06:33 PM
redfoxdeals redfoxdeals is offline
 
Join Date: Oct 2013
Posts: 13
Default

OK, almost all fixed. I see that your link for the merchant logo worked and brought me to the merchant page, but I am not sure how to get that url set up so that it works for me? Where are the urls being created?
Thanks!
  #14  
Old November 18th, 2013, 08:40 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi,

I got the URL by clicking the merchant's logo in the sidebar.

Eric
  #15  
Old November 19th, 2013, 02:29 PM
redfoxdeals redfoxdeals is offline
 
Join Date: Oct 2013
Posts: 13
Default

I'm still a touch confused, when I click on a merchant logo on my sidebar it goes to this URL
http://www.redfoxdeals.com/?merchant_id=37220
Which does nothing.
Is it actually working properly for you when you click on a logo?
Thanks
  #16  
Old November 19th, 2013, 03:27 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi,

That URL is a filter for your Store's Front Page. However, you don't have a Product list module in your Front Page view therefore no products will appear there.

If you want to have a filter for your Store's Front Page, add a Product List module to the store's front page and set it to "Allow override".

Eric
  #17  
Old September 17th, 2014, 07:30 AM
benjaffer benjaffer is offline
 
Join Date: Feb 2014
Posts: 118
Default

With that code above, suppose I want to use a slider instead of a sidebar widget. Is it possible?
  #18  
Old September 17th, 2014, 08:33 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Quote:
Originally Posted by benjaffer View Post
With that code above, suppose I want to use a slider instead of a sidebar widget. Is it possible?
It's probably possible but you'll have to code that yourself. It's beyond the level of support we're able to provide.

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
List Merchant Logos bravecreative Questions 19 June 28th, 2011 08:47 AM
no merchant logos marcaustin Problems 13 March 7th, 2011 03:23 PM


All times are GMT -5. The time now is 03:06 AM.


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