WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I sell a product using WP e-commerce that is downloadable only after I check some information that the customer sends me. After checking the information I would like to go to the WordPress dashboard, change the order status to "Job Dispatched", and have that trigger a new email to the customer with instructions on what to do next.

Any ideas or experience with attaching some trigger event or option to the "Job Dispatched" status change?

share|improve this question

closed as off-topic by Mark Kaplun, birgire, Pieter Goosen, gmazzap, Johannes Pille Sep 28 '14 at 12:34

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Your question should be specific to WordPress. Generic PHP/JS/HTML/CSS questions might be better asked at Stack Overflow or another appropriate site of the Stack Exchange network. Third party plugins and themes are off topic." – Mark Kaplun, birgire, Pieter Goosen, gmazzap, Johannes Pille
If this question can be reworded to fit the rules in the help center, please edit the question.

I'd suggest you start by looking at action 'wpsc_purchase_log_update', which is triggered in wpsc-includes/purchase-log.class.php and passes the wpsc_purchase_log object. Test the $previous_status member of that object, and the new status value (might be in data member as $data['statusno']) == WPSC_Purchase_Log::JOB_DISPATCHED.

Something like this (untested):

add_action('wpsc_purchase_log_update', 'wpse_73707_wpscPurchaseLogUpdate');

* trigger event or option to the "Job Dispatched" status change
* @param WPSC_Purchase_Log $purchaseLog
function wpse_73707_wpscPurchaseLogUpdate($purchaseLog) {
    if ($purchaseLog->previous_status && $purchaseLog->data['statusno'] == WPSC_Purchase_Log::JOB_DISPATCHED) {
        // send your email ...
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.