Hi there
I’m getting the same error. I’m just upgrading a site that was very out of date and am using WPSC 3.8.13.3 as well. This error appears if I try to display either the general email or the purchase receipt.
Any pointers as to what’s going wrong would be much appreciated.
Hi,
The warning that you see on the preview page can be ignored – it won’t affect the normal running of your site or the plugin. At some point, WordPress started producing these warnings and as DDT notes, it’s not a difficult thing to fix in my plugin, but I just haven’t gotten around to it yet. I do want to stress that the warning is not a cause for alarm at all in this situation – it’s a misdirected warning in this case. It is meant to inform developers when they are doing something other than what I am doing.
Now, with regards to DDT’s other questions…
The [email content as generated] is not a shortcode. It is just a placeholder to show you where normal email content will sit within the themed email.
My plugin does provide template tags for use in the templates, and it does provide for templating purchase results within the purchase result content templates. Content tags are not available in any of the style templates. Does that answer #3?
With regards to generating a PDF attachment, you could put some PHP in the content template that captures the information you need and passes it to your attachment generator for use after my plugin is done. The templating process in my plugin occurs within the wp_mail action – so I suspect that you could hook into wp_mail after my plugin, pick up the variables you captured in my templates, and use them however you wish. Does that makes sense?
Thread Starter
DDT
(@ddt)
Hi Jacob,
Thanks for answering:
put some PHP in the content template that captures the information you need and passes it to your attachment generator for use after my plugin is done.
That’s what i am looking for, i am looking into your code to see which variables i need to use and when. I am looking for the time “the browser comes back” from a succesfull payment gateway and then the tickets would be generated. I guess this looks like your download logic (i.e. if(ecse_is_purchase_receipt_email()) {), but how can i use if(ecse_is_purchase_receipt_email()) { in my functions.php
For this approach: Do you know how i could use some of your functions from my theme functions.php, at the moment i tried
function test_totals(){
require_once(WP_PLUGIN_URL . '/wp-e-commerce-style-email/mail.class.php');
return "Total, please ".ecse_get_the_totals();
}
But i get a Fatal error: Call to undefined function ecse_get_the_totals()?
I like to leave your code alone and use your functions / variable from my-theme/functions.php.
Kind regards
I don’t recommend trying to use the template tags meant for my templates in your functions file. They are really only meant to be used within the context of those templates. There’s a whole process I’m using behind the scenes to make those tags work in a specific way.
What I would recommend is, create your own data structure to represent the data you need. It could be as simple as a multi-dimensional array or as complex as a class-based object. In my templates, fill that data structure. Use a global or static variable to store it. When it comes time to use your data, it’ll be available.
You may be able to get my tags to work with some fiddling, but since I’m not providing them as an API outside of my templates you don’t have any guarantee that they will continue to work as you need when I push updates.
Does that make sense?