We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Simple Commerce Purchases doesn't work?!

Development and Programming

Milan Topalov's avatar
Milan Topalov
128 posts
about 16 years ago
Milan Topalov's avatar Milan Topalov

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?

       
Milan Topalov's avatar
Milan Topalov
128 posts
about 16 years ago
Milan Topalov's avatar Milan Topalov

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}
       
eyevariety's avatar
eyevariety
158 posts
about 16 years ago
eyevariety's avatar eyevariety

Thanks for this Milan!

       
wildrock's avatar
wildrock
262 posts
15 years ago
wildrock's avatar wildrock
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?

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.

       
Milan Topalov's avatar
Milan Topalov
128 posts
15 years ago
Milan Topalov's avatar Milan Topalov

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 😊

       
imagehat's avatar
imagehat
68 posts
15 years ago
imagehat's avatar imagehat

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.

       
wildrock's avatar
wildrock
262 posts
15 years ago
wildrock's avatar wildrock

Thanks for the PI, imagehat! Sure made my day a lot easier than trying to write up some custom SQL! Though I should brush up on that, too…

       
Milan Topalov's avatar
Milan Topalov
128 posts
15 years ago
Milan Topalov's avatar Milan Topalov

Thanks imagehat!

So that is what parse=”inward” is for!

D’oh!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.