WordPress wp-ecommerce, Test Gateway, send email to admin too

My client doesn’t want to accept online payments, just have the order details emailed, so I’m using the Test Gateway. It’s only sending emails to the buyer and I need it to send to the admin’s email too.

Here’s the code from the plugin:

Read More
$email = wpsc_get_buyers_email($purchase_log['id']);

I tried making it an array, but it throws errors and doesn’t work. I don’t have a lot of php experience!

$email = array (wpsc_get_buyers_email($purchase_log['id']), 'myemail@email.com');

Any help?

Related posts

Leave a Reply

3 comments

  1. I was just searching for the same, but couldn’t find an easy answer anywhere. I know the topic is quite old but this solution should be quite helpful.

    In my WP-Ecommerce I edited:

    wpsc-theme/functions/wpsc-transaction_results_functions.php

    I just added merchant idealcheckoutideal (this could be any merchant) and the functions that fire the notification emails. I guess you could call those functions anywhere as long as you are using the purchase_log parameter.

    if ( $selected_gateway ) {
            switch( $selected_gateway ){
                case 'anymerchant you want':
    
                    if ( ! isset( $_REQUEST['sessionid'] ) )
                          return;
    
    
                    $purchase_log = new WPSC_Purchase_Log( $_REQUEST['sessionid'], 'sessionid' );
                    wpsc_send_admin_email($purchase_log); 
                    wpsc_send_customer_email($purchase_log);               
    
                break;
    
  2. If you are using the wp-ecomemrce plugin then you shouldn’t have to edit any code the admin email address will get sent emails of new orders. Have a look through the backend settings in wordpress you may have flicked a setting off.

  3. How is it sending the mail? Is it using php’s mail() or wp_mail(). If it’s using php’s mail() you should send the $email variable as comma separated, not as an array. (If it’s their custom roller, also try sending the addresses separated by a comma)