Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Julian Jöris 2012-02-02 11:23:31 +01:00
commit 4061a625d9
13 changed files with 78 additions and 29 deletions

View File

@ -101,20 +101,20 @@ function woocommerce_custom_order_columns($column) {
echo woocommerce_price($order->order_total);
break;
case "order_date" :
if ( '0000-00-00 00:00:00' == $post->post_date ) :
$t_time = $h_time = __( 'Unpublished', 'woocommerce' );
$time_diff = 0;
else :
$t_time = get_the_time( __( 'Y/m/d g:i:s A', 'woocommerce' ) );
$m_time = $post->post_date;
$time = get_post_time( 'G', true, $post );
$t_time = get_the_time( __( 'Y/m/d g:i:s A', 'woocommerce' ), $post );
$time = strtotime($post->post_date);
$time_diff = time() - $time;
$time_diff = current_time('timestamp') - $time;
if ( $time_diff > 0 && $time_diff < 24*60*60 )
$h_time = sprintf( __( '%s ago', 'woocommerce' ), human_time_diff( $time ) );
else
$h_time = mysql2date( __( 'Y/m/d', 'woocommerce' ), $m_time );
$h_time = get_the_time( __( 'Y/m/d', 'woocommerce' ), $post );
endif;
echo '<abbr title="' . $t_time . '">' . apply_filters( 'post_date_column_time', $h_time, $post ) . '</abbr>';

View File

@ -1032,7 +1032,7 @@ function woocommerce_settings() {
flush_rewrite_rules( false );
if (woocommerce_get_page_id('shop')) :
if (woocommerce_get_page_id('shop')>0) :
$install_complete = true;
else :
$show_page_installer = true;

View File

@ -939,7 +939,7 @@ class order_item_meta {
/** Depreciated */
class woocommerce_order extends WC_Order {
public function __construct( $id = '' ) {
_deprecated_function( 'woocommerce_order', '1.4', 'WC_Order()' );
// _deprecated_function( 'woocommerce_order', '1.4', 'WC_Order()' ); Depreciated, but leaving uncommented until all gateways are updated
parent::__construct( $id );
}
}

View File

@ -728,7 +728,19 @@ class WC_Product {
if ($attribute['is_taxonomy']) :
// Get string with terms
return get_the_term_list( $this->id, $attribute['name'], ''. '', ', ' );
$terms = get_the_terms( $this->id, $attribute['name'] );
if ( $terms && ! is_wp_error( $terms ) ) :
$terms_array = array();
foreach ( $terms as $term ) :
$terms_array[] = $term->name;
endforeach;
return implode( ', ', $terms_array );
endif;
else :

View File

@ -233,6 +233,10 @@ class WC_Tax {
return $this->find_rates( $country, $state, '', $tax_class );
}
/** Depreciated before new tax system - added to stop errors before people upgrade */
function get_shipping_tax_rate() {
_deprecated_function( 'get_shipping_tax_rate', '1.4' );
}
/**
* Gets an array of matching shipping tax rates for a given class
@ -532,6 +536,5 @@ class WC_Tax {
class woocommerce_tax extends WC_Tax {
public function __construct() {
_deprecated_function( 'woocommerce_tax', '1.4', 'WC_Tax()' );
parent::__construct();
}
}

View File

@ -116,7 +116,7 @@ class WC_Payment_Gateway extends WC_Settings_API {
/** Depreciated */
class woocommerce_payment_gateway extends WC_Payment_Gateway {
public function __construct() {
_deprecated_function( 'woocommerce_payment_gateway', '1.4', 'WC_Payment_Gateway()' );
// _deprecated_function( 'woocommerce_payment_gateway', '1.4', 'WC_Payment_Gateway()' ); Depreciated, but leaving uncommented until all gateways are updated
parent::__construct();
}
}

View File

@ -4,7 +4,7 @@ Tags: ecommerce, e-commerce, commerce, woothemes, wordpress ecommerce, store, sh
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.3
Stable tag: 1.4
Stable tag: 1.4.1
WooCommerce is an open-source e-commerce toolkit that helps you sell anything. Beautifully.
@ -82,7 +82,18 @@ Yes you can! Join in on our GitHub repository :) https://github.com/woothemes/wo
== Changelog ==
= 1.4 =
= 1.4.2 =
* Uninstall fix
= 1.4.1 - 01/02/2012 =
* Depreciated tax class fix
* Logout error fix
* get_shipping_tax_rate deprecated to stop errors
* get_attribute returns non-linked terms
* First time install fix
* Added back version constant to stop 3rd party themes breaking
= 1.4 - 01/02/2012 =
* Improved default theme
* Support for multiple and stacked (compound) taxes
* Locale options for country address formatting and checkout fields

View File

@ -26,7 +26,7 @@ if (!isset($woocommerce_loop['columns']) || !$woocommerce_loop['columns']) $wooc
$woocommerce_loop['loop']++;
?>
<li class="product <?php if ($woocommerce_loop['loop']%$woocommerce_loop['columns']==0) echo 'last'; if (($woocommerce_loop['loop']-1)%$woocommerce_loop['columns']==0) echo 'first'; ?>">
<li class="product <?php if ($woocommerce_loop['loop']%$woocommerce_loop['columns']==0) echo ' last'; if (($woocommerce_loop['loop']-1)%$woocommerce_loop['columns']==0) echo ' first'; ?>">
<?php do_action('woocommerce_before_shop_loop_item'); ?>

View File

@ -32,7 +32,8 @@ if ( (!is_home() && !is_front_page() && !(is_post_type_archive() && get_option('
echo $before . single_cat_title('', false) . $after;
elseif ( is_tax('product_cat') ) :
echo $prepend;
$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
$parents = array();
@ -52,7 +53,7 @@ if ( (!is_home() && !is_front_page() && !(is_post_type_archive() && get_option('
endif;
$queried_object = $wp_query->get_queried_object();
echo $prepend . $before . $queried_object->name . $after;
echo $before . $queried_object->name . $after;
elseif ( is_tax('product_tag') ) :

View File

@ -19,18 +19,22 @@ remove_role( 'shop_manager' );
// Capabilities
$wp_roles->remove_cap( 'administrator', 'manage_woocommerce' );
$wp_roles->remove_cap( 'administrator', 'manage_woocommerce_orders' );
$wp_roles->remove_cap( 'administrator', 'manage_woocommerce_coupons' );
$wp_roles->remove_cap( 'administrator', 'manage_woocommerce_products' );
$wp_roles->remove_cap( 'administrator', 'view_woocommerce_reports' );
// Pages
wp_delete_post( woocommerce_get_page_id('shop'), true );
wp_delete_post( woocommerce_get_page_id('cart'), true );
wp_delete_post( woocommerce_get_page_id('checkout'), true );
wp_delete_post( woocommerce_get_page_id('order_tracking'), true );
wp_delete_post( woocommerce_get_page_id('myaccount'), true );
wp_delete_post( woocommerce_get_page_id('edit_address'), true );
wp_delete_post( woocommerce_get_page_id('view_order'), true );
wp_delete_post( woocommerce_get_page_id('change_password'), true );
wp_delete_post( woocommerce_get_page_id('pay'), true );
wp_delete_post( woocommerce_get_page_id('thanks'), true );
wp_delete_post( get_option('woocommerce_shop_page_id'), true );
wp_delete_post( get_option('woocommerce_cart_page_id'), true );
wp_delete_post( get_option('woocommerce_checkout_page_id'), true );
wp_delete_post( get_option('woocommerce_order_tracking_page_id'), true );
wp_delete_post( get_option('woocommerce_myaccount_page_id'), true );
wp_delete_post( get_option('woocommerce_edit_address_page_id'), true );
wp_delete_post( get_option('woocommerce_view_order_page_id'), true );
wp_delete_post( get_option('woocommerce_change_password_page_id'), true );
wp_delete_post( get_option('woocommerce_pay_page_id'), true );
wp_delete_post( get_option('woocommerce_thanks_page_id'), true );
// Tables
$wpdb->query("DROP TABLE IF EXISTS ".$wpdb->prefix."woocommerce_attribute_taxonomies");

View File

@ -34,6 +34,21 @@ if (!function_exists('woocommerce_get_page_id')) {
}
}
/**
* WooCommerce clear cart
*
* Clears the cart session when called
**/
if (!function_exists('woocommerce_empty_cart')) {
function woocommerce_empty_cart() {
global $woocommerce;
if (!isset($woocommerce->cart) || $woocommerce->cart == '' ) $woocommerce->cart = new WC_Cart();
$woocommerce->cart->empty_cart();
}
}
/**
* WooCommerce conditionals
*

View File

@ -106,8 +106,8 @@ add_filter( 'wp_list_pages', 'woocommerce_list_pages' );
add_filter( 'wp_nav_menu_items', 'woocommerce_nav_menu_items', 10, 2 );
/* Clear the cart */
if (get_option('woocommerce_clear_cart_on_logout')=='yes')
add_action( 'wp_logout', array(&$woocommerce->cart, 'empty_cart') );
if (get_option('woocommerce_clear_cart_on_logout')=='yes') add_action( 'wp_logout', 'woocommerce_empty_cart' );
add_action( 'wp', 'woocommerce_clear_cart_after_payment' );
/* Catalog sorting/ordering */

View File

@ -3,7 +3,7 @@
Plugin Name: WooCommerce
Plugin URI: http://www.woothemes.com/woocommerce/
Description: An e-commerce toolkit that helps you sell anything. Beautifully.
Version: 1.4
Version: 1.4.1
Author: WooThemes
Author URI: http://woothemes.com
Requires at least: 3.1
@ -29,7 +29,7 @@ class Woocommerce {
/** Version ***************************************************************/
var $version = '1.4';
var $version = '1.4.1';
/** URLS ******************************************************************/
@ -79,6 +79,9 @@ class Woocommerce {
// Start a PHP session
if (!session_id()) session_start();
// Define version constant
define( 'WOOCOMMERCE_VERSION', $this->version );
// Set up localisation
$this->load_plugin_textdomain();