Minor changes.

This commit is contained in:
Mike Jolley 2012-01-13 11:58:35 +00:00
parent 6cd6dafc11
commit 7831db2f42
2 changed files with 6 additions and 10 deletions

View File

@ -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;

View File

@ -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') );