5
), $atts));
$recent_orders = ('all' == $recent_orders) ? -1 : $recent_orders;
global $post, $current_user;
get_currentuserinfo();
jigoshop::show_messages();
if (is_user_logged_in()) :
?>
%s. From your account dashboard you can view your recent orders, manage your shipping and billing addresses and change your password .', 'jigoshop'), $current_user->display_name, apply_filters('jigoshop_get_change_password_page_id', get_permalink(jigoshop_get_page_id('change_password')))); ?>
get_customer_orders( get_current_user_id(), $recent_orders );
if ($jigoshop_orders->orders) foreach ($jigoshop_orders->orders as $order) :
?>
id; ?>
order_date)); ?>
formatted_shipping_address) echo $order->formatted_shipping_address; else echo '–'; ?>
order_total); ?>
status, 'jigoshop'); ?>
status=='pending') : ?>
countries[get_user_meta( get_current_user_id(), 'billing-country', true )])) $country = jigoshop_countries::$countries->countries[get_user_meta( get_current_user_id(), 'billing-country', true )]; else $country = '';
$address = array(
get_user_meta( get_current_user_id(), 'billing-first_name', true ) . ' ' . get_user_meta( get_current_user_id(), 'billing-last_name', true )
,get_user_meta( get_current_user_id(), 'billing-company', true )
,get_user_meta( get_current_user_id(), 'billing-address', true )
,get_user_meta( get_current_user_id(), 'billing-address2', true )
,get_user_meta( get_current_user_id(), 'billing-city', true )
,get_user_meta( get_current_user_id(), 'billing-state', true )
,get_user_meta( get_current_user_id(), 'billing-postcode', true )
,$country
);
$address = array_map('trim', $address);
$formatted_address = array();
foreach ($address as $part) if (!empty($part)) $formatted_address[] = $part;
$formatted_address = implode(', ', $formatted_address);
if (!$formatted_address) _e('You have not set up a billing address yet.', 'jigoshop'); else echo $formatted_address;
?>
countries[get_user_meta( get_current_user_id(), 'shipping-country', true )])) $country = jigoshop_countries::$countries->countries[get_user_meta( get_current_user_id(), 'shipping-country', true )]; else $country = '';
$address = array(
get_user_meta( get_current_user_id(), 'shipping-first_name', true ) . ' ' . get_user_meta( get_current_user_id(), 'shipping-last_name', true )
,get_user_meta( get_current_user_id(), 'shipping-company', true )
,get_user_meta( get_current_user_id(), 'shipping-address', true )
,get_user_meta( get_current_user_id(), 'shipping-address2', true )
,get_user_meta( get_current_user_id(), 'shipping-city', true )
,get_user_meta( get_current_user_id(), 'shipping-state', true )
,get_user_meta( get_current_user_id(), 'shipping-postcode', true )
,$country
);
$address = array_map('trim', $address);
$formatted_address = array();
foreach ($address as $part) if (!empty($part)) $formatted_address[] = $part;
$formatted_address = implode(', ', $formatted_address);
if (!$formatted_address) _e('You have not set up a shipping address yet.', 'jigoshop'); else echo $formatted_address;
?>
0 && jigoshop::verify_nonce('edit_address') ) :
update_user_meta( $user_id, $load_address . '-first_name', jigowatt_clean($_POST['address-first_name']) );
update_user_meta( $user_id, $load_address . '-last_name', jigowatt_clean($_POST['address-last_name']) );
update_user_meta( $user_id, $load_address . '-company', jigowatt_clean($_POST['address-company']) );
update_user_meta( $user_id, $load_address . '-email', jigowatt_clean($_POST['address-email']) );
update_user_meta( $user_id, $load_address . '-address', jigowatt_clean($_POST['address-address']) );
update_user_meta( $user_id, $load_address . '-address2', jigowatt_clean($_POST['address-address2']) );
update_user_meta( $user_id, $load_address . '-city', jigowatt_clean($_POST['address-city']) );
update_user_meta( $user_id, $load_address . '-postcode', jigowatt_clean($_POST['address-postcode']) );
update_user_meta( $user_id, $load_address . '-country', jigowatt_clean($_POST['address-country']) );
update_user_meta( $user_id, $load_address . '-state', jigowatt_clean($_POST['address-state']) );
update_user_meta( $user_id, $load_address . '-phone', jigowatt_clean($_POST['address-phone']) );
update_user_meta( $user_id, $load_address . '-fax', jigowatt_clean($_POST['address-fax']) );
endif;
wp_safe_redirect( apply_filters('jigoshop_get_myaccount_page_id', get_permalink(jigoshop_get_page_id('myaccount'))) );
exit;
endif;
$address = array(
'first_name' => get_user_meta( get_current_user_id(), $load_address . '-first_name', true ),
'last_name' => get_user_meta( get_current_user_id(), $load_address . '-last_name', true ),
'company' => get_user_meta( get_current_user_id(), $load_address . '-company', true ),
'email' => get_user_meta( get_current_user_id(), $load_address . '-email', true ),
'phone' => get_user_meta( get_current_user_id(), $load_address . '-phone', true ),
'fax' => get_user_meta( get_current_user_id(), $load_address . '-fax', true ),
'address' => get_user_meta( get_current_user_id(), $load_address . '-address', true ),
'address2' => get_user_meta( get_current_user_id(), $load_address . '-address2', true ),
'city' => get_user_meta( get_current_user_id(), $load_address . '-city', true ),
'state' => get_user_meta( get_current_user_id(), $load_address . '-state', true ),
'postcode' => get_user_meta( get_current_user_id(), $load_address . '-postcode', true ),
'country' => get_user_meta( get_current_user_id(), $load_address . '-country', true )
);
?>
0 && jigoshop::verify_nonce('change_password')) :
if ($_POST['password-1'] && $_POST['password-2']) :
if ($_POST['password-1'] == $_POST['password-2']) :
wp_update_user(array('ID' => $user_id, 'user_pass' => $_POST['password-1']));
wp_safe_redirect( apply_filters('jigoshop_get_myaccount_page_id', get_permalink(jigoshop_get_page_id('myaccount')) ));
exit;
else :
jigoshop::add_error(__('Passwords do not match.', 'jigoshop'));
endif;
else :
jigoshop::add_error(__('Please enter your password.', 'jigoshop'));
endif;
endif;
endif;
jigoshop::show_messages();
?>
0 && $order->user_id == get_current_user_id()) :
echo '' . sprintf(__('Order #%s made on %s .', 'jigoshop'), $order->id, date_i18n(get_option('date_format') . ' ' . get_option('time_format'), strtotime($order->order_date))) . ' ';
echo sprintf(__('Order status: %s ', 'jigoshop'), sanitize_title($order->status), __($order->status, 'jigoshop') );
echo '.
';
?>
order_subtotal_inc_tax) : ?>
get_subtotal_to_display(); ?>
order_subtotal_inc_tax) :
if ($order->order_shipping > 0) :
?>
get_shipping_to_display(); ?>
get_tax_classes() as $tax_class) :
if ($order->tax_class_is_not_compound($tax_class)) :
?>
get_tax_class_for_display($tax_class) . ' (' . (float) $order->get_tax_rate($tax_class) . '%):'; ?>
get_tax_amount($tax_class) ?>
order_subtotal_inc_tax); ?>
order_shipping > 0) :
?>
get_shipping_to_display(); ?>
order_subtotal_inc_tax) :
foreach ($order->get_tax_classes() as $tax_class) :
if (!$order->tax_class_is_not_compound($tax_class)) :
?>
get_tax_class_for_display($tax_class) . ' (' . (float) $order->get_tax_rate($tax_class) . '%):'; ?>
get_tax_amount($tax_class) ?>
get_tax_classes() as $tax_class) :
?>
get_tax_class_for_display($tax_class) . ' (' . (float) $order->get_tax_rate($tax_class) . '%):'; ?>
get_tax_amount($tax_class) ?>
order_discount > 0) : ?>
-order_discount); ?>
order_total); ?>
customer_note) : ?>
customer_note)); ?>
items) > 0) :
foreach ($order->items as $item) :
if (isset($item['variation_id']) && $item['variation_id'] > 0) :
$_product = new jigoshop_product_variation($item['variation_id']);
if (is_array($item['variation'])) :
$_product->set_variation_attributes($item['variation']);
endif;
else :
$_product = new jigoshop_product($item['id']);
endif;
echo '
' . $_product->get_sku() . '
' . $item['name'];
if (isset($_product->variation_data)) :
echo jigoshop_get_formatted_variation($_product->variation_data);
endif;
echo '
' . $item['qty'] . '
' . jigoshop_price($item['cost'] * $item['qty'], array('ex_tax_label' => 1)) . '
';
endforeach;
endif;
?>
billing_email)
echo '' . __('Email:', 'jigoshop') . ' ' . $order->billing_email . ' ';
if ($order->billing_phone)
echo '' . __('Telephone:', 'jigoshop') . ' ' . $order->billing_phone . ' ';
?>
formatted_shipping_address)
_e('N/A', 'jigoshop'); else
echo $order->formatted_shipping_address;
?>
formatted_billing_address)
_e('N/A', 'jigoshop'); else
echo $order->formatted_billing_address;
?>