Transaction Results replace Total Shipping with text if $0

This filters the purchase log array to change the output if the shipping cost is $0.

Example purchase log $args array to show the elements:

// Purchase log $args array example
	Array (
	[purchase_id] => Purchase # 10
	[total_tax] => Total Tax: $0.00
	[total_shipping] => Total Shipping: $0.00
	[total_price] => Total: $5.50
	[shop_name] => Jeymar Soap
	[find_us] => Word of Mouth
	[discount] => Discount Amount: $0.00 ()
	[coupon_code] =>
	[transaction_id] =>
	[purchase_log_id] => 10
	[payment_method] => Manual Payment
	[shipping_method] => ses_wpsc_premium_shipping
	[shipping_option] => Overseas Shipping
	[discount_amount] => $0.00 [tax] => $0.00
	[shipping] => 0
	[total] => $5.50
	[subtotal] => $5.50 )

 

function update_purchase_log($args){
	//update args:
	if($args[shipping] == '0')
		$args[total_shipping] = "Total Shipping: To be determined \r\n";
	return $args;

}
add_filter('wpsc_purchase_log_notification_common_args','update_purchase_log',$args);

In this case it adds the text “Total Shipping: To be determined” if the cost of shipping is zero