From 7831db2f42f54824a14ef2116ab95f906bbfc580 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Fri, 13 Jan 2012 11:58:35 +0000 Subject: [PATCH] Minor changes. --- classes/order.class.php | 10 ++++------ classes/woocommerce_email.class.php | 6 ++---- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/classes/order.class.php b/classes/order.class.php index d894863c617..4daec591547 100644 --- a/classes/order.class.php +++ b/classes/order.class.php @@ -59,12 +59,10 @@ class woocommerce_order { var $formatted_shipping_address; /** Get the order if ID is passed, otherwise the order is new and empty */ - function __construct ( $id='' ) { - $this->calc_taxes = (get_option('woocommerce_calc_taxes')=='yes') ? true : false; + function woocommerce_order( $id = '' ) { $this->prices_include_tax = (get_option('woocommerce_prices_include_tax')=='yes') ? true : false; $this->display_totals_ex_tax = (get_option('woocommerce_display_totals_excluding_tax')=='yes') ? true : false; $this->display_cart_ex_tax = (get_option('woocommerce_display_cart_prices_excluding_tax')=='yes') ? true : false; - if ($id>0) $this->get_order( $id ); } @@ -227,14 +225,14 @@ class woocommerce_order { function get_items() { if (!$this->items) : - $this->items = isset( $this->order_custom_fields['_order_items'][0] ) ? maybe_unserialize( maybe_unserialize( $this->order_custom_fields['_order_items'][0] )) : array(); + $this->items = isset( $this->order_custom_fields['_order_items'][0] ) ? maybe_unserialize( $this->order_custom_fields['_order_items'][0] ) : array(); endif; return $this->items; } function get_taxes() { if (!$this->taxes) : - $this->taxes = isset( $this->order_custom_fields['_order_taxes'][0] ) ? maybe_unserialize( maybe_unserialize( $this->order_custom_fields['_order_taxes'][0] )) : array(); + $this->taxes = isset( $this->order_custom_fields['_order_taxes'][0] ) ? maybe_unserialize( $this->order_custom_fields['_order_taxes'][0] ) : array(); endif; return $this->taxes; } @@ -429,7 +427,7 @@ class woocommerce_order { if ($this->get_total_tax() > 0) : - if ( is_array($this->get_taxes()) && sizeof($this->get_taxes()) > 0 ) : + if ( sizeof($this->get_taxes()) > 0 ) : $has_compound_tax = false; diff --git a/classes/woocommerce_email.class.php b/classes/woocommerce_email.class.php index 9486aaae1e6..c8c08a5badd 100644 --- a/classes/woocommerce_email.class.php +++ b/classes/woocommerce_email.class.php @@ -86,9 +86,7 @@ class woocommerce_email { do_action('woocommerce_email_footer'); // Get contents - $message = ob_get_contents(); - - ob_end_clean(); + $message = ob_get_clean(); return $message; } @@ -99,7 +97,7 @@ class woocommerce_email { add_filter( 'wp_mail_content_type', array(&$this, 'get_content_type') ); // Send the mail - @wp_mail( $to, $subject, $message, $headers, $attachments ); + wp_mail( $to, $subject, $message, $headers, $attachments ); // Unhook remove_filter( 'wp_mail_from', array(&$this, 'get_from_address') );