Datafeedr Support Forums

Datafeedr Support Forums (/index.php)
-   Tips, Tricks & Tutorials (/forumdisplay.php?f=66)
-   -   Display coupons on a product details page from same merchant as the product (/showthread.php?t=3734)

Eric January 20th, 2011 10:54 PM

Display coupons on a product details page from same merchant as the product
Here's how you can display a list of of coupons from the same merchant as a product on the product details page. This will require that coupons exist for that merchant in your store, of course.

The easiest way is to add your coupons to 1 category. There are other ways you could do this but I'll just cover the simplest method here.
  1. Create a new category and name it "Coupons".
  2. Add your coupons to that category.
  3. Create a new Custom View by going to VIEWS > CUSTOM VIEWS > Add a new view
  4. Name the view "coupons_from_single_merchant".
  5. Check the "Don't use layout for this view" checkbox. Your view's properties should look like this:
  6. Add a Product List module to the view and configure the Product List module like this:

    or using the following HTML code:
    HTML Code:


        <a href="[]"><strong>[]</strong></a>
        from <span style="color:#999;font-size:85%;font-style:italic;">[product.merchant]</span><br />
        [coupon.description]<br />
          <strong>Code:</strong> [coupon.code]<br />
          <strong>Restrictions:</strong> [coupon.restrictions]<br />
          <strong>Begin Date:</strong> [coupon.begin]<br />
          <strong>End Date:</strong> [coupon.end]<br />

  7. You can also limit the number of coupons to be displayed by modifying the modules settings. I'm limiting it to 3.
  8. Go to the VIEWS > PRODUCT DETAIL > Default view.
  9. Add a new Text module to your view.
  10. Paste the following text into the Text module's template area:

    [DFR:coupons_from_single_merchant?c=coupons&amp;merchant=<?php echo $product->merchant; ?>]
    That basically says, "get the coupon template and display coupons from the category "Coupons" and only from the same merchant as this product".
  11. Save the module.
  12. Log into your blog's admin area and go to WordPress Admin Area > Tools > Datafeedr and click the [Update Products and Settings] button.
  13. Now navigate to a product which you know also has a coupon from the same merchant. Here's how my display looks when viewing a product from 123Refills.:



cashnow January 21st, 2011 09:53 AM

Thank you Eric for providing the tutorial.

I have a silly question: How do I add coupons? I created the category but when I search 'coupons' only a few coupons (unrelated to my niche) come up. Is there a way to manually add coupons?

Is there another feed especially for coupons? I know there are sites that work exclusively with coupons. Where do they get those feeds?

Eric January 21st, 2011 09:57 AM

We have coupon feeds from merchants from Shareasale, Pepperjam and Affiliate window. They have separate feeds for their coupons so you will need to add those merchants who provide coupons related to your niche. You can do that on the "Your Merchants" page but don't forget to also add them to your specific store, too.

dcutri February 25th, 2011 02:04 PM

Sorry, I don't know how to delete a post. I decided to try it on my own before posting. I came up with the idea to use two product lists on the same search results page--one showing non-coupon products from a specific merchant and another one below it which is only products tagged "coupon". That should work right? that's what I'm trying to do.

Eric February 25th, 2011 02:07 PM

It should...

onlineshopper April 24th, 2011 08:21 PM

Hi Eric, I've added the “coupons” category and followed all the above instructions, but the merchant coupon is not showing. If you like to check, “Football fanatics” is one of the merchants offering coupons, but its not showing them. Could you please help me figure out what I’ve done wrong? My store id is 31337. Thanks!

Eric April 24th, 2011 09:11 PM


This is because you have input a slug value for your category.


That slug field should be left blank or set to "coupons".


onlineshopper April 25th, 2011 11:36 AM

Thank you so much Eric for the quick reply! It worked:-)

amindana May 6th, 2011 04:54 PM

Error on Page
Hi Eric,

I followed your instructions but had the following error on the product list page

HTML Code:

Warning: Invalid argument supplied for foreach() in /home/thecatal/public_html/argos/wp-content/plugins/datafeedr/datafeedr.php(2203) : eval()'d code on line 3
Are you able to advice please

Eric May 6th, 2011 06:37 PM


You added the code to a Text module but you need to use a Product List module instead.


amindana May 6th, 2011 07:10 PM

Error on Page
You are a STAR Eric...

That fixed it, sorry I should have paid more attention but as a newbie to the system you'll expect this :D

mviadam June 3rd, 2011 02:46 PM

Is there not a feed from merchants that is a sort of items on sale feed? I'd love to be able to have a sales deals page on my site that just fed in different sales for the merchants. Is this possible?

Eric June 3rd, 2011 04:31 PM

Yes, it comes as a default page in your store. If you have products with sales prices in your store, they will appear either here:

or here:


mviadam June 13th, 2011 02:52 PM

So could I follow these same steps to create a 'sales items by merchant' view?

Eric June 13th, 2011 03:15 PM


pennymoonchild June 14th, 2011 07:12 PM

Is it possible to embed a merchant's products and coupon codes within a post or page directly in wordpress?

Eric June 14th, 2011 07:16 PM

Yes, check out the DFR shortcode and filters here:

pennymoonchild June 14th, 2011 09:08 PM

I am totally lost. I cannot figure it out. If it is not too much trouble can you please provide me with an example? I'd really appreciate it. I have no idea what codes to put where. My output keep giving me Invalid argument errors. :confused:

Eric June 14th, 2011 09:34 PM

Can you tell me what you have so far? What custom view(s) have you created and what shortcode are you embedding in your posts?

You want to make sure you have a category that contains all of the coupons. Let's say that category is called 'coupons'.

Then you want to create a new custom view that will display the coupons. Be sure to add a product list module to that view. Let's call that view 'merchant_coupons'.

Then you will have a short code that you will embed in a post like this:

pennymoonchild June 15th, 2011 04:20 PM


Originally Posted by Eric (Post 21482)
Then you will have a short code that you will embed in a post like this:

Thanks so much Eric! This is the code I was looking for. Much appreciated! :D

All times are GMT -5. The time now is 12:51 PM.

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