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 September 6th, 2012, 04:07 AM
dvbmedia dvbmedia is offline
 
Join Date: Jan 2012
Posts: 23
Default Adding datafeedr products to related articles on the site

Dear Datafeedr team,

We've got a similar question as senior member; jmorris, asked in 2008.
http://www.datafeedr.com/forums/show...light=articles

We got on the website tuinkriebels.nl several gardening articles where we want to add related products from to store at the article template, is this possible with an php string? if so, how?

Dear regards,
DVB MEDIA
  #2  
Old September 6th, 2012, 07:55 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

Yes, this is possible.

1. Create a new Custom View (ex. ForArticles)
2. Add a product list module to the view (along with the template code)
3. Create a Custom Field for your posts. Name it "keywords".
4. When you write a new article, give it keywords that you want to pull pull products with. For example: roses+tulips
5. Add a shortcode to your template like so:
PHP Code:
<?php 
$keywords 
get_post_meta(get_the_ID(), 'keywords'true);
if (
$keywords != '') {
    echo 
datafeedr_tag('ForArticles?word='.$keywords);
}
?>
That should do it.

Eric
  #3  
Old September 10th, 2012, 07:36 AM
dvbmedia dvbmedia is offline
 
Join Date: Jan 2012
Posts: 23
Default

Hey Eric,
Thanks alot! i got it working
  #4  
Old May 29th, 2014, 01:05 AM
bradleyhebdon bradleyhebdon is offline
 
Join Date: Mar 2014
Posts: 160
Default

Instead of adding the shortcode to the article template, can I use the product widget in the right rail?
  #5  
Old May 29th, 2014, 08:33 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi,

Yes, you can.

Eric
  #6  
Old May 29th, 2014, 09:07 AM
bradleyhebdon bradleyhebdon is offline
 
Join Date: Mar 2014
Posts: 160
Default

in the product widget view, I'm assuming I have to use a query searching against the custom keywords entered in the post.

e.g. tag=$keywords

is this correct?
  #7  
Old May 29th, 2014, 09:10 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi,

That's correct.

Eric
  #8  
Old May 29th, 2014, 09:37 AM
bradleyhebdon bradleyhebdon is offline
 
Join Date: Mar 2014
Posts: 160
Default

OK, when entering the custom keywords in the blog post, are they formatted as such:

keyword+keyword+keyword

(literally including the plus sign between them)
  #9  
Old May 29th, 2014, 09:38 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi,

I think a space will work.

Be sure to add them to a custom field and not directly to your blog post.

Eric
  #10  
Old May 29th, 2014, 10:12 AM
bradleyhebdon bradleyhebdon is offline
 
Join Date: Mar 2014
Posts: 160
Default

OK, I'll use a space and see.

Yes, adding "keywords" as a custom field on a post.
  #11  
Old May 29th, 2014, 01:06 PM
bradleyhebdon bradleyhebdon is offline
 
Join Date: Mar 2014
Posts: 160
Default

Ugh, it's not working.

Reference this post http://www.vintageshopper.com/design...pired-nursery/

I've added different keywords (custom fields) and no products show up in the product widget. Currently there's just one keyword entered: "dress" - as a test. I have thousands of dresses in my store.

Any idea what I'm doing wrong? Thanks in advance.
  #12  
Old May 29th, 2014, 01:56 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi,

I don't see that you've completed step 1 or 2 in these steps: http://www.datafeedr.com/forums/show...5008#post35008

Eric
  #13  
Old May 29th, 2014, 02:21 PM
bradleyhebdon bradleyhebdon is offline
 
Join Date: Mar 2014
Posts: 160
Default

OK, I think I completed those steps correctly now.

Still no products found though.
  #14  
Old May 29th, 2014, 03:33 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi,

Try clicking the [Update Settings Only] button now.

Eric
  #15  
Old May 29th, 2014, 04:28 PM
bradleyhebdon bradleyhebdon is offline
 
Join Date: Mar 2014
Posts: 160
Default

I updated settings only and still no products found.

I assume I'm supposed to use the datafeedr widget in the sidebar -- then select the "for articles" widget that I created.

Last edited by bradleyhebdon : May 29th, 2014 at 04:34 PM.
  #16  
Old May 29th, 2014, 09:32 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi,

No, that's not correct. You're supposed to add that PHP code provided in the other thread to your theme's single.php template file.

Eric
  #17  
Old May 29th, 2014, 09:51 PM
bradleyhebdon bradleyhebdon is offline
 
Join Date: Mar 2014
Posts: 160
Default

oh really? I thought you only did that if the view was appearing in the post.

I'm using the widget --to me it makes sense that the code goes in that widget, no?

Last edited by bradleyhebdon : May 29th, 2014 at 09:53 PM.
  #18  
Old May 30th, 2014, 12:27 AM
bradleyhebdon bradleyhebdon is offline
 
Join Date: Mar 2014
Posts: 160
Default

per the instructions, I added the code below to single.php

<?php
$keywords = get_post_meta(get_the_ID(), 'keywords', true);
if ($keywords != '') {
echo datafeedr_tag('ForArticles?word='.$keywords);
}
?>

All it does is display "no products found" - see the very bottom of the post.

I'm very confused now.

I'm trying to display related products in the sidebar via the product widget. I don't want to display related products in the post itself.

Last edited by bradleyhebdon : May 30th, 2014 at 12:28 AM.
  #19  
Old May 30th, 2014, 11:10 AM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi,

I've fixed your store in the Factory to do what you want. Now you just need to:

1. Click the [Update Settings Only] button here: WordPress Admin Area > Tools > Datafeedr

2. Add the Related Articles Widget widget to your sidebar.

Eric
  #20  
Old May 30th, 2014, 12:11 PM
bradleyhebdon bradleyhebdon is offline
 
Join Date: Mar 2014
Posts: 160
Default

Eric, you rock!

If you're ever in town, your favorite drink or two, is on me

Many thanks from a complete and utter .php nitwit.
 


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
Adding related products on drip page digitalcow Problems 2 May 31st, 2012 10:40 AM
Side Bar Disappears When Adding DFR Related Products Short Code To Post erin Problems 6 October 24th, 2011 02:35 PM
Related Products sylviathewitch Questions 4 October 17th, 2011 11:59 AM


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


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