Originally Posted by Eric
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.
- Create a new category and name it "Coupons".
- Add your coupons to that category.
- Create a new Custom View by going to VIEWS > CUSTOM VIEWS > Add a new view
- Name the view "coupons_from_single_merchant".
- Check the "Don't use layout for this view" checkbox. Your view's properties should look like this:
- Add a Product List module to the view and configure the Product List module like this:
or using the following HTML code:
from <span style="color:#999;font-size:85%;font-style:italic;">[product.merchant]</span><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 />
- You can also limit the number of coupons to be displayed by modifying the modules settings. I'm limiting it to 3.
- Go to the VIEWS > PRODUCT DETAIL > Default view.
- Add a new Text module to your view.
- Paste the following text into the Text module's template area:
That basically says, "get the coupon template and display coupons from the category "Coupons" and only from the same merchant as this product".
[DFR:coupons_from_single_merchant?c=coupons&merchant=<?php echo $product->merchant; ?>]
- Save the module.
- Log into your blog's admin area and go to WordPress Admin Area > Tools > Datafeedr and click the [Update Products and Settings] button.
- 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.:
Since I have many merchants in several stores, how do I display all the coupons on my Homepage HumongousMall.com from all the merchants and arranged by categories and Merchants? Then a visitor can copy and paste the code on the selected product.