Created
September 8, 2014 12:19
-
-
Save tormjens/4f9ca8d83820e12613b3 to your computer and use it in GitHub Desktop.
Jigoshop Haxx 4 life
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
remove_action('order_status_pending_to_processing', 'jigoshop_processing_order_customer_notification',10); | |
remove_action('order_status_pending_to_on-hold', 'jigoshop_processing_order_customer_notification',10); | |
add_action('order_status_pending_to_processing', 'new_jigoshop_processing_order_customer_notification'); | |
add_action('order_status_pending_to_on-hold', 'new_jigoshop_processing_order_customer_notification'); | |
function new_jigoshop_processing_order_customer_notification($order_id) { | |
$jigoshop_options = Jigoshop_Base::get_options(); | |
$order = new jigoshop_order($order_id); | |
$subject = html_entity_decode('[' . get_bloginfo('name') . '] ' . __('Din ordre er mottatt', 'jigoshop'), ENT_QUOTES, 'UTF-8'); | |
$message .= 'Takk for din ordre. Vi behandler nå din bestilling. Detaljer om ditt kjøp finner du nedenfor:<br /><br />'. "\n\n"; | |
$message .= 'Ordre nr#: '.$order->_data['id'].'<br />'. "\n"; | |
$message .= 'Dato: '.$order->_data['order_date'].'<br /><br />'. "\n\n"; | |
$message .= 'Produkter:<br />'. "\n"; | |
foreach($order->_data['items'] as $item) { | |
$message .= $item['name'] . ' - '.$item['cost_inc_tax'] .' kr<br />'. "\n"; | |
} | |
$message .= 'Totalpris inkl mva: '.$order->_data['order_subtotal'].' kr<br /><br />'. "\n\n"; | |
$message .= 'Adresse:<br />'. "\n"; | |
$message .= $order->_data['shipping_first_name'].' '.$order->_data['billing_last_name'].'<br />'. "\n"; | |
$message .= $order->_data['shipping_address_1'].'<br />'. "\n"; | |
$message .= $order->_data['shipping_address_2'].'<br />'. "\n"; | |
$message .= $order->_data['shipping_postcode'].' '.$order->_data['shipping_city'].'<br /><br />'. "\n\n"; | |
$message .= 'Betalingsmåte: '.$order->_data['payment_method_title'].'<br /><br />'. "\n\n"; | |
$message .= 'Takk for at du handler hos oss!'; | |
wp_mail($order->billing_email, $subject, $message, "From: " . $jigoshop_options->get_option('jigoshop_email') . "\r\n"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment