I was in need of a plugin that lists member’s past purchases done via Simple Commerce and have found this plugin: http://devot-ee.com/add-ons/plugins/simple-commerce-purchases/
In theory it does exactly what I need, but in reality it doesn’t work at all (EE v1.6.8).
I tried this:
{exp:ih_simple_commerce_purchases}
{item_purchased} - {purchase_date format="%F %d, %Y"}
{exp:ih_simple_commerce_purchases}
And got this output (no errors is apache log):
{item_purchased} - {purchase_date format="%F %d, %Y"}
Has anyone had any luck with this plugin?
No luck with the plugin… I’ve used the Query module instead.
If anyone is interested here is the query:
{exp:query sql="SELECT
exp_simple_commerce_purchases.item_cost as item_cost, exp_simple_commerce_purchases.purchase_date as purchase_date, exp_weblog_titles.title as title, exp_weblog_titles.url_title as url_title, exp_weblogs.blog_title as blog_title, exp_weblogs.blog_url as blog_url
FROM exp_simple_commerce_purchases
JOIN exp_simple_commerce_items ON exp_simple_commerce_items.item_id = exp_simple_commerce_purchases.item_id
JOIN exp_weblog_titles ON exp_weblog_titles.entry_id = exp_simple_commerce_items.entry_id
JOIN exp_weblogs ON exp_weblogs.weblog_id = exp_weblog_titles.weblog_id
WHERE exp_simple_commerce_purchases.member_id = '{member_id}' "}
<div class="article">
<h3><a href="http://{blog_url}_a/{url_title}/">{title}</a></h3>
<div class="details">{blog_title} | Purchased on {purchase_date format="%d %F %Y"} at the cost of ${item_cost}</div>
</div>
{if no_results}
No purchases to display
{/if}
{/exp:query}
I was in need of a plugin that lists member’s past purchases done via Simple Commerce and have found this plugin: http://devot-ee.com/add-ons/plugins/simple-commerce-purchases/ In theory it does exactly what I need, but in reality it doesn’t work at all (EE v1.6.8). I tried this:And got this output (no errors is apache log):{exp:ih_simple_commerce_purchases} {item_purchased} - {purchase_date format="%F %d, %Y"} {exp:ih_simple_commerce_purchases}
Has anyone had any luck with this plugin?{item_purchased} - {purchase_date format="%F %d, %Y"}
Works for me (mostly). The provided sample tags were a bit mangled. The ending tag:
{exp:ih_simple_commerce_purchases}
Needs the ending “/”
{/exp:ih_simple_commerce_purchases}
Then the plugin works fine. But I am getting undefined variable error gibberish printed to my screen, which is why I ended up here. Might try the query code, too.
Update:
The undefined variable on line 97 error was a case of $val needing to be fixed to read $value.
I guess the coder was a tad sloppy, or uploaded the wrong version? Surprised no one has used this plugin, or the author post an update.
Now the pi works as advertised. It’s sweet–no query module needed.
Well spotted wildrock! My bad!
On the other hand I just copied the code from the plugin usage info in control panel… so the info is wrong 😊
Plugin works now.
However it doesn’t give you a lot info on the purchased item (no weblog custom fields, no weblog information, etc) and you can’t fetch it easily (weblog tag won’t work inside it) so I’ll stick with my query 😊
Hi guys, just ran across this thread - didn’t realize anyone was using this plugin it was a quick one for a client site I had up on github, sorry for the confusion. I’ve just updated the plugin to fix the php error, and fixed the documentation.
http://github.com/imagehat/ih.simple_commerce_purchases.ee_addon
Milan, if you want to you can in fact use the weblog:entries tag within this plugin (or any other plugin) by using the parse=”inward” parameter. For example:
{exp:ih_simple_commerce_purchases member_id="{segment_3}" parse="inward"}
{exp:weblog:entries weblog="my_weblog" entry_id="{weblog_entry_id}"}
<h1>{title}</h1>
{my_custom_field}
{another_custom_field}
{item_purchased} - {purchase_date format="%F %d, %Y"}
{/exp:weblog:entries}
{/exp:ih_simple_commerce_purchases}
But of course your query works just as well…
Cheers.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.