Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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