Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: GeertDD/woocommerce
base: 7e3d400af0
...
head fork: GeertDD/woocommerce
compare: ecf2a32466
  • 10 commits
  • 17 files changed
  • 0 commit comments
  • 5 contributors
2  admin/post-types/writepanels/writepanel-order_downloads.php
View
@@ -268,7 +268,7 @@ function woocommerce_order_downloads_save( $post_id, $post ) {
$format = array( '%d', '%s', '%s');
- $expiry = array_key_exists($i, $access_expires) ? date('Y-m-d', strtotime($access_expires[$i])) : null;
+ $expiry = ( array_key_exists( $i, $access_expires ) && $access_expires[ $i ] != '' ) ? date( 'Y-m-d', strtotime( $access_expires[ $i ] ) ) : null;
if ( ! is_null($expiry)) {
$data['access_expires'] = $expiry;
4 classes/class-wc-cart.php
View
@@ -1124,7 +1124,7 @@ function calculate_totals() {
* OR
* ADJUST TAX - Checkout calculations when a tax class is modified
*/
- if ( ( $woocommerce->customer->is_customer_outside_base() && defined('WOOCOMMERCE_CHECKOUT') ) || ( $_product->get_tax_class() !== $_product->tax_class ) ) {
+ if ( ( $woocommerce->customer->is_customer_outside_base() && ( defined('WOOCOMMERCE_CHECKOUT') || $woocommerce->customer->has_calculated_shipping() ) ) || ( $_product->get_tax_class() !== $_product->tax_class ) ) {
// Get tax rate for the store base, ensuring we use the unmodified tax_class for the product
$base_tax_rates = $this->tax->get_shop_base_rate( $_product->tax_class );
@@ -1416,7 +1416,7 @@ function show_shipping() {
if ( ! is_array( $this->cart_contents ) ) return false;
if ( get_option( 'woocommerce_shipping_cost_requires_address' ) == 'yes' ) {
- if ( empty( $_SESSION['calculated_shipping'] ) ) {
+ if ( ! $woocommerce->customer->has_calculated_shipping() ) {
if ( ! $woocommerce->customer->get_shipping_country() || ! $woocommerce->customer->get_shipping_state() ) return false;
}
}
8 classes/class-wc-checkout.php
View
@@ -614,12 +614,12 @@ function get_value( $input ) {
$default_shipping_country = apply_filters('default_checkout_country', ($woocommerce->customer->get_shipping_country()) ? $woocommerce->customer->get_shipping_country() : $woocommerce->countries->get_base_country());
- if ( empty( $_SESSION['calculated_shipping'] ) ) {
- $default_billing_state = apply_filters('default_checkout_state', '');
- $default_shipping_state = apply_filters('default_checkout_state', '');
- } else {
+ if ( $woocommerce->customer->has_calculated_shipping() ) {
$default_billing_state = apply_filters('default_checkout_state', $woocommerce->customer->get_state());
$default_shipping_state = apply_filters('default_checkout_state', $woocommerce->customer->get_shipping_state());
+ } else {
+ $default_billing_state = apply_filters('default_checkout_state', '');
+ $default_shipping_state = apply_filters('default_checkout_state', '');
}
if ($input == "billing_country") return $default_billing_country;
10 classes/class-wc-customer.php
View
@@ -39,6 +39,16 @@ function __construct() {
endif;
}
+ /**
+ * has_calculated_shipping function.
+ *
+ * @access public
+ * @return bool
+ */
+ function has_calculated_shipping() {
+ if ( ! empty( $_SESSION['calculated_shipping'] ) && $_SESSION['calculated_shipping'] ) return true; else return false;
+ }
+
/** set location to base location */
function set_to_base() {
$default = get_option('woocommerce_default_country');
18 classes/class-wc-tax.php
View
@@ -195,10 +195,10 @@ function get_rates( $tax_class = '' ) {
$this->get_tax_rates();
- $tax_class = sanitize_title($tax_class);
+ $tax_class = sanitize_title( $tax_class );
- /* Checkout uses customer location, otherwise use store base rate */
- if ( defined('WOOCOMMERCE_CHECKOUT') && WOOCOMMERCE_CHECKOUT ) :
+ /* Checkout uses customer location for the tax rates. Also, if shipping has been calculated, use the customers address. */
+ if ( ( defined('WOOCOMMERCE_CHECKOUT') && WOOCOMMERCE_CHECKOUT ) || $woocommerce->customer->has_calculated_shipping() ) {
$country = $woocommerce->customer->get_shipping_country();
$state = $woocommerce->customer->get_shipping_state();
@@ -208,11 +208,11 @@ function get_rates( $tax_class = '' ) {
return $matched_tax_rates;
- else :
+ } else {
return $this->get_shop_base_rate( $tax_class );
- endif;
+ }
}
@@ -249,18 +249,18 @@ function get_shipping_tax_rates( $tax_class = null ) {
$this->get_tax_rates();
- if (defined('WOOCOMMERCE_CHECKOUT') && WOOCOMMERCE_CHECKOUT) :
+ if ( ( defined('WOOCOMMERCE_CHECKOUT') && WOOCOMMERCE_CHECKOUT ) || $woocommerce->customer->has_calculated_shipping() ) {
$country = $woocommerce->customer->get_shipping_country();
$state = $woocommerce->customer->get_shipping_state();
$postcode = $woocommerce->customer->get_shipping_postcode();
- else :
+ } else {
$country = $woocommerce->countries->get_base_country();
$state = $woocommerce->countries->get_base_state();
$postcode = '';
- endif;
+ }
// If we are here then shipping is taxable - work it out
- if ( !is_null($tax_class) ) :
+ if ( ! is_null($tax_class) ) :
$matched_tax_rates = array();
59 classes/integrations/wootransmitter/assets/css/style.css
View
@@ -1,59 +0,0 @@
-#wpadminbar #wp-admin-bar-wootransmitter { float: right; margin-right: 1em; }
-
-#wpadminbar #wp-admin-bar-wootransmitter .ab-submenu li { margin-top: 0.3em; margin-bottom: 0.5em; }
-#wpadminbar #wp-admin-bar-wootransmitter .ab-item { /*overflow: hidden !important; */color: #333; text-shadow: none !important; padding: 0 6px !important; height: auto; }
-#wpadminbar #wp-admin-bar-wootransmitter .ab-item .message-contents { display: block; margin-left: 10px; width: 270px !important; overflow: hidden !important; word-wrap: break-word; white-space: normal !important; }
-#wpadminbar #wp-admin-bar-wootransmitter .ab-item .title { color: #666666; text-shadow: none !important; }
-#wpadminbar #wp-admin-bar-wootransmitter .ab-item .excerpt { font: normal 11px/16px sans-serif !important; clear: both; display: block; text-shadow: none; float: none; }
-#wpadminbar #wp-admin-bar-wootransmitter .ab-item .mark-as-read { float: left; text-indent: -9999px; display: block; width: 16px; height: 16px; padding: 0; margin: 0; margin-top: 8px; margin-left: 5px; opacity: 0.4; background: transparent url('../images/ico-tick.png') no-repeat left top; }
-#wpadminbar #wp-admin-bar-wootransmitter .ab-item .mark-as-read:hover { opacity: 1; }
-#wpadminbar #wp-admin-bar-wootransmitter .ab-item .application { color: #FFFFFF; background: #999999; text-shadow: 1px 1px 1px #333; font-size: 0.75em; letter-spacing: 0.1em; padding: 2px 4px; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; }
-
-#wpadminbar #wp-admin-bar-wootransmitter #wp-admin-bar-no-unread-messages .ab-item,
-#wpadminbar #wp-admin-bar-wootransmitter #wp-admin-bar-notifications-disabled .ab-item { height: 75px; text-indent: 100px !important; }
-#wpadminbar #wp-admin-bar-wootransmitter #wp-admin-bar-no-unread-messages .ab-item { background-image: url(../images/ninja.png); background-repeat: no-repeat; background-position: 10px top; }
-#wpadminbar #wp-admin-bar-wootransmitter #wp-admin-bar-notifications-disabled .ab-item { background-image: url(../images/ninja-sad.png); background-repeat: no-repeat; background-position: 10px top; }
-#wpadminbar #wp-admin-bar-wootransmitter #wp-admin-bar-notifications-disabled .ab-item .title,
-#wpadminbar #wp-admin-bar-wootransmitter #wp-admin-bar-no-unread-messages .ab-item .title { color: #999999; display: block; margin-top: 20px !important; }
-#wpadminbar #wp-admin-bar-wootransmitter #wp-admin-bar-notifications-disabled .ab-item:hover,
-#wpadminbar #wp-admin-bar-wootransmitter #wp-admin-bar-no-unread-messages .ab-item:hover { background-color: #FFFFFF !important; }
-
-#wpadminbar #wp-admin-bar-wootransmitter .menupop .ab-item { background-image: none !important; }
-#wpadminbar #wp-admin-bar-wootransmitter .menupop .ab-sub-wrapper { margin-right: 321px !important; margin-top: -100%; position: absolute; z-index: 2; }
-#wpadminbar #wp-admin-bar-wootransmitter .menupop .ab-sub-wrapper .message-contents .excerpt { color: #666666 !important; font-size: 0.85em !important; }
-#wpadminbar #wp-admin-bar-wootransmitter .menupop .ab-sub-wrapper .message-contents a { text-shadow: none !important; display: inline !important; height: auto; padding: 0; margin: 0; font-size: inherit !important; }
-#wpadminbar #wp-admin-bar-wootransmitter .menupop .ab-sub-wrapper .message-contents br { line-height: 0.5 !important; }
-#wpadminbar #wp-admin-bar-wootransmitter .menupop .ab-sub-wrapper .ab-item:hover { background-color: #FFFFFF !important; }
-
-#wpadminbar #wp-admin-bar-wootransmitter #wp-admin-bar-notificatiion-status .ab-item a { text-shadow: none !important; text-align: right; font-size: 11px !important; }
-
-#wp-admin-bar-wootransmitter .message-count { padding: 2px 6px !important; margin: 0; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; }
-
-#wp-admin-bar-wootransmitter .ab-sub-wrapper { /* max-height: 536px; overflow-y: hidden !important; overflow-x: hidden !important;*/ right: 0; left: auto; min-width: 320px; max-width: 320px; }
-
-#wp-admin-bar-wootransmitter .message-count.off { color: #999999; }
-
-#wp-admin-bar-wootransmitter .message-count.read,
-#wp-admin-bar-wootransmitter.hover .message-count.read {
- background-image: -ms-linear-gradient(bottom, #d3d3d3, #e7e7e7) !important;
- background-image: -moz-linear-gradient(bottom, #e7e7e7, #d3d3d3) !important;
- background-image: -webkit-gradient(linear, left bottom, left top, from(#d3d3d3), to(#e7e7e7)) !important;
- background-image: -webkit-linear-gradient(bottom, #e7e7e7, #d3d3d3) !important;
- background-image: linear-gradient(bottom, #d3d3d3, #e7e7e7) !important;
- -moz-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
- -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
- box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
-}
-#wp-admin-bar-wootransmitter .message-count.unread {
- background-image: -ms-linear-gradient(bottom, #46729D, #7498B9) !important;
- background-image: -moz-linear-gradient(bottom, #46729D, #7498B9) !important;
- background-image: -webkit-gradient(linear, left bottom, left top, from(#46729D), to(#7498B9)) !important;
- background-image: -webkit-linear-gradient(bottom, #46729D, #7498B9) !important;
- background-image: linear-gradient(bottom, #46729D, #7498B9) !important;
- background-color: #7498B9 !important;
- -moz-box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
- -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
- box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
- color: #fff !important;
- text-shadow: 0 -1px 0 #24405C;
-}
BIN  classes/integrations/wootransmitter/assets/images/ico-tick.png
View
Deleted file not rendered
BIN  classes/integrations/wootransmitter/assets/images/ninja-sad.png
View
Deleted file not rendered
BIN  classes/integrations/wootransmitter/assets/images/ninja.png
View
Deleted file not rendered
404 classes/integrations/wootransmitter/classes/wootransmitter.class.php
View
@@ -1,404 +0,0 @@
-<?php
-class WooThemes_Transmitter {
- var $client_key;
- private $token;
- private $app_keys;
- private $api_url;
- private $assets_url;
- private $transient_expire_time;
- private $is_enabled;
-
- /**
- * Constructor.
- * @return {void}
- */
- public function __construct ( $file ) {
- $this->client_key = '829d3e65-fe23-4c2f-902b-15e50646aa81';
- $this->token = 'wootransmitter';
- $this->api_url = 'http://api.transmitterapp.com/v1/';
- $this->assets_url = $this->get_assets_url( $file );
- $this->transient_expire_time = 60 * 60 * 24; // 24 Hours.
- $this->app_keys = array();
- $this->is_enabled = get_option( $this->token . '-status', false );
-
- // Initialise the script.
- add_action( 'init', array( &$this, 'init' ) );
-
- add_action( 'wp_ajax_' . $this->token . '-mark-as-read', array( &$this, 'mark_message_as_read' ) );
- add_action( 'wp_ajax_' . $this->token . '-toggle-notification-status', array( &$this, 'toggle_notifications_status' ) );
- } // End __construct()
-
- /**
- * init function.
- *
- * @access public
- * @since 1.0.0
- */
- public function init () {
- if ( current_user_can( 'manage_options' ) ) {
- add_action( 'admin_bar_menu', array( &$this, 'add_toolbar_menu' ) );
- add_action( 'wp_enqueue_scripts', array( &$this, 'enqueue_styles' ), 10 );
- add_action( 'admin_print_styles', array( &$this, 'enqueue_styles' ), 10 );
- }
- } // End init()
-
- /**
- * toggle_notifications_status function.
- *
- * @access public
- * @since 1.0.0
- */
- public function toggle_notifications_status () {
- if( ! current_user_can( 'manage_options' ) ) wp_die( __( 'You do not have sufficient permissions to access this page.', 'wootransmitter' ) );
-
- if( ! check_admin_referer( $this->token . '-toggle-notification-status' ) ) wp_die( __( 'You have taken too long. Please go back and retry.', 'wootransmitter' ) );
-
- $status = isset( $_GET['status'] ) && in_array( $_GET['status'], array( 'enable', 'disable' ) ) ? $_GET['status'] : '';
-
- if( ! $status ) die;
-
- if ( $this->is_enabled == true ) {
- $new_status = 0;
- } else {
- $new_status = 1;
- }
-
- // Run the update.
- update_option( $this->token . '-status', $new_status );
-
- $sendback = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'ids' ), wp_get_referer() );
- wp_safe_redirect( $sendback );
- exit;
- } // End toggle_notifications_status()
-
- /**
- * mark_message_as_read function.
- *
- * @access public
- * @since 1.0.0
- */
- public function mark_message_as_read () {
- if( ! current_user_can( 'manage_options' ) ) wp_die( __( 'You do not have sufficient permissions to access this page.', 'wootransmitter' ) );
-
- if( ! check_admin_referer( $this->token . '-mark-as-read' ) ) wp_die( __( 'You have taken too long. Please go back and retry.', 'wootransmitter' ) );
-
- $message_id = isset( $_GET['message_id'] ) && (int)$_GET['message_id'] ? (int)$_GET['message_id'] : '';
-
- if( ! $message_id ) die;
-
- $read_messages = get_option( $this->token . '-read', array() );
- $active_message_ids = $this->get_message_ids();
-
- // Remove expired read messages.
- $read_messages = $this->remove_expired_read_messages( $read_messages, $active_message_ids );
-
- if ( ! in_array( $message_id, $read_messages ) ) {
- $read_messages[] = $message_id;
-
- // Run the update.
- update_option( $this->token . '-read', $read_messages );
- }
-
- $sendback = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'ids' ), wp_get_referer() );
- wp_safe_redirect( $sendback );
- exit;
- } // End mark_message_as_read()
-
- /**
- * remove_expired_read_messages function.
- *
- * @access public
- * @since 1.0.0
- */
- public function remove_expired_read_messages ( $read, $active ) {
- foreach ( $read as $k => $v ) {
- if ( ! in_array( $v, $active ) ) {
- unset( $read[$k] );
- }
- }
- return $read;
- } // End remove_expired_read_messages()
-
- /**
- * add_toolbar_menu function.
- *
- * @access public
- * @since 1.0.0
- */
- public function add_toolbar_menu () {
- global $wp_admin_bar, $current_user;
-
- if ( $this->is_enabled ) {
- $total_unread = $this->count_messages( 'unread' );
- $messages = $this->get_messages( 'unread' );
-
- $class = 'message-count';
- if ( intval( $total_unread ) > 0 ) { $class .= ' unread'; } else { $class .= ' read'; }
-
- $menu_title = '<span class="' . $class . '">' . $total_unread . '</span>';
- } else {
- $menu_title = '<span class="message-count read off">' . __( 'Off', 'wootransmitter' ) . '</span>';
- }
-
- // Main Menu Item
- $wp_admin_bar->add_menu( array( 'id' => $this->token, 'title' => $menu_title, 'href' => '#' ) );
-
- // Begin Sub-Menu
- $wp_admin_bar->add_group( array( 'parent' => $this->token, 'id' => $this->token . '-messages' ) );
-
- // Mark as read URL.
- $redirection_url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
-
- $delimeter = '?';
- if ( stristr( $redirection_url, '?' ) ) { $delimeter = '&'; }
-
- if ( $this->is_enabled ) {
- // Add Messages
- // $k = key
- // $v = full data (including app data)
- // $i = message key
- // $j = message data
-
- if ( $total_unread > 0 ) {
- $length = 100;
-
- foreach ( $messages as $k => $v ) {
- if ( isset( $v->messages ) && count( $v->messages ) > 0 ) {
- $count = 0;
- foreach ( $v->messages as $i => $j ) {
- $count++;
-
- $class = '';
- if ( $count == $total_unread ) { $class = 'last'; }
-
- $mark_as_read = wp_nonce_url( admin_url( 'admin-ajax.php?action=' . $this->token . '-mark-as-read&message_id=' . $j->id ), $this->token . '-mark-as-read' );
-
- $excerpt = substr( $j->message, 0, $length );
- if ( strlen( $j->message ) > $length ) {
- $excerpt .= '...';
- }
-
- $wp_admin_bar->add_menu( array( 'parent' => $this->token . '-messages', 'id' => 'message-id-' . ( $j->id ), 'title' => '<a href="' . esc_url( $mark_as_read ) . '" class="mark-as-read" title="' . esc_attr__( 'Mark as Read', 'wootransmitter' ) . '">' . __( 'Mark as Read', 'wootransmitter' ) . '</a><span class="message-contents"><span class="title">' . $j->title . '</span><span class="excerpt">' . $excerpt . '</span><span class="application ' . sanitize_title_with_dashes( $v->application->name ) . '">' . $v->application->name . '</span></span>' ) );
-
- $wp_admin_bar->add_menu( array( 'parent' => 'message-id-' . ( $j->id ), 'id' => 'message-id-' . ( $j->id ) . '-full', 'title' => '<span class="message-contents"><span class="excerpt">' . nl2br( $j->message ) . '</span></span>' ) );
- }
- }
- }
- } else {
- $wp_admin_bar->add_menu( array( 'parent' => $this->token . '-messages', 'id' => 'no-unread-messages', 'title' => '<span class="title">' . __( 'You have no unread messages!', 'wootransmitter' ) . '</span>' ) );
- }
- } else {
- $wp_admin_bar->add_menu( array( 'parent' => $this->token . '-messages', 'id' => 'notifications-disabled', 'title' => '<span class="title">' . __( 'Notifications are disabled.', 'wootransmitter' ) . '</span>' ) );
- }
-
- if ( $this->is_enabled ) {
- $status_text = __( 'Disable notifications?', 'wootransmitter' );
- $status_action = 'disable';
- } else {
- $status_text = __( 'Enable notifications?', 'wootransmitter' );
- $status_action = 'enable';
- }
-
- $change_status_url = wp_nonce_url( admin_url( 'admin-ajax.php?action=' . $this->token . '-toggle-notification-status&status=' . $status_action ), $this->token . '-toggle-notification-status' );
-
- $wp_admin_bar->add_menu( array( 'parent' => $this->token . '-messages', 'id' => 'notificatiion-status', 'title' => '<span class="title"><a href="' . esc_url( $change_status_url ) . '">' . $status_text . '</a></span>' ) );
- } // End add_toolbar_menu()
-
- /**
- * add_app_key function.
- *
- * Add an app key into the array, to be processed with the other keys.
- * @param string $key The key to be added.
- * @param string $version The version number of the app.
- */
- public function add_app_key ( $key, $version ) {
- if ( $key != '' && $version != '' && ! in_array( $key, array_keys( $this->app_keys ) ) ) { $this->app_keys[$key] = $version; }
- } // End add_app_key()
-
- /**
- * remove_app_key function.
- *
- * Remove an app key from the array of app keys.
- * @param string $key The key to be removed.
- */
- public function remove_app_key ( $key ) {
- if ( $key != '' && in_array( $key, array_keys( $this->app_keys ) ) ) { unset( $this->app_keys[$key] ); }
- } // End add_app_key()
-
- /**
- * get_messages function.
- *
- * @access public
- * @since 1.0.0
- * @param $status ( all | unread )
- * @return array $data
- */
- public function get_messages ( $status = 'all' ) {
- $transient_key = $this->token . '-messages';
-
- if ( false === ( $data = get_transient( $transient_key ) ) ) {
- $response = $this->request( '/messages' );
-
- if ( isset( $response->error ) && ( $response->error != '' ) ) {
- $this->log_request_error( $response->error );
- } else {
- $data = $response;
- set_transient( $transient_key, $data, $this->transient_expire_time );
- }
- }
-
- // Display only unread, if $status = 'unread'.
- if ( $status == 'unread' ) {
- $read_messages = get_option( $this->token . '-read', array() );
- foreach ( $data as $k => $v ) {
- foreach ( $v->messages as $i => $j ) {
- if ( in_array( $j->id, $read_messages ) ) {
- unset( $data[$k]->messages[$i] );
- }
- }
- }
- }
-
- return $data;
- } // End get_messages()
-
- /**
- * get_message_ids function.
- *
- * @access public
- * @since 1.0.0
- * @param string $status ( all | unread )
- * @return array $ids
- */
- private function get_message_ids ( $status = 'all' ) {
- $ids = array();
- $data = $this->get_messages( $status );
-
- if ( is_array( $data ) && count( $data ) > 0 ) {
- foreach ( $data as $k => $v ) {
- if ( isset( $v->messages ) && count( $v->messages ) > 0 ) {
- foreach ( $v->messages as $i => $j ) {
- if ( isset( $j->id ) && ( $j->id != '' ) ) {
- $ids[] = $j->id;
- }
- }
- }
- }
- }
- return $ids;
- } // End get_message_ids()
-
- /**
- * count_messages function.
- *
- * @access public
- * @since 1.0.0
- * @param string $status ( all | unread )
- * @return int $total
- */
- private function count_messages ( $status = 'all' ) {
- $total = 0;
- $data = $this->get_messages( $status );
-
- if ( is_array( $data ) && count( $data ) > 0 ) {
- foreach ( $data as $k => $v ) {
- if ( isset( $v->messages ) && count( $v->messages ) > 0 ) {
- $total += count( $v->messages );
- }
- }
- }
- return $total;
- } // End count_messages()
-
- /**
- * request function.
- *
- * @access private
- * @since 1.0.0
- * @param string $endpoint (must include / prefix)
- * @param array $params
- * @return array $data
- */
- private function request ( $endpoint = '/messages', $params = array() ) {
- $params['user_key'] = $this->client_key;
- $params['applications'] = $this->app_keys;
-
- $response = wp_remote_post( $this->api_url . $endpoint, array(
- 'method' => 'POST',
- 'timeout' => 45,
- 'redirection' => 5,
- 'httpversion' => '1.0',
- 'blocking' => true,
- 'headers' => array(),
- 'body' => $params,
- 'cookies' => array()
- )
- );
-
- if( is_wp_error( $response ) ) {
- $data = new StdClass();
- $data->error = __( 'WooTransmitter Request Error', 'woothemes' );
- } else {
- $data = $response['body'];
- }
-
- $data = json_decode( $data );
-
- // Store errors in a transient, to be cleared on each request.
- if ( isset( $data->error ) && ( $data->error != '' ) ) {
- $this->log_request_error( $data->error );
- }
-
- return $data;
- } // End request()
-
- /**
- * log_request_error function.
- *
- * @access private
- * @since 1.0.0
- * @param string $error
- */
- private function log_request_error ( $error ) {
- set_transient( $this->token . '-request-error', $error );
- } // End log_request_error()
-
- /**
- * enqueue_styles function.
- *
- * @access public
- * @return void
- */
- public function enqueue_styles () {
- wp_register_style( $this->token, $this->assets_url . 'css/style.css', 'screen', '1.0.3' );
- wp_enqueue_style( $this->token );
- } // End enqueue_styles()
-
- /**
- * get_assets_url function.
- *
- * @description Get an "/assets/" URL from a specified file path.
- * @access public
- * @param string $file
- * @return void
- */
- private function get_assets_url ( $file ) {
- $url = '';
- $bits = explode( 'wp-content', $file );
- $url = trailingslashit( WP_CONTENT_URL . trailingslashit( dirname( $bits[1] ) ) . 'assets' );
- return $url;
- } // End get_assets_url()
-
- /**
- * clean_url_params function.
- *
- * @description Strip any trailing & or ? from the given string.
- * @access public
- * @param string $url
- * @return string $url
- */
- private function clean_url_params ( $url ) {
- return $url;
- } // End clean_url_params()
-} // End Class
-?>
6 classes/integrations/wootransmitter/wootransmitter.php
View
@@ -1,6 +0,0 @@
-<?php
-if ( ! class_exists( 'WooThemes_Transmitter' ) ) {
- require_once( 'classes/wootransmitter.class.php' );
-
- $GLOBALS['wootransmitter'] = new WooThemes_Transmitter( __FILE__ );
-}
BIN  languages/woocommerce-nl_NL.mo
View
Binary file not shown
15,439 languages/woocommerce-nl_NL.po
View
7,684 additions, 7,755 deletions not shown
8 readme.txt
View
@@ -4,7 +4,7 @@ Tags: ecommerce, e-commerce, commerce, woothemes, wordpress ecommerce, affiliate
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=paypal@woothemes.com&item_name=Donation+for+WooCommerce
Requires at least: 3.3
Tested up to: 3.4
-Stable tag: 1.5.4
+Stable tag: 1.5.5
WooCommerce is a powerful, extendable eCommerce plugin that helps you sell anything. Beautifully.
@@ -147,7 +147,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
== Changelog ==
-= 1.5.5 =
+= 1.5.5 - 09/05/2012 =
* Feature - New 'default' sorting order using menu_order, with drag and drop sorting (based on http://wordpress.org/extend/plugins/simple-page-ordering/)
* Feature - Settings now include colours for things like buttons and tabs.
* Feature - New integration section which allows other class-based integrations to be added.
@@ -156,7 +156,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* Feature - Collect shipping address even when not required option
* Feature - Stock display options - show no stock amount, low stock amount, or always show stock amount
* Feature - woocommerce_form_field select type
-* Feature - WooTransmitter integration (security notifications etc from Woo)
+* Feature - Add WooCommerce Products to Appearance->Menus
* Feature - Optional hide free products from Best Sellers Widget
* Tweak - Removed nonces from add to cart urls, this makes them easier to make use of; you can hardcode add to cart links or link to your add to cart link from other places without needing to use WC functions.
* Tweak - Cart.php display with more filters
@@ -176,6 +176,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* Tweak - New WC_Order Class Formatting Filters and Function for totals (thanks thenbrent)
* Tweak - Free shipping availability check to deal with min amount and coupon rules together
* Tweak - Shipping class added to product data panel instead of separate
+* Tweak - After getting a shipping quote, use the shipping address for taxes on the cart page
* Fix - Replacing use of deprecated function get_current_theme() with wp_get_theme()
* Fix - Body classes now correct for WordPress themes with non alphanumeric characters
* Fix - PayPal http_build_query &amp; -> & on some PHP 5.3 servers
@@ -185,6 +186,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* Fix - per product flat rate.
* Fix - Use term_id instead of term slug to get term link (allows numeric slugs for product categories)
* Fix - Replace spaces with + signs in download url after decode (allows + characters in email addresses for downloads)
+* Fix - Prevent setting download expire date to 1970-01-01 in rare cases
* Localization - Slovak translation by Dušan Beleščák
* Localization - Updated localisations
* Localization - Updated French translation by mediana (Ticket 1000 in GitHub, woohoo!)
39 templates/cart/totals.php
View
@@ -7,11 +7,11 @@
$available_methods = $woocommerce->shipping->get_available_shipping_methods();
?>
-<div class="cart_totals <?php if ( isset( $_SESSION['calculated_shipping'] ) && $_SESSION['calculated_shipping'] ) echo 'calculated_shipping'; ?>">
+<div class="cart_totals <?php if ( $woocommerce->customer->has_calculated_shipping() ) echo 'calculated_shipping'; ?>">
<?php do_action('woocommerce_before_cart_totals'); ?>
- <?php if ( ! $woocommerce->shipping->enabled || $available_methods || ! $woocommerce->customer->get_shipping_country() || empty( $_SESSION['calculated_shipping'] ) ) : ?>
+ <?php if ( ! $woocommerce->shipping->enabled || $available_methods || ! $woocommerce->customer->get_shipping_country() || ! $woocommerce->customer->has_calculated_shipping() ) : ?>
<h2><?php _e('Cart Totals', 'woocommerce'); ?></h2>
<table cellspacing="0" cellpadding="0">
@@ -98,7 +98,7 @@
<?php } ?>
<?php
- if (get_option('woocommerce_display_cart_taxes')=='yes' && $woocommerce->cart->get_cart_tax()) :
+ if ( get_option('woocommerce_display_cart_taxes') == 'yes' && $woocommerce->cart->get_cart_tax() ) :
$taxes = $woocommerce->cart->get_taxes();
@@ -111,7 +111,14 @@
if ($tax==0) continue;
?>
<tr class="tax-rate tax-rate-<?php echo $key; ?>">
- <th><?php if (get_option('woocommerce_prices_include_tax')=='yes') : _e('incl.', 'woocommerce'); endif; ?> <?php echo $woocommerce->cart->tax->get_rate_label( $key ); ?></th>
+ <th>
+ <?php
+ if ( get_option( 'woocommerce_display_totals_excluding_tax' ) == 'no' && get_option( 'woocommerce_prices_include_tax' ) == 'yes' ) {
+ _e( 'incl.', 'woocommerce' );
+ }
+ echo $woocommerce->cart->tax->get_rate_label( $key );
+ ?>
+ </th>
<td><?php echo woocommerce_price($tax); ?></td>
</tr>
<?php
@@ -132,7 +139,14 @@
if ($tax==0) continue;
?>
<tr class="tax-rate tax-rate-<?php echo $key; ?>">
- <th><?php if (get_option('woocommerce_prices_include_tax')=='yes') : _e('incl.', 'woocommerce'); endif; ?> <?php echo $woocommerce->cart->tax->get_rate_label( $key ); ?></th>
+ <th>
+ <?php
+ if ( get_option( 'woocommerce_display_totals_excluding_tax' ) == 'no' && get_option( 'woocommerce_prices_include_tax' ) == 'yes' ) {
+ _e( 'incl.', 'woocommerce' );
+ }
+ echo $woocommerce->cart->tax->get_rate_label( $key );
+ ?>
+ </th>
<td><?php echo woocommerce_price($tax); ?></td>
</tr>
<?php
@@ -149,7 +163,7 @@
<?php
endif;
- elseif (get_option('woocommerce_display_cart_taxes_if_zero')=='yes') :
+ elseif ( get_option('woocommerce_display_cart_taxes_if_zero') == 'yes' ) :
?>
<tr class="tax">
@@ -185,18 +199,13 @@
</tbody>
</table>
+
<p><small><?php
- if ($woocommerce->customer->is_customer_outside_base()) :
-
- $estimated_text = ' ' . sprintf(__('(taxes estimated for %s)', 'woocommerce'), $woocommerce->countries->estimated_for_prefix() . __($woocommerce->countries->countries[ $woocommerce->countries->get_base_country() ], 'woocommerce') );
-
- else :
-
- $estimated_text = '';
-
- endif;
+
+ $estimated_text = ( $woocommerce->customer->is_customer_outside_base() && ! $woocommerce->customer->has_calculated_shipping() ) ? sprintf( ' ' . __('(taxes estimated for %s)', 'woocommerce'), $woocommerce->countries->estimated_for_prefix() . __($woocommerce->countries->countries[ $woocommerce->countries->get_base_country() ], 'woocommerce') ) : '';
printf(__('Note: Shipping and taxes are estimated%s and will be updated during checkout based on your billing and shipping information.', 'woocommerce'), $estimated_text );
+
?></small></p>
<?php elseif( $woocommerce->cart->needs_shipping() ) : ?>
2  widgets/widget-login.php
View
@@ -94,7 +94,7 @@ function widget( $args, $instance ) {
<p><label for="user_pass"><?php _e('Password', 'woocommerce'); ?></label> <input name="pwd" class="input-text" id="user_pass" type="password" /></p>
- <p><input type="submit" class="submitbutton" name="wp-submit" id="wp-submit" value="<?php _e('Login &raquo;', 'woocommerce'); ?>" /> <a href="<?php echo wp_lostpassword_url(); ?>"><?php echo __('Lost password?', 'woocommerce'); ?></a></p>
+ <p><input type="submit" class="submitbutton" name="wp-submit" id="wp-submit" value="<?php _e('Login &rarr;', 'woocommerce'); ?>" /> <a href="<?php echo wp_lostpassword_url(); ?>"><?php echo __('Lost password?', 'woocommerce'); ?></a></p>
<div>
<input type="hidden" name="redirect_to" class="redirect_to" value="<?php echo $redirect_to; ?>" />
15 woocommerce.php
View
@@ -92,7 +92,6 @@ function __construct() {
add_action( 'init', array( &$this, 'init' ), 0 );
add_action( 'init', array( &$this, 'include_template_functions' ), 25 );
add_action( 'after_setup_theme', array( &$this, 'compatibility' ) );
- add_action( 'woocommerce_loaded', array( &$this, 'wootransmitter_init' ) );
// Loaded action
do_action( 'woocommerce_loaded' );
@@ -142,17 +141,6 @@ function includes() {
}
/**
- * Set up WooTransmitter Notifications
- **/
- function wootransmitter_init() {
- // Include Woo Transmitter
- include( 'classes/integrations/wootransmitter/wootransmitter.php' );
-
- // Add our app key
- $GLOBALS['wootransmitter']->add_app_key( '379cd69e-b1f4-4128-8b66-8f3688ad0fa1', esc_attr( $this->version ) );
- }
-
- /**
* Include required admin files
**/
function admin_includes() {
@@ -774,7 +762,7 @@ function init_taxonomy() {
'query_var' => true,
'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'comments', 'custom-fields', 'page-attributes' ),
'has_archive' => $base_slug,
- 'show_in_nav_menus' => false
+ 'show_in_nav_menus' => true
)
);
@@ -1356,7 +1344,6 @@ function cart_has_contents_cookie( $set ) {
function clear_product_transients( $post_id = 0 ) {
global $wpdb;
- delete_transient('wootransmitter-messages');
delete_transient('wc_products_onsale');
delete_transient('wc_hidden_product_ids');
delete_transient('wc_hidden_product_ids_search');

No commit comments for this range

Something went wrong with that request. Please try again.