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 April 4th, 2011, 12:18 PM
Nugerama Nugerama is offline
 
Join Date: Mar 2011
Posts: 14
Default Merchants and offers page

Hi Eric, in my original designs that I put together for my client before discovering datafeedr I included a 'Stores and Offers' page. Now I've had a look at the way to deal with coupons via Affiliate Window and there isn't currently any relevant offers so I'd like really just to create a page that lists my merchants and links to categories displaying their products. The important thing though is that I'd ideally like this to update automatically when my client links up with a new merchant.

Is there any function already built in that might help me achieve this?

Many thanks
Kev
  #2  
Old April 4th, 2011, 12:19 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

THREAD MOVED TO 'QUESTIONS' FORUM.
  #3  
Old April 4th, 2011, 12:24 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

Yes, you can create a Custom View (which is its own page), add the code I mentioned here and then set up the links that you need.

This docs page might also be of help: http://www.datafeedr.com/docs/item/173

Eric
  #4  
Old April 4th, 2011, 01:15 PM
Nugerama Nugerama is offline
 
Join Date: Mar 2011
Posts: 14
Default

Hi Eric, I should have more specific in my post - I wish to display the merchants logos, not just a link. Can Datfeedr get a merchant's logo for me?

Thanks
Kev
  #5  
Old April 4th, 2011, 01:23 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

We've provided merchant logos for some of the merchants but not all. But, if a merchant logo is missing, you can add your own to the Merchants Directory on your site (which can be found here: WordPress Admin Area > Tools > Datafeedr > Directories).

Here's more info about that: http://www.datafeedr.com/docs/item/132

[product.merchant_logo] will display the merchant logo in your views.

Eric
  #6  
Old April 14th, 2011, 04:52 PM
Nugerama Nugerama is offline
 
Join Date: Mar 2011
Posts: 14
Default

Hi Eric, thanks again for your help. I've got to grips with the merchant logos folder and have most of the functionality of the site working now.

I wonder though how I can incorporate the merchant logo shortcode into the following statement that you gave me for ooutputting the stores merchants:

<ul>
<?php
$merchants = dfr_get_merchants();
foreach ($merchants as $merchant) {
$merchant = urlencode($merchant);
?>
<li>
<a href="[server.url type='fullpage' query='merchant=$merchant']"><?php echo urldecode($merchant);?></a>
</li>
<?php } ?>
</ul>

Thanks again
Kev
  #7  
Old April 14th, 2011, 07:03 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

The merchant logo shortcode will not work in that loop. You will have to modify the SQL statement in order to get the merchant_id and then you will have to hardcode something like this:

<img src="http://www.yoursite.com/path/to/merchant/logos/<?php echo $merchant->id; ?>.jpg" />

Eric
  #8  
Old April 21st, 2011, 05:16 AM
Nugerama Nugerama is offline
 
Join Date: Mar 2011
Posts: 14
Default

Thanks for that Eric, I'll give it a go. In the mean time however I'm still missing a lot of merchant logos: I've followed the instructions and successfully created a directory in siteurl/wp-content/uploads/logos. I know it's working because it pulled in logos from two of my merchants but there's still a lot missing that do have logos available. Why might this be the case?

Many thanks
Kev
  #9  
Old April 21st, 2011, 06:35 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Did you already add the merchant logos to that directory?
  #10  
Old April 21st, 2011, 07:31 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Here's what worked for me:

In your theme's functions.php file, add this:

PHP Code:
function dfr_get_merchants() {
    global 
$wpdb;
    
$merchants $wpdb->get_results("SELECT merchant_id, merchant FROM ".$wpdb->prefix."dfr_shop_products GROUP BY merchant_id");
    
$list = array();
    foreach (
$merchants as $merchants) {
        
$list[$merchants->merchant_id] = $merchants->merchant;
    }
    return 
$list;

In a Text Module in a view where you want the logos to appear, add this:

PHP Code:
<?php
$merchants 
dfr_get_merchants();
foreach (
$merchants as $mid => $name) {
?>
  <a href="[server.url type='fullpage' query='merchant=$name']">
    <img src="http://YOURSITE/path/to/logos/<?php echo $mid?>.jpg" alt="<?php echo $name?>" />
  </a>
<?php
}
?>
Make sure you change the img src to the path where your logos can be found.

The only thing that is missing is that that loop above will not download your logos for you. You must add the logos manually to your logos directory.

Merchant logos are automatically downloaded and added to your store when a merchant logo is displayed within the [product.each]...[product.end] loop. If you display your merchant logos on your Category Pages or Product Details pages, then you won't have to manually add the logos to your logo directories.

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


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


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