This commit is contained in:
Mikael Jorhult 2012-12-29 11:36:34 +01:00
commit 89fa49403f
115 changed files with 22287 additions and 19244 deletions

View File

@ -17,7 +17,7 @@ __note__ GitHub is for bug reports and contributions only - if you have a suppor
* Fork the repository on GitHub
* Make the changes to your forked repository
* Ensure you stick to the [WordPress Coding Standards](http://codex.wordpress.org/WordPress_Coding_Standards)
* **Ensure you stick to the [WordPress Coding Standards](http://codex.wordpress.org/WordPress_Coding_Standards)**
* Ensure you use LF line endings - no crazy windows line endings :)
* When committing, reference your issue (#1234) and include a note about the fix
* Push the changes to your fork and submit a pull request on the master WooCommerce repository
@ -29,4 +29,4 @@ At this point you're waiting on us to merge your pull request. We'll review all
* [General GitHub documentation](http://help.github.com/)
* [GitHub pull request documentation](http://help.github.com/send-pull-requests/)
* [WooCommerce Docs](http://wcdocs.woothemes.com/)
* [WooThemes Support](http://support.woothemes.com)
* [WooThemes Support](http://support.woothemes.com)

View File

@ -149,28 +149,32 @@ if ( class_exists( 'WP_Importer' ) ) {
$postcodes = explode( ';', $postcode );
$postcodes = array_map( 'strtoupper', array_map( 'woocommerce_clean', $postcodes ) );
foreach( $postcodes as $postcode ) {
$wpdb->insert(
$wpdb->prefix . "woocommerce_tax_rate_locations",
array(
'location_code' => $postcode,
'tax_rate_id' => $tax_rate_id,
'location_type' => 'postcode',
)
);
if ( ! empty( $postcode ) && $postcode != '*' ) {
$wpdb->insert(
$wpdb->prefix . "woocommerce_tax_rate_locations",
array(
'location_code' => $postcode,
'tax_rate_id' => $tax_rate_id,
'location_type' => 'postcode',
)
);
}
}
$city = woocommerce_clean( $city );
$cities = explode( ';', $city );
$cities = array_map( 'strtoupper', array_map( 'woocommerce_clean', $cities ) );
foreach( $cities as $city ) {
$wpdb->insert(
$wpdb->prefix . "woocommerce_tax_rate_locations",
array(
'location_code' => $city,
'tax_rate_id' => $tax_rate_id,
'location_type' => 'city',
)
);
if ( ! empty( $city ) && $city != '*' ) {
$wpdb->insert(
$wpdb->prefix . "woocommerce_tax_rate_locations",
array(
'location_code' => $city,
'tax_rate_id' => $tax_rate_id,
'location_type' => 'city',
)
);
}
}
$loop ++;

View File

@ -243,11 +243,14 @@ function woocommerce_custom_product_columns( $column ) {
echo implode( ', ', $termlist );
}
break;
case "featured" :
$url = wp_nonce_url( admin_url('admin-ajax.php?action=woocommerce-feature-product&product_id=' . $post->ID), 'woocommerce-feature-product' );
echo '<a href="'.$url.'" title="'.__( 'Change', 'woocommerce' ) .'">';
if ($the_product->is_featured()) echo '<a href="'.$url.'"><img src="'.$woocommerce->plugin_url().'/assets/images/featured.png" alt="yes" height="14" width="14" />';
else echo '<img src="'.$woocommerce->plugin_url().'/assets/images/featured-off.png" alt="no" height="14" width="14" />';
case 'featured':
$url = wp_nonce_url( admin_url( 'admin-ajax.php?action=woocommerce-feature-product&product_id=' . $post->ID ), 'woocommerce-feature-product' );
echo '<a href="' . $url . '" title="'. __( 'Toggle featured', 'woocommerce' ) . '">';
if ( $the_product->is_featured() ) {
echo '<img src="' . $woocommerce->plugin_url() . '/assets/images/featured.png" alt="'. __( 'yes', 'woocommerce' ) . '" height="14" width="14" />';
} else {
echo '<img src="' . $woocommerce->plugin_url() . '/assets/images/featured-off.png" alt="'. __( 'no', 'woocommerce' ) . '" height="14" width="14" />';
}
echo '</a>';
break;
case "is_in_stock" :

View File

@ -67,7 +67,9 @@ function woocommerce_order_notes_meta_box() {
</div>
<script type="text/javascript">
jQuery('a.add_note').click(function(){
jQuery('#woocommerce-order-notes')
.on( 'click', 'a.add_note', function() {
if (!jQuery('textarea#add_order_note').val()) return;
@ -91,9 +93,9 @@ function woocommerce_order_notes_meta_box() {
return false;
});
})
jQuery('a.delete_note').live('click', function(){
.on( 'click', 'a.delete_note', function() {
var note = jQuery(this).closest('li.note');

View File

@ -60,7 +60,7 @@ function woocommerce_product_images_box() {
var $image_gallery_ids = $('#product_image_gallery');
var $product_images = $('#product_images_container ul.product_images');
jQuery('.add_product_images a').live('click', function( event ){
jQuery('.add_product_images').on( 'click', 'a', function( event ) {
var $el = $(this);
var attachment_ids = $image_gallery_ids.val();

View File

@ -12,9 +12,11 @@
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
$localisation_setting = ( defined('WPLANG') ) ? array(
global $woocommerce;
$localisation_setting = defined( 'WPLANG' ) && file_exists( $woocommerce->plugin_path() . '/i18n/languages/informal/woocommerce-' . WPLANG . '.mo' ) ? array(
'title' => __( 'Localisation', 'woocommerce' ),
'desc' => __( 'Use informal localisation file if it exists', 'woocommerce' ),
'desc' => sprintf( __( 'Use informal localisation for %s', 'woocommerce' ), WPLANG ),
'id' => 'woocommerce_informal_localisation_type',
'type' => 'checkbox',
'default' => 'no',

View File

@ -66,6 +66,7 @@ function woocommerce_update_options( $options ) {
case 'number':
case "select" :
case "color" :
case 'password' :
case "single_select_page" :
case "single_select_country" :
case 'radio' :

View File

@ -169,7 +169,7 @@ function woocommerce_tax_rates_setting() {
jQuery(document).bind('keyup keydown', function(e){shifted = e.shiftKey} );
jQuery('.wc_tax_rates input').live( 'click focus', function( e ) {
jQuery('.wc_tax_rates').on( 'click focus', 'input', function( e ) {
if ( ! shifted ) {
jQuery('.wc_tax_rates tr').removeClass('current');
}

View File

@ -462,19 +462,22 @@ add_action( 'admin_enqueue_scripts', 'woocommerce_admin_scripts' );
* @return void
*/
function woocommerce_admin_css() {
global $woocommerce, $typenow, $post;
global $woocommerce, $typenow, $post, $wp_scripts;
if ($typenow=='post' && isset($_GET['post']) && !empty($_GET['post'])) :
if ( $typenow == 'post' && ! empty( $_GET['post'] ) ) {
$typenow = $post->post_type;
elseif (empty($typenow) && !empty($_GET['post'])) :
$post = get_post($_GET['post']);
} elseif ( empty( $typenow ) && ! empty( $_GET['post'] ) ) {
$post = get_post( $_GET['post'] );
$typenow = $post->post_type;
endif;
}
if ( $typenow == '' || $typenow=="product" || $typenow=="shop_order" || $typenow=="shop_coupon" ) :
if ( $typenow == '' || $typenow == "product" || $typenow == "shop_order" || $typenow == "shop_coupon" ) {
wp_enqueue_style( 'woocommerce_admin_styles', $woocommerce->plugin_url() . '/assets/css/admin.css' );
wp_enqueue_style( 'jquery-ui-style', (is_ssl()) ? 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css' : 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css' );
endif;
$jquery_version = isset( $wp_scripts->registered['jquery-ui-core']->ver ) ? $wp_scripts->registered['jquery-ui-core']->ver : '1.9.2';
wp_enqueue_style( 'jquery-ui-style', '//ajax.googleapis.com/ajax/libs/jqueryui/' . $jquery_version . '/themes/smoothness/jquery-ui.css' );
}
wp_enqueue_style('farbtastic');

View File

@ -36,7 +36,9 @@ function do_install_woocommerce() {
wp_clear_scheduled_hook( 'woocommerce_scheduled_sales' );
wp_clear_scheduled_hook( 'woocommerce_cancel_unpaid_orders' );
wp_schedule_event( strtotime( 'tomorrow' ), 'daily', 'woocommerce_scheduled_sales');
$ve = get_option('gmt_offset') > 0 ? '+' : '-';
wp_schedule_event( strtotime( 'tomorrow ' . $ve . get_option('gmt_offset') . ' HOURS' ), 'daily', 'woocommerce_scheduled_sales');
$held_duration = get_option( 'woocommerce_hold_stock_minutes', null );

View File

@ -637,6 +637,7 @@ function woocommerce_admin_fields( $options ) {
case 'email':
case 'number':
case 'color' :
case 'password' :
$type = $value['type'];
$class = '';

View File

@ -47,7 +47,7 @@ function woocommerce_add_category_fields() {
// Uploading files
var file_frame;
jQuery('.upload_image_button').live('click', function( event ){
jQuery(document).on( 'click', '.upload_image_button', function( event ){
event.preventDefault();
@ -79,7 +79,7 @@ function woocommerce_add_category_fields() {
file_frame.open();
});
jQuery('.remove_image_button').live('click', function(){
jQuery(document).on( 'click', '.remove_image_button', function( event ){
jQuery('#product_cat_thumbnail img').attr('src', '<?php echo woocommerce_placeholder_img_src(); ?>');
jQuery('#product_cat_thumbnail_id').val('');
jQuery('.remove_image_button').hide();
@ -139,7 +139,7 @@ function woocommerce_edit_category_fields( $term, $taxonomy ) {
// Uploading files
var file_frame;
jQuery('.upload_image_button').live('click', function( event ){
jQuery(document).on( 'click', '.upload_image_button', function( event ){
event.preventDefault();
@ -171,7 +171,7 @@ function woocommerce_edit_category_fields( $term, $taxonomy ) {
file_frame.open();
});
jQuery('.remove_image_button').live('click', function(){
jQuery(document).on( 'click', '.remove_image_button', function( event ){
jQuery('#product_cat_thumbnail img').attr('src', '<?php echo woocommerce_placeholder_img_src(); ?>');
jQuery('#product_cat_thumbnail_id').val('');
jQuery('.remove_image_button').hide();

File diff suppressed because one or more lines are too long

View File

@ -79,7 +79,7 @@ p.demo_store {
margin-top: 10px;
}
#breadcrumb {
.wc-breadcrumb{
.clearfix();
margin: 0 0 1em;
padding: 0;

View File

@ -296,7 +296,7 @@ jQuery( function($){
$('span.inline_total').closest('.totals_group').find('input').change();
// Calculate totals
$('button.calc_line_taxes').live('click', function(){
$('button.calc_line_taxes').click(function(){
// Block write panel
$('.woocommerce_order_items_wrapper').block({ message: null, overlayCSS: { background: '#fff url(' + woocommerce_writepanel_params.plugin_url + '/assets/images/ajax-loader.gif) no-repeat center', opacity: 0.6 } });
@ -378,7 +378,7 @@ jQuery( function($){
});
$('button.calc_totals').live('click', function(){
$('button.calc_totals').click( function(){
// Block write panel
$('#woocommerce-order-totals').block({ message: null, overlayCSS: { background: '#fff url(' + woocommerce_writepanel_params.plugin_url + '/assets/images/ajax-loader.gif) no-repeat center', opacity: 0.6 } });
@ -542,7 +542,7 @@ jQuery( function($){
});
// Add some meta to a line item
$('#order_items_list button.add_order_item_meta').live('click', function(){
$('#order_items_list').on('click', 'button.add_order_item_meta', function(){
var $button = $(this);
var $item = $button.closest('tr.item');
@ -568,7 +568,7 @@ jQuery( function($){
return false;
});
$('#order_items_list button.remove_order_item_meta').live('click', function(){
$('#order_items_list').on('click', 'button.remove_order_item_meta', function(){
var answer = confirm( woocommerce_writepanel_params.remove_item_meta )
if ( answer ) {
var $row = $(this).closest('tr');
@ -713,7 +713,7 @@ jQuery( function($){
} );
$('button.load_customer_billing').live('click', function(){
$('button.load_customer_billing').click(function(){
var answer = confirm(woocommerce_writepanel_params.load_billing);
if (answer){
@ -763,7 +763,7 @@ jQuery( function($){
return false;
});
$('button.load_customer_shipping').live('click', function(){
$('button.load_customer_shipping').click(function(){
var answer = confirm(woocommerce_writepanel_params.load_shipping);
if (answer){
@ -811,7 +811,7 @@ jQuery( function($){
return false;
});
$('button.billing-same-as-shipping').live('click', function(){
$('button.billing-same-as-shipping').click(function(){
var answer = confirm(woocommerce_writepanel_params.copy_billing);
if (answer){
$('input#_shipping_first_name').val( $('input#_billing_first_name').val() );
@ -828,7 +828,7 @@ jQuery( function($){
});
// Add a tax row
$('a.add_tax_row').live('click', function(){
$('a.add_tax_row').click(function(){
var data = {
order_id: woocommerce_writepanel_params.post_id,
@ -851,7 +851,7 @@ jQuery( function($){
});
// Delete a tax row
$('a.delete_tax_row').live('click', function(){
$('a.delete_tax_row').click(function(){
$tax_row = $(this).closest('.tax_row');
var tax_row_id = $tax_row.attr( 'data-order_item_id' )
@ -1282,7 +1282,7 @@ jQuery( function($){
// Uploading files
var downloadable_file_frame;
jQuery('.upload_file_button').live('click', function( event ){
jQuery(document).on( 'click', '.upload_file_button', function( event ){
var $el = $(this);
var $file_path_field = $el.parent().find('.file_paths');

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
jQuery(document).ready(function($) {
// Ajax add to cart
$('.add_to_cart_button').live('click', function() {
$(document).on( 'click', '.add_to_cart_button', function() {
// AJAX add to cart request
var $thisbutton = $(this);

View File

@ -1 +1 @@
jQuery(document).ready(function(e){e(".add_to_cart_button").live("click",function(){var t=e(this);if(t.is(".product_type_simple, .product_type_downloadable, .product_type_virtual")){if(!t.attr("data-product_id"))return!0;t.removeClass("added");t.addClass("loading");var n={action:"woocommerce_add_to_cart",product_id:t.attr("data-product_id"),security:woocommerce_params.add_to_cart_nonce};e("body").trigger("adding_to_cart");e.post(woocommerce_params.ajax_url,n,function(r){var i=window.location.toString();i=i.replace("add-to-cart","added-to-cart");t.removeClass("loading");n=e.parseJSON(r);if(n.error&&n.product_url){window.location=n.product_url;return}fragments=n;fragments&&e.each(fragments,function(t,n){e(t).addClass("updating")});e(".widget_shopping_cart, .shop_table.cart, .updating, .cart_totals").fadeTo("400","0.6").block({message:null,overlayCSS:{background:"transparent url("+woocommerce_params.ajax_loader_url+") no-repeat center",backgroundSize:"16px 16px",opacity:.6}});t.parent().find(".added_to_cart").size()==0&&t.addClass("added").after(' <a href="'+woocommerce_params.cart_url+'" class="added_to_cart" title="'+woocommerce_params.i18n_view_cart+'">'+woocommerce_params.i18n_view_cart+"</a>");if(e(".widget_shopping_cart").size()>0)e(".widget_shopping_cart:eq(0)").load(i+" .widget_shopping_cart:eq(0) > *",function(){fragments&&e.each(fragments,function(t,n){e(t).replaceWith(n)});e(".widget_shopping_cart, .updating").stop(!0).css("opacity","1").unblock();e("body").trigger("cart_widget_refreshed")});else{fragments&&e.each(fragments,function(t,n){e(t).replaceWith(n)});e(".widget_shopping_cart, .updating").stop(!0).css("opacity","1").unblock()}e(".shop_table.cart").load(i+" .shop_table.cart:eq(0) > *",function(){e("div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)").addClass("buttons_added").append('<input type="button" value="+" id="add1" class="plus" />').prepend('<input type="button" value="-" id="minus1" class="minus" />');e(".shop_table.cart").stop(!0).css("opacity","1").unblock();e("body").trigger("cart_page_refreshed")});e(".cart_totals").load(i+" .cart_totals:eq(0) > *",function(){e(".cart_totals").stop(!0).css("opacity","1").unblock()});e("body").trigger("added_to_cart")});return!1}return!0})});
jQuery(document).ready(function(e){e(document).on("click",".add_to_cart_button",function(){var t=e(this);if(t.is(".product_type_simple, .product_type_downloadable, .product_type_virtual")){if(!t.attr("data-product_id"))return!0;t.removeClass("added");t.addClass("loading");var n={action:"woocommerce_add_to_cart",product_id:t.attr("data-product_id"),security:woocommerce_params.add_to_cart_nonce};e("body").trigger("adding_to_cart");e.post(woocommerce_params.ajax_url,n,function(r){var i=window.location.toString();i=i.replace("add-to-cart","added-to-cart");t.removeClass("loading");n=e.parseJSON(r);if(n.error&&n.product_url){window.location=n.product_url;return}fragments=n;fragments&&e.each(fragments,function(t,n){e(t).addClass("updating")});e(".widget_shopping_cart, .shop_table.cart, .updating, .cart_totals").fadeTo("400","0.6").block({message:null,overlayCSS:{background:"transparent url("+woocommerce_params.ajax_loader_url+") no-repeat center",backgroundSize:"16px 16px",opacity:.6}});t.parent().find(".added_to_cart").size()==0&&t.addClass("added").after(' <a href="'+woocommerce_params.cart_url+'" class="added_to_cart" title="'+woocommerce_params.i18n_view_cart+'">'+woocommerce_params.i18n_view_cart+"</a>");if(e(".widget_shopping_cart").size()>0)e(".widget_shopping_cart:eq(0)").load(i+" .widget_shopping_cart:eq(0) > *",function(){fragments&&e.each(fragments,function(t,n){e(t).replaceWith(n)});e(".widget_shopping_cart, .updating").stop(!0).css("opacity","1").unblock();e("body").trigger("cart_widget_refreshed")});else{fragments&&e.each(fragments,function(t,n){e(t).replaceWith(n)});e(".widget_shopping_cart, .updating").stop(!0).css("opacity","1").unblock()}e(".shop_table.cart").load(i+" .shop_table.cart:eq(0) > *",function(){e("div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)").addClass("buttons_added").append('<input type="button" value="+" id="add1" class="plus" />').prepend('<input type="button" value="-" id="minus1" class="minus" />');e(".shop_table.cart").stop(!0).css("opacity","1").unblock();e("body").trigger("cart_page_refreshed")});e(".cart_totals").load(i+" .cart_totals:eq(0) > *",function(){e(".cart_totals").stop(!0).css("opacity","1").unblock()});e("body").trigger("added_to_cart")});return!1}return!0})});

View File

@ -1,33 +1,28 @@
jQuery(document).ready(function($) {
// Shipping calculator
$('.shipping-calculator-form').hide();
$('.shipping-calculator-button').click(function() {
$(document).on( 'click', '.shipping-calculator-button', function() {
$('.shipping-calculator-form').slideToggle('slow');
return false;
});
// Shipping calculator method selection
$('select#shipping_method, input[name=shipping_method]').live('change', function() {
}).on( 'change', 'select#shipping_method, input[name=shipping_method]', function() {
var method = $(this).val();
$('div.cart_totals').block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_params.ajax_loader_url + ') no-repeat center', backgroundSize: '16px 16px', opacity: 0.6}});
var data = {
action: 'woocommerce_update_shipping_method',
security: woocommerce_params.update_shipping_method_nonce,
shipping_method: method
};
$.post( woocommerce_params.ajax_url, data, function(response) {
$('div.cart_totals').replaceWith( response );
$('body').trigger('updated_shipping_method');
});
});
})
$('.shipping-calculator-form').hide();
});

View File

@ -1 +1 @@
jQuery(document).ready(function(e){e(".shipping-calculator-form").hide();e(".shipping-calculator-button").click(function(){e(".shipping-calculator-form").slideToggle("slow");return!1});e("select#shipping_method, input[name=shipping_method]").live("change",function(){var t=e(this).val();e("div.cart_totals").block({message:null,overlayCSS:{background:"#fff url("+woocommerce_params.ajax_loader_url+") no-repeat center",backgroundSize:"16px 16px",opacity:.6}});var n={action:"woocommerce_update_shipping_method",security:woocommerce_params.update_shipping_method_nonce,shipping_method:t};e.post(woocommerce_params.ajax_url,n,function(t){e("div.cart_totals").replaceWith(t);e("body").trigger("updated_shipping_method")})})});
jQuery(document).ready(function(e){e(document).on("click",".shipping-calculator-button",function(){e(".shipping-calculator-form").slideToggle("slow");return!1}).on("change","select#shipping_method, input[name=shipping_method]",function(){var t=e(this).val();e("div.cart_totals").block({message:null,overlayCSS:{background:"#fff url("+woocommerce_params.ajax_loader_url+") no-repeat center",backgroundSize:"16px 16px",opacity:.6}});var n={action:"woocommerce_update_shipping_method",security:woocommerce_params.update_shipping_method_nonce,shipping_method:t};e.post(woocommerce_params.ajax_url,n,function(t){e("div.cart_totals").replaceWith(t);e("body").trigger("updated_shipping_method")})});e(".shipping-calculator-form").hide()});

View File

@ -102,7 +102,7 @@ jQuery(document).ready(function($) {
}
}).change();
if (woocommerce_params.option_guest_checkout=='yes') {
if ( woocommerce_params.option_guest_checkout == 'yes' ) {
$('div.create-account').hide();
@ -115,7 +115,17 @@ jQuery(document).ready(function($) {
}
$('.payment_methods input.input-radio').live('click', function(){
// Used for input change events below
function input_changed() {
dirtyInput = false;
$('body').trigger('update_checkout');
}
$('form.checkout')
/* Payment option selection */
.on( 'click', '.payment_methods input.input-radio', function() {
if ( $('.payment_methods input.input-radio').length > 1 ) {
$('div.payment_box').filter(':visible').slideUp(250);
if ($(this).is(':checked')) {
@ -124,73 +134,36 @@ jQuery(document).ready(function($) {
} else {
$('div.payment_box').show();
}
});
})
$('#order_review input[name=payment_method]:checked').click();
/* Update totals */
// Inputs/selects which update totals instantly
$('select#shipping_method, input[name=shipping_method], #shiptobilling input, .update_totals_on_change select').live('change', function(){
.on( 'change', 'select#shipping_method, input[name=shipping_method], #shiptobilling input, .update_totals_on_change select', function(){
clearTimeout( updateTimer );
$('body').trigger('update_checkout');
});
})
// Inputs which update totals on change
function input_changed() {
dirtyInput = false;
$('body').trigger('update_checkout');
}
$('.update_totals_on_change input').live('change', function(){
.on( 'change', '.update_totals_on_change input', function(){
if ( dirtyInput ) {
clearTimeout( updateTimer );
$('body').trigger('update_checkout');
}
});
$('.update_totals_on_change input.input-text').live('keydown', function( e ){
})
.on( 'keydown', '.update_totals_on_change input.input-text', function( e ){
var code = e.keyCode || e.which;
if ( code == '9' )
return;
dirtyInput = true;
clearTimeout( updateTimer );
updateTimer = setTimeout( input_changed, '1000' );
});
/* AJAX Coupon Form Submission */
$('form.checkout_coupon').submit( function() {
var $form = $(this);
if ( $form.is('.processing') ) return false;
$form.addClass('processing').block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_params.ajax_loader_url + ') no-repeat center', backgroundSize: '16px 16px', opacity: 0.6}});
var data = {
action: 'woocommerce_apply_coupon',
security: woocommerce_params.apply_coupon_nonce,
coupon_code: $form.find('input[name=coupon_code]').val()
};
$.ajax({
type: 'POST',
url: woocommerce_params.ajax_url,
data: data,
success: function( code ) {
$('.woocommerce_error, .woocommerce_message').remove();
$form.removeClass('processing').unblock();
if ( code ) {
$form.before( code );
$form.slideUp();
$('body').trigger('update_checkout');
}
},
dataType: "html"
});
return false;
});
})
/* Inline validation */
$('form.checkout').on( 'blur change', '.input-text, select', function() {
.on( 'blur change', '.input-text, select', function() {
var $this = $(this);
var $parent = $this.closest('.form-row');
var validated = true;
@ -218,10 +191,11 @@ jQuery(document).ready(function($) {
if ( validated ) {
$parent.removeClass( 'wc-error wc-error-required-field' ).addClass( 'wc-validated' );
}
} );
} )
/* AJAX Form Submission */
$('form.checkout').submit( function() {
.submit( function() {
clearTimeout( updateTimer );
var $form = $(this);
@ -288,6 +262,43 @@ jQuery(document).ready(function($) {
}
return false;
})
// Trigger initial click
.find('#order_review input[name=payment_method]:checked').click();
/* AJAX Coupon Form Submission */
$('form.checkout_coupon').submit( function() {
var $form = $(this);
if ( $form.is('.processing') ) return false;
$form.addClass('processing').block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_params.ajax_loader_url + ') no-repeat center', backgroundSize: '16px 16px', opacity: 0.6}});
var data = {
action: 'woocommerce_apply_coupon',
security: woocommerce_params.apply_coupon_nonce,
coupon_code: $form.find('input[name=coupon_code]').val()
};
$.ajax({
type: 'POST',
url: woocommerce_params.ajax_url,
data: data,
success: function( code ) {
$('.woocommerce_error, .woocommerce_message').remove();
$form.removeClass('processing').unblock();
if ( code ) {
$form.before( code );
$form.slideUp();
$('body').trigger('update_checkout');
}
},
dataType: "html"
});
return false;
});
@ -296,8 +307,10 @@ jQuery(document).ready(function($) {
var locale = $.parseJSON( locale_json );
var required = ' <abbr class="required" title="' + woocommerce_params.i18n_required_text + '">*</abbr>';
$('body')
// Handle locale
$('body').bind('country_to_state_changing', function( event, country, wrapper ){
.bind('country_to_state_changing', function( event, country, wrapper ){
var thisform = wrapper;
@ -379,10 +392,10 @@ jQuery(document).ready(function($) {
}
}
});
})
// Init trigger
$('body').bind('init_checkout', function() {
.bind('init_checkout', function() {
$('#billing_country, #shipping_country, .country_to_state').change();
$('body').trigger('update_checkout');
});

File diff suppressed because one or more lines are too long

View File

@ -36,7 +36,7 @@ jQuery(document).ready(function($) {
return false;
});
$('#review_form #submit').live('click', function(){
$('#review_form').on( 'click', '#submit', function(){
var rating = $('#rating').val();
if ( $('#rating').size() > 0 && !rating && woocommerce_params.review_rating_required == 'yes' ) {

View File

@ -1 +1 @@
jQuery(document).ready(function(e){e(".woocommerce_tabs .panel").hide();e(".woocommerce_tabs ul.tabs li a").click(function(){var t=e(this),n=t.closest(".woocommerce_tabs");e("ul.tabs li",n).removeClass("active");e("div.panel",n).hide();e("div"+t.attr("href")).show();t.parent().addClass("active");return!1});e(".woocommerce_tabs").each(function(){var t=window.location.hash;t.toLowerCase().indexOf("comment-")>=0?e("ul.tabs li.reviews_tab a",e(this)).click():e("ul.tabs li:first a",e(this)).click()});e("#rating").hide().before('<p class="stars"><span><a class="star-1" href="#">1</a><a class="star-2" href="#">2</a><a class="star-3" href="#">3</a><a class="star-4" href="#">4</a><a class="star-5" href="#">5</a></span></p>');e("p.stars a").click(function(){var t=e(this);e("#rating").val(t.text());e("p.stars a").removeClass("active");t.addClass("active");return!1});e("#review_form #submit").live("click",function(){var t=e("#rating").val();if(e("#rating").size()>0&&!t&&woocommerce_params.review_rating_required=="yes"){alert(woocommerce_params.i18n_required_rating_text);return!1}});e("form.cart").submit(function(){e(this).find(":submit").attr("disabled","disabled")})});
jQuery(document).ready(function(e){e(".woocommerce_tabs .panel").hide();e(".woocommerce_tabs ul.tabs li a").click(function(){var t=e(this),n=t.closest(".woocommerce_tabs");e("ul.tabs li",n).removeClass("active");e("div.panel",n).hide();e("div"+t.attr("href")).show();t.parent().addClass("active");return!1});e(".woocommerce_tabs").each(function(){var t=window.location.hash;t.toLowerCase().indexOf("comment-")>=0?e("ul.tabs li.reviews_tab a",e(this)).click():e("ul.tabs li:first a",e(this)).click()});e("#rating").hide().before('<p class="stars"><span><a class="star-1" href="#">1</a><a class="star-2" href="#">2</a><a class="star-3" href="#">3</a><a class="star-4" href="#">4</a><a class="star-5" href="#">5</a></span></p>');e("p.stars a").click(function(){var t=e(this);e("#rating").val(t.text());e("p.stars a").removeClass("active");t.addClass("active");return!1});e("#review_form").on("click","#submit",function(){var t=e("#rating").val();if(e("#rating").size()>0&&!t&&woocommerce_params.review_rating_required=="yes"){alert(woocommerce_params.i18n_required_rating_text);return!1}});e("form.cart").submit(function(){e(this).find(":submit").attr("disabled","disabled")})});

View File

@ -19,7 +19,8 @@ jQuery(document).ready(function($) {
});
$(".plus, .minus").live('click', function() {
$(document).on( 'click', '.plus, .minus', function() {
// Get values
var $qty = $(this).closest('.quantity').find(".qty");

View File

@ -1 +1 @@
jQuery(document).ready(function(e){e("select.orderby").change(function(){e(this).closest("form").submit()});e("div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)").addClass("buttons_added").append('<input type="button" value="+" class="plus" />').prepend('<input type="button" value="-" class="minus" />');e("input.qty:not(.product-quantity input.qty)").each(function(){var t=parseFloat(e(this).attr("min"));t&&t>0&&parseFloat(e(this).val())<t&&e(this).val(t)});e(".plus, .minus").live("click",function(){var t=e(this).closest(".quantity").find(".qty"),n=parseFloat(t.val()),r=parseFloat(t.attr("max")),i=parseFloat(t.attr("min")),s=t.attr("step");if(!n||n==""||n=="NaN")n=0;if(r==""||r=="NaN")r="";if(i==""||i=="NaN")i=0;if(s=="any"||s==""||s==undefined||parseFloat(s)=="NaN")s=1;e(this).is(".plus")?r&&(r==n||n>r)?t.val(r):t.val(n+parseFloat(s)):i&&(i==n||n<i)?t.val(i):n>0&&t.val(n-parseFloat(s));t.trigger("change")});var t=woocommerce_params.countries.replace(/&quot;/g,'"'),n=e.parseJSON(t);e("select.country_to_state").change(function(){var t=e(this).val(),r=e(this).closest("div").find("#billing_state, #shipping_state, #calc_shipping_state"),i=r.parent(),s=r.attr("name"),o=r.attr("id"),u=r.val();if(n[t])n[t].length==0?i.fadeOut(200,function(){r.parent().find(".chzn-container").remove();r.replaceWith('<input type="hidden" class="hidden" name="'+s+'" id="'+o+'" value="" />');e("body").trigger("country_to_state_changed",[t,e(this).closest("div")])}):i.fadeOut(200,function(){var a="",f=n[t];for(var l in f)a=a+'<option value="'+l+'">'+f[l]+"</option>";if(r.is("input")){r.replaceWith('<select name="'+s+'" id="'+o+'" class="state_select"></select>');r=e(this).closest("div").find("#billing_state, #shipping_state, #calc_shipping_state")}r.html('<option value="">'+woocommerce_params.i18n_select_state_text+"</option>"+a);r.val(u);e("body").trigger("country_to_state_changed",[t,e(this).closest("div")]);i.fadeIn(500)});else if(r.is("select"))i.fadeOut(200,function(){i.find(".chzn-container").remove();r.replaceWith('<input type="text" class="input-text" name="'+s+'" id="'+o+'" />');e("body").trigger("country_to_state_changed",[t,e(this).closest("div")]);i.fadeIn(500)});else if(r.is(".hidden")){i.find(".chzn-container").remove();r.replaceWith('<input type="text" class="input-text" name="'+s+'" id="'+o+'" />');e("body").trigger("country_to_state_changed",[t,e(this).closest("div")]);i.delay(200).fadeIn(500)}e("body").delay(200).trigger("country_to_state_changing",[t,e(this).closest("div")])})});
jQuery(document).ready(function(e){e("select.orderby").change(function(){e(this).closest("form").submit()});e("div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)").addClass("buttons_added").append('<input type="button" value="+" class="plus" />').prepend('<input type="button" value="-" class="minus" />');e("input.qty:not(.product-quantity input.qty)").each(function(){var t=parseFloat(e(this).attr("min"));t&&t>0&&parseFloat(e(this).val())<t&&e(this).val(t)});e(document).on("click",".plus, .minus",function(){var t=e(this).closest(".quantity").find(".qty"),n=parseFloat(t.val()),r=parseFloat(t.attr("max")),i=parseFloat(t.attr("min")),s=t.attr("step");if(!n||n==""||n=="NaN")n=0;if(r==""||r=="NaN")r="";if(i==""||i=="NaN")i=0;if(s=="any"||s==""||s==undefined||parseFloat(s)=="NaN")s=1;e(this).is(".plus")?r&&(r==n||n>r)?t.val(r):t.val(n+parseFloat(s)):i&&(i==n||n<i)?t.val(i):n>0&&t.val(n-parseFloat(s));t.trigger("change")});var t=woocommerce_params.countries.replace(/&quot;/g,'"'),n=e.parseJSON(t);e("select.country_to_state").change(function(){var t=e(this).val(),r=e(this).closest("div").find("#billing_state, #shipping_state, #calc_shipping_state"),i=r.parent(),s=r.attr("name"),o=r.attr("id"),u=r.val();if(n[t])n[t].length==0?i.fadeOut(200,function(){r.parent().find(".chzn-container").remove();r.replaceWith('<input type="hidden" class="hidden" name="'+s+'" id="'+o+'" value="" />');e("body").trigger("country_to_state_changed",[t,e(this).closest("div")])}):i.fadeOut(200,function(){var a="",f=n[t];for(var l in f)a=a+'<option value="'+l+'">'+f[l]+"</option>";if(r.is("input")){r.replaceWith('<select name="'+s+'" id="'+o+'" class="state_select"></select>');r=e(this).closest("div").find("#billing_state, #shipping_state, #calc_shipping_state")}r.html('<option value="">'+woocommerce_params.i18n_select_state_text+"</option>"+a);r.val(u);e("body").trigger("country_to_state_changed",[t,e(this).closest("div")]);i.fadeIn(500)});else if(r.is("select"))i.fadeOut(200,function(){i.find(".chzn-container").remove();r.replaceWith('<input type="text" class="input-text" name="'+s+'" id="'+o+'" />');e("body").trigger("country_to_state_changed",[t,e(this).closest("div")]);i.fadeIn(500)});else if(r.is(".hidden")){i.find(".chzn-container").remove();r.replaceWith('<input type="text" class="input-text" name="'+s+'" id="'+o+'" />');e("body").trigger("country_to_state_changed",[t,e(this).closest("div")]);i.delay(200).fadeIn(500)}e("body").delay(200).trigger("country_to_state_changing",[t,e(this).closest("div")])})});

View File

@ -131,6 +131,33 @@ abstract class WC_Product {
}
/**
* Set stock level of the product.
*
* @access public
* @param mixed $amount (default: null)
* @return int Stock
*/
function set_stock( $amount = null ) {
global $woocommerce;
if ( $this->managing_stock() && ! is_null( $amount ) ) {
$this->stock = intval( $amount );
update_post_meta( $this->id, '_stock', $this->stock );
// Out of stock attribute
if ( ! $this->backorders_allowed() && $this->get_total_stock() <= 0 )
$this->set_stock_status( 'outofstock' );
elseif ( $this->backorders_allowed() || $this->get_total_stock() > 0 )
$this->set_stock_status( 'instock' );
$woocommerce->clear_product_transients( $this->id ); // Clear transient
return $this->get_stock_quantity();
}
}
/**
* Reduce stock level of the product.
*
@ -146,7 +173,7 @@ abstract class WC_Product {
update_post_meta( $this->id, '_stock', $this->stock );
// Out of stock attribute
if ( $this->managing_stock() && ! $this->backorders_allowed() && $this->get_total_stock() <= 0 )
if ( ! $this->backorders_allowed() && $this->get_total_stock() <= 0 )
$this->set_stock_status( 'outofstock' );
$woocommerce->clear_product_transients( $this->id ); // Clear transient
@ -171,7 +198,7 @@ abstract class WC_Product {
update_post_meta( $this->id, '_stock', $this->stock );
// Out of stock attribute
if ( $this->managing_stock() && ( $this->backorders_allowed() || $this->get_total_stock() > 0 ) )
if ( $this->backorders_allowed() || $this->get_total_stock() > 0 )
$this->set_stock_status( 'instock' );
$woocommerce->clear_product_transients( $this->id ); // Clear transient

View File

@ -26,6 +26,12 @@ class WC_Checkout {
/** @var bool True when the user is creating an account. */
public $creating_account;
/** @var object The shipping method being used. */
private $shipping_method;
/** @var array The payment gateway being used. */
private $payment_method;
/**
* Constructor for the checkout class. Hooks in methods and defines eheckout fields.
*
@ -314,14 +320,14 @@ class WC_Checkout {
}
// Store meta
if ( $this->chosen_shipping_method ) {
update_post_meta( $order_id, '_shipping_method', $this->chosen_shipping_method->id );
update_post_meta( $order_id, '_shipping_method_title', $this->chosen_shipping_method->label );
if ( $this->shipping_method ) {
update_post_meta( $order_id, '_shipping_method', $this->shipping_method->id );
update_post_meta( $order_id, '_shipping_method_title', $this->shipping_method->label );
}
if ( $this->chosen_payment_method ) {
update_post_meta( $order_id, '_payment_method', $this->chosen_payment_method->id );
update_post_meta( $order_id, '_payment_method_title', $this->chosen_payment_method->get_title() );
if ( $this->payment_method ) {
update_post_meta( $order_id, '_payment_method', $this->payment_method->id );
update_post_meta( $order_id, '_payment_method_title', $this->payment_method->get_title() );
}
update_post_meta( $order_id, '_order_shipping', woocommerce_format_total( $woocommerce->cart->shipping_total ) );
@ -561,10 +567,10 @@ class WC_Checkout {
$available_methods = $woocommerce->shipping->get_available_shipping_methods();
if ( ! isset( $available_methods[ $this->posted['shipping_method'] ] ) ) {
$this->chosen_shipping_method = '';
$this->shipping_method = '';
$woocommerce->add_error( __( 'Invalid shipping method.', 'woocommerce' ) );
} else {
$this->chosen_shipping_method = $available_methods[ $this->posted['shipping_method'] ];
$this->shipping_method = $available_methods[ $this->posted['shipping_method'] ];
}
}
@ -574,11 +580,11 @@ class WC_Checkout {
$available_gateways = $woocommerce->payment_gateways->get_available_payment_gateways();
if ( ! isset( $available_gateways[ $this->posted['payment_method'] ] ) ) {
$this->chosen_payment_method = '';
$this->payment_method = '';
$woocommerce->add_error( __( 'Invalid payment method.', 'woocommerce' ) );
} else {
$this->chosen_payment_method = $available_gateways[ $this->posted['payment_method'] ];
$this->chosen_payment_method->validate_fields();
$this->payment_method = $available_gateways[ $this->posted['payment_method'] ];
$this->payment_method->validate_fields();
}
}
@ -596,22 +602,27 @@ class WC_Checkout {
$reg_errors = new WP_Error();
do_action('woocommerce_register_post', $this->posted['account_username'], $this->posted['billing_email'], $reg_errors);
do_action( 'woocommerce_register_post', $this->posted['account_username'], $this->posted['billing_email'], $reg_errors );
$errors = apply_filters( 'woocommerce_registration_errors', $reg_errors, $this->posted['account_username'], $this->posted['billing_email'] );
// if there are no errors, let's create the user account
if ( ! $reg_errors->get_error_code() ) {
$user_pass = esc_attr( $this->posted['account_password'] );
$this->customer_id = wp_create_user( $this->posted['account_username'], $user_pass, $this->posted['billing_email'] );
$user_pass = esc_attr( $this->posted['account_password'] );
$new_customer_data = array(
'user_login' => $this->posted['account_username'],
'user_pass' => $user_pass,
'user_email' => $this->posted['billing_email'],
'role' => 'customer'
);
$this->customer_id = wp_insert_user( apply_filters( 'woocommerce_new_customer_data', $new_customer_data ) );
if ( ! $this->customer_id )
throw new MyException( '<strong>' . __( 'ERROR', 'woocommerce' ) . '</strong>: ' . __( 'Couldn&#8217;t register you&hellip; please contact us if you continue to have problems.', 'woocommerce' ) );
// Change role
wp_update_user( array('ID' => $this->customer_id, 'role' => 'customer') ) ;
// Action
do_action( 'woocommerce_created_customer', $this->customer_id );

View File

@ -30,6 +30,7 @@ class WC_Countries {
* @return void
*/
public function __construct() {
global $woocommerce, $states;
$this->countries = apply_filters('woocommerce_countries', array(
'AF' => __( 'Afghanistan', 'woocommerce' ),
@ -284,96 +285,21 @@ class WC_Countries {
'ZW' => __( 'Zimbabwe', 'woocommerce' )
));
$this->states = apply_filters('woocommerce_states', array(
'AU' => array(
'ACT' => __( 'Australian Capital Territory', 'woocommerce' ) ,
'NSW' => __( 'New South Wales', 'woocommerce' ) ,
'NT' => __( 'Northern Territory', 'woocommerce' ) ,
'QLD' => __( 'Queensland', 'woocommerce' ) ,
'SA' => __( 'South Australia', 'woocommerce' ) ,
'TAS' => __( 'Tasmania', 'woocommerce' ) ,
'VIC' => __( 'Victoria', 'woocommerce' ) ,
'WA' => __( 'Western Australia', 'woocommerce' )
),
// States set to array() are blank i.e. the country has no use for the state field.
$states = array(
'AF' => array(),
'AT' => array(),
'BE' => array(),
'BI' => array(),
'BR' => array(
'AC' => __( 'Acre', 'woocommerce' ),
'AL' => __( 'Alagoas', 'woocommerce' ),
'AP' => __( 'Amap&aacute;', 'woocommerce' ),
'AM' => __( 'Amazonas', 'woocommerce' ),
'BH' => __( 'Bahia', 'woocommerce' ),
'CE' => __( 'Cear&aacute;', 'woocommerce' ),
'DF' => __( 'Distrito Federal', 'woocommerce' ),
'ES' => __( 'Esp&iacute;rito Santo', 'woocommerce' ),
'GO' => __( 'Goi&aacute;s', 'woocommerce' ),
'MA' => __( 'Maranh&atilde;o', 'woocommerce' ),
'MT' => __( 'Mato Grosso', 'woocommerce' ),
'MS' => __( 'Mato Grosso do Sul', 'woocommerce' ),
'MG' => __( 'Minas Gerais', 'woocommerce' ),
'PA' => __( 'Par&aacute;', 'woocommerce' ),
'PB' => __( 'Para&iacute;ba', 'woocommerce' ),
'PR' => __( 'Paran&aacute;', 'woocommerce' ),
'PE' => __( 'Pernambuco', 'woocommerce' ),
'PI' => __( 'Piau&iacute;', 'woocommerce' ),
'RJ' => __( 'Rio de Janeiro', 'woocommerce' ),
'RN' => __( 'Rio Grande do Norte', 'woocommerce' ),
'RS' => __( 'Rio Grande do Sul', 'woocommerce' ),
'RO' => __( 'Rond&ocirc;nia', 'woocommerce' ),
'RR' => __( 'Roraima', 'woocommerce' ),
'SC' => __( 'Santa Catarina', 'woocommerce' ),
'SP' => __( 'S&atilde;o Paulo', 'woocommerce' ),
'SE' => __( 'Sergipe', 'woocommerce' ),
'TO' => __( 'Tocantins', 'woocommerce' )
),
'CA' => array(
'AB' => __( 'Alberta', 'woocommerce' ) ,
'BC' => __( 'British Columbia', 'woocommerce' ) ,
'MB' => __( 'Manitoba', 'woocommerce' ) ,
'NB' => __( 'New Brunswick', 'woocommerce' ) ,
'NF' => __( 'Newfoundland', 'woocommerce' ) ,
'NT' => __( 'Northwest Territories', 'woocommerce' ) ,
'NS' => __( 'Nova Scotia', 'woocommerce' ) ,
'NU' => __( 'Nunavut', 'woocommerce' ) ,
'ON' => __( 'Ontario', 'woocommerce' ) ,
'PE' => __( 'Prince Edward Island', 'woocommerce' ) ,
'QC' => __( 'Quebec', 'woocommerce' ) ,
'SK' => __( 'Saskatchewan', 'woocommerce' ) ,
'YT' => __( 'Yukon Territory', 'woocommerce' )
),
'CZ' => array(),
'DE' => array(),
'DK' => array(),
'FI' => array(),
'FR' => array(),
'HK' => array(
'HONG KONG' => __( 'Hong Kong Island', 'woocommerce' ),
'KOWLOON' => __( 'Kowloon', 'woocommerce' ),
'NEW TERRITORIES' => __( 'New Territories', 'woocommerce' )
),
'HU' => array(),
'IS' => array(),
'IL' => array(),
'NL' => array(),
'NZ' => array(
'AK' => __( 'Auckland', 'woocommerce' ),
'BP' => __( 'Bay of Plenty', 'woocommerce' ),
'CT' => __( 'Canterbury', 'woocommerce' ),
'HB' => __( 'Hawke&rsquo;s Bay', 'woocommerce' ),
'MW' => __( 'Manawatu-Wanganui', 'woocommerce' ),
'MB' => __( 'Marlborough', 'woocommerce' ),
'NS' => __( 'Nelson', 'woocommerce' ),
'NL' => __( 'Northland', 'woocommerce' ),
'OT' => __( 'Otago', 'woocommerce' ),
'SL' => __( 'Southland', 'woocommerce' ),
'TK' => __( 'Taranaki', 'woocommerce' ),
'TM' => __( 'Tasman', 'woocommerce' ),
'WA' => __( 'Waikato', 'woocommerce' ),
'WE' => __( 'Wellington', 'woocommerce' ),
'WC' => __( 'West Coast', 'woocommerce' )
),
'NO' => array(),
'PL' => array(),
'SG' => array(),
@ -381,64 +307,18 @@ class WC_Countries {
'SI' => array(),
'LK' => array(),
'SE' => array(),
'US' => array(
'AL' => __( 'Alabama', 'woocommerce' ) ,
'AK' => __( 'Alaska', 'woocommerce' ) ,
'AZ' => __( 'Arizona', 'woocommerce' ) ,
'AR' => __( 'Arkansas', 'woocommerce' ) ,
'CA' => __( 'California', 'woocommerce' ) ,
'CO' => __( 'Colorado', 'woocommerce' ) ,
'CT' => __( 'Connecticut', 'woocommerce' ) ,
'DE' => __( 'Delaware', 'woocommerce' ) ,
'DC' => __( 'District Of Columbia', 'woocommerce' ) ,
'FL' => __( 'Florida', 'woocommerce' ) ,
'GA' => __( 'Georgia', 'woocommerce' ) ,
'HI' => __( 'Hawaii', 'woocommerce' ) ,
'ID' => __( 'Idaho', 'woocommerce' ) ,
'IL' => __( 'Illinois', 'woocommerce' ) ,
'IN' => __( 'Indiana', 'woocommerce' ) ,
'IA' => __( 'Iowa', 'woocommerce' ) ,
'KS' => __( 'Kansas', 'woocommerce' ) ,
'KY' => __( 'Kentucky', 'woocommerce' ) ,
'LA' => __( 'Louisiana', 'woocommerce' ) ,
'ME' => __( 'Maine', 'woocommerce' ) ,
'MD' => __( 'Maryland', 'woocommerce' ) ,
'MA' => __( 'Massachusetts', 'woocommerce' ) ,
'MI' => __( 'Michigan', 'woocommerce' ) ,
'MN' => __( 'Minnesota', 'woocommerce' ) ,
'MS' => __( 'Mississippi', 'woocommerce' ) ,
'MO' => __( 'Missouri', 'woocommerce' ) ,
'MT' => __( 'Montana', 'woocommerce' ) ,
'NE' => __( 'Nebraska', 'woocommerce' ) ,
'NV' => __( 'Nevada', 'woocommerce' ) ,
'NH' => __( 'New Hampshire', 'woocommerce' ) ,
'NJ' => __( 'New Jersey', 'woocommerce' ) ,
'NM' => __( 'New Mexico', 'woocommerce' ) ,
'NY' => __( 'New York', 'woocommerce' ) ,
'NC' => __( 'North Carolina', 'woocommerce' ) ,
'ND' => __( 'North Dakota', 'woocommerce' ) ,
'OH' => __( 'Ohio', 'woocommerce' ) ,
'OK' => __( 'Oklahoma', 'woocommerce' ) ,
'OR' => __( 'Oregon', 'woocommerce' ) ,
'PA' => __( 'Pennsylvania', 'woocommerce' ) ,
'RI' => __( 'Rhode Island', 'woocommerce' ) ,
'SC' => __( 'South Carolina', 'woocommerce' ) ,
'SD' => __( 'South Dakota', 'woocommerce' ) ,
'TN' => __( 'Tennessee', 'woocommerce' ) ,
'TX' => __( 'Texas', 'woocommerce' ) ,
'UT' => __( 'Utah', 'woocommerce' ) ,
'VT' => __( 'Vermont', 'woocommerce' ) ,
'VA' => __( 'Virginia', 'woocommerce' ) ,
'WA' => __( 'Washington', 'woocommerce' ) ,
'WV' => __( 'West Virginia', 'woocommerce' ) ,
'WI' => __( 'Wisconsin', 'woocommerce' ) ,
'WY' => __( 'Wyoming', 'woocommerce' ) ,
'AA' => __( 'Armed Forces (AA)', 'woocommerce' ) ,
'AE' => __( 'Armed Forces (AE)', 'woocommerce' ) ,
'AP' => __( 'Armed Forces (AP)', 'woocommerce' )
),
'VN' => array()
));
);
// Load only the state files the shop owner wants/needs
$allowed = $this->get_allowed_countries();
if ( $allowed )
foreach ( $allowed as $CC => $country )
if ( ! isset( $states[ $CC ] ) && file_exists( $woocommerce->plugin_path() . '/i18n/states/' . $CC . '.php' ) )
include( $woocommerce->plugin_path() . '/i18n/states/' . $CC . '.php' );
$this->states = apply_filters('woocommerce_states', $states );
}
@ -487,8 +367,8 @@ class WC_Countries {
$allowed_countries_raw = get_option( 'woocommerce_specific_allowed_countries' );
foreach ($allowed_countries_raw as $country)
$allowed_countries[$country] = $this->countries[$country];
foreach ( $allowed_countries_raw as $country )
$allowed_countries[ $country ] = $this->countries[ $country ];
return $allowed_countries;
}

View File

@ -106,15 +106,16 @@ class WC_Coupon {
$coupon_id = $wpdb->get_var( $wpdb->prepare( apply_filters( 'woocommerce_coupon_code_query', "SELECT ID FROM $wpdb->posts WHERE post_title = %s AND post_type = 'shop_coupon'" ), $this->code ) );
if ( $coupon_id )
$coupon = get_post( $coupon_id );
else
$coupon->post_title = apply_filters( 'woocommerce_coupon_code', $coupon->post_title );
if ( ! $coupon_id )
return;
$coupon = get_post( $coupon_id );
$coupon->post_title = apply_filters( 'woocommerce_coupon_code', $coupon->post_title );
if ( empty( $coupon ) || $coupon->post_status !== 'publish' || $this->code !== $coupon->post_title )
return;
$this->id = $coupon->ID;
$this->id = $coupon->ID;
$this->coupon_custom_fields = get_post_meta( $this->id );
$load_data = array(

View File

@ -63,6 +63,34 @@ class WC_Product_Variable extends WC_Product {
return apply_filters( 'woocommerce_stock_amount', $this->total_stock );
}
/**
* Set stock level of the product.
*
* @access public
* @param mixed $amount (default: null)
* @return int Stock
*/
function set_stock( $amount = null ) {
global $woocommerce;
if ( $this->managing_stock() && ! is_null( $amount ) ) {
$this->stock = intval( $amount );
$this->total_stock = intval( $amount );
update_post_meta( $this->id, '_stock', $this->stock );
// Check parents out of stock attribute
if ( ! $this->backorders_allowed() && $this->get_total_stock() <= 0 )
$this->set_stock_status( 'outofstock' );
elseif ( $this->backorders_allowed() || $this->get_total_stock() > 0 )
$this->set_stock_status( 'instock' );
$woocommerce->clear_product_transients( $this->id ); // Clear transient
return apply_filters( 'woocommerce_stock_amount', $this->stock );
}
}
/**
* Reduce stock level of the product.
*
@ -79,7 +107,7 @@ class WC_Product_Variable extends WC_Product {
update_post_meta($this->id, '_stock', $this->stock);
// Out of stock attribute
if ($this->managing_stock() && !$this->backorders_allowed() && $this->get_total_stock()<=0)
if ( ! $this->backorders_allowed() && $this->get_total_stock() <= 0 )
$this->set_stock_status( 'outofstock' );
$woocommerce->clear_product_transients( $this->id ); // Clear transient
@ -105,7 +133,7 @@ class WC_Product_Variable extends WC_Product {
update_post_meta($this->id, '_stock', $this->stock);
// Out of stock attribute
if ($this->managing_stock() && ($this->backorders_allowed() || $this->get_total_stock()>0))
if ( $this->backorders_allowed() || $this->get_total_stock() > 0 )
$this->set_stock_status( 'instock' );
$woocommerce->clear_product_transients( $this->id ); // Clear transient

View File

@ -281,6 +281,46 @@ class WC_Product_Variation extends WC_Product {
}
/**
* Set stock level of the product.
*
* @access public
* @param mixed $amount (default: null)
* @return int Stock
*/
function set_stock( $amount = null ) {
global $woocommerce;
if ( $this->variation_has_stock ) {
if ( $this->managing_stock() && ! is_null( $amount ) ) {
$this->stock = intval( $amount );
$this->total_stock = intval( $amount );
update_post_meta( $this->variation_id, '_stock', $this->stock );
$woocommerce->clear_product_transients( $this->id ); // Clear transient
// Check parents out of stock attribute
if ( ! $this->is_in_stock() ) {
// Check parent
$parent_product = get_product( $this->id );
// Only continue if the parent has backorders off
if ( ! $parent_product->backorders_allowed() && $parent_product->get_total_stock() <= 0 )
$this->set_stock_status( 'outofstock' );
} elseif ( $this->is_in_stock() ) {
$this->set_stock_status( 'instock' );
}
return apply_filters( 'woocommerce_stock_amount', $this->stock );
}
} else {
return parent::set_stock( $amount );
}
}
/**
* Reduce stock level of the product.
*

View File

@ -53,7 +53,8 @@ class WC_Paypal extends WC_Payment_Gateway {
$this->invoice_prefix = ! empty( $this->settings['invoice_prefix'] ) ? $this->settings['invoice_prefix'] : 'WC-';
// Logs
if ($this->debug=='yes') $this->log = $woocommerce->logger();
if ( 'yes' == $this->debug )
$this->log = $woocommerce->logger();
// Actions
add_action( 'valid-paypal-standard-ipn-request', array( $this, 'successful_request' ) );
@ -87,27 +88,24 @@ class WC_Paypal extends WC_Payment_Gateway {
*/
public function admin_options() {
?>
<h3><?php _e( 'PayPal standard', 'woocommerce' ); ?></h3>
<p><?php _e( 'PayPal standard works by sending the user to PayPal to enter their payment information.', 'woocommerce' ); ?></p>
<table class="form-table">
<?php
if ( $this->is_valid_for_use() ) :
?>
<h3><?php _e( 'PayPal standard', 'woocommerce' ); ?></h3>
<p><?php _e( 'PayPal standard works by sending the user to PayPal to enter their payment information.', 'woocommerce' ); ?></p>
<?php if ( $this->is_valid_for_use() ) : ?>
<table class="form-table">
<?php
// Generate the HTML For the settings form.
$this->generate_settings_html();
$this->generate_settings_html();
?>
</table><!--/.form-table-->
else :
?>
<div class="inline error"><p><strong><?php _e( 'Gateway Disabled', 'woocommerce' ); ?></strong>: <?php _e( 'PayPal does not support your store currency.', 'woocommerce' ); ?></p></div>
<?php
endif;
?>
</table><!--/.form-table-->
<?php
}
<?php else : ?>
<div class="inline error"><p><strong><?php _e( 'Gateway Disabled', 'woocommerce' ); ?></strong>: <?php _e( 'PayPal does not support your store currency.', 'woocommerce' ); ?></p></div>
<?php
endif;
}
/**
@ -218,7 +216,7 @@ class WC_Paypal extends WC_Payment_Gateway {
$order_id = $order->id;
if ( $this->debug == 'yes' )
if ( 'yes' == $this->debug )
$this->log->add( 'paypal', 'Generating payment form for order ' . $order->get_order_number() . '. Notify URL: ' . $this->notify_url );
if ( in_array( $order->billing_country, array( 'US','CA' ) ) ) {
@ -496,11 +494,18 @@ class WC_Paypal extends WC_Payment_Gateway {
function check_ipn_request_is_valid() {
global $woocommerce;
if ( $this->debug == 'yes' )
if ( 'yes' == $this->debug )
$this->log->add( 'paypal', 'Checking IPN response is valid...' );
// Get recieved values from post data
$received_values = (array) stripslashes_deep( $_POST );
// Check email address to make sure that IPN response is not a spoof
if ( strcasecmp( trim( $received_values['receiver_email'] ), trim( $this->email ) ) != 0 ) {
if ( 'yes' == $this->debug )
$this->log->add( 'paypal', "IPN Response is for another one: {$received_values['receiver_email']} our email is {$this->email}" );
return false;
}
// Add cmd to the post array
$received_values['cmd'] = '_notify-validate';
@ -522,18 +527,18 @@ class WC_Paypal extends WC_Payment_Gateway {
// Post back to get a response
$response = wp_remote_post( $paypal_adr, $params );
if ( $this->debug == 'yes' )
if ( 'yes' == $this->debug )
$this->log->add( 'paypal', 'IPN Response: ' . print_r( $response, true ) );
// check to see if the request was valid
if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 && ( strcmp( $response['body'], "VERIFIED" ) == 0 ) ) {
if ( $this->debug == 'yes' )
if ( 'yes' == $this->debug )
$this->log->add( 'paypal', 'Received valid response from PayPal' );
return true;
}
if ( $this->debug == 'yes' ) {
if ( 'yes' == $this->debug ) {
$this->log->add( 'paypal', 'Received invalid response from PayPal' );
if ( is_wp_error( $response ) )
$this->log->add( 'paypal', 'Error response: ' . $result->get_error_message() );
@ -593,7 +598,7 @@ class WC_Paypal extends WC_Payment_Gateway {
if ( $posted['test_ipn'] == 1 && $posted['payment_status'] == 'pending' )
$posted['payment_status'] = 'completed';
if ( $this->debug == 'yes' )
if ( 'yes' == $this->debug )
$this->log->add( 'paypal', 'Payment status: ' . $posted['payment_status'] );
// We are here so lets check status and do actions
@ -602,7 +607,7 @@ class WC_Paypal extends WC_Payment_Gateway {
// Check order not already completed
if ( $order->status == 'completed' ) {
if ( $this->debug == 'yes' )
if ( 'yes' == $this->debug )
$this->log->add( 'paypal', 'Aborting, Order #' . $order_id . ' is already complete.' );
exit;
}
@ -610,7 +615,7 @@ class WC_Paypal extends WC_Payment_Gateway {
// Check valid txn_type
$accepted_types = array( 'cart', 'instant', 'express_checkout', 'web_accept', 'masspay', 'send_money' );
if ( ! in_array( $posted['txn_type'], $accepted_types ) ) {
if ( $this->debug == 'yes' )
if ( 'yes' == $this->debug )
$this->log->add( 'paypal', 'Aborting, Invalid type:' . $posted['txn_type'] );
exit;
}
@ -618,7 +623,7 @@ class WC_Paypal extends WC_Payment_Gateway {
// Validate Amount
if ( $order->get_total() != $posted['mc_gross'] ) {
if ( $this->debug == 'yes' )
if ( 'yes' == $this->debug )
$this->log->add( 'paypal', 'Payment error: Amounts do not match (gross ' . $posted['mc_gross'] . ')' );
// Put this order on-hold for manual checking
@ -643,7 +648,7 @@ class WC_Paypal extends WC_Payment_Gateway {
$order->add_order_note( __( 'IPN payment completed', 'woocommerce' ) );
$order->payment_complete();
if ( $this->debug == 'yes' )
if ( 'yes' == $this->debug )
$this->log->add( 'paypal', 'Payment complete.' );
break;

View File

@ -156,6 +156,7 @@ class ShareYourCartWooCommerce extends ShareYourCartWordpressPlugin{
if(!$this->isCartActive()) return;
$this->_loadWooCommerce();
global $woocommerce;
//specify the parameters
$params = array(
@ -167,11 +168,11 @@ class ShareYourCartWooCommerce extends ShareYourCartWordpressPlugin{
//there is no product set, thus send the products from the shopping cart
if(!isset($_REQUEST['p']))
{
if(empty($_SESSION['cart']))
if(sizeof( $woocommerce->cart->get_cart() ) == 0)
exit("Cart is empty");
foreach($_SESSION['cart'] as $cart_details){
$params['cart'][] = $this->_getProductDetails($cart_details['product_id']);
foreach ( $woocommerce->cart->get_cart() as $cart_item_key => $values ) {
$params['cart'][] = $this->_getProductDetails($values['data']);
}
}
else
@ -192,7 +193,12 @@ class ShareYourCartWooCommerce extends ShareYourCartWordpressPlugin{
}
private function _getProductDetails($product_id){
$product = get_product($product_id);
if(is_object($product_id)) { //if we've already received the product, use this one
$product = $product_id;
}
else { //it's only a number, so get the product
$product = get_product($product_id);
}
//WooCommerce actually echoes the image
ob_start();
@ -214,10 +220,10 @@ class ShareYourCartWooCommerce extends ShareYourCartWordpressPlugin{
return array(
"item_name" => $product->get_title(),
"item_description" => $product->post->post_excerpt,
"item_url" => get_permalink($product_id),
"item_url" => get_permalink($product->id),
"item_price" => $product->price,
"item_picture_url" => $image,
"item_unique_id" => $product_id,
"item_unique_id" => $product->id,
);
}

View File

@ -508,7 +508,7 @@ class WC_Flat_Rate extends WC_Shipping_Method {
<script type="text/javascript">
jQuery(function() {
jQuery('#<?php echo $this->id; ?>_flat_rates a.add').live('click', function(){
jQuery('#<?php echo $this->id; ?>_flat_rates').on( 'click', 'a.add', function(){
var size = jQuery('#<?php echo $this->id; ?>_flat_rates tbody .flat_rate').size();
@ -535,7 +535,7 @@ class WC_Flat_Rate extends WC_Shipping_Method {
});
// Remove row
jQuery('#<?php echo $this->id; ?>_flat_rates a.remove').live('click', function(){
jQuery('#<?php echo $this->id; ?>_flat_rates').on( 'click', 'a.remove', function(){
var answer = confirm("<?php _e( 'Delete the selected rates?', 'woocommerce' ); ?>")
if (answer) {
jQuery('#<?php echo $this->id; ?>_flat_rates table tbody tr td.check-column input:checked').each(function(i, el){

Binary file not shown.

View File

@ -197,7 +197,7 @@ msgstr "Fullførte"
#: admin/woocommerce-admin-dashboard.php:189
#@ woocommerce
msgid "Monthly Sales"
msgstr "Månedlige slag"
msgstr "Månedlige salg"
#: admin/woocommerce-admin-dashboard.php:224
#@ woocommerce
@ -1687,7 +1687,7 @@ msgstr "Slett permanent"
#: admin/post-types/writepanels/writepanel-order_data.php:468
#@ woocommerce
msgid "Move to Trash"
msgstr "Flytt til pepirkurven"
msgstr "Flytt til papirkurven"
#: classes/class-wc-order.php:568
#@ woocommerce
@ -2107,7 +2107,7 @@ msgstr "Ordredata"
#: admin/post-types/writepanels/writepanels-init.php:50
#@ woocommerce
msgid "Order Items <small>&ndash; Note: if you edit quantities or remove items from the order you will need to manually change the item's stock levels.</small>"
msgstr "Produkter i ordre <small>&ndash; OBS: Om du bruker entall eller tar bort produkter fra ordren må du manuellt endre lagersaldo for produktet."
msgstr "Produkter i ordre <small>&ndash; OBS: Hvis du bruker antall eller tar bort produkter fra ordren må du manuellt endre lagersaldo for produktet."
#: admin/post-types/writepanels/writepanels-init.php:51
#@ woocommerce
@ -2173,7 +2173,7 @@ msgstr "Du kan ikke legge produktet i handlekurven fordi det er tomt på lager."
#, php-format
#@ woocommerce
msgid "Sorry, we do not have enough \"%s\" in stock to fulfill your order (%s in stock). Please edit your cart and try again. We apologise for any inconvenience caused."
msgstr "Beklager, vi har dessverre ikke mange nok \"%s\" på lager i forhold til ditt ønske. (%s i lager) Redigere din handlekurv og prøv igjen. Vi beklager dette."
msgstr "Beklager, vi har dessverre ikke mange nok \"%s\" på lager i forhold til ditt ønske. (%s lager) Redigere din handlekurv og prøv igjen. Vi beklager dette."
#: classes/class-wc-cart.php:392
#, php-format
@ -2408,7 +2408,7 @@ msgstr "Gi kunden instruksjoner om hvordan man betaler via BACS og la kunden vit
#: classes/gateways/bacs/class-wc-bacs.php:65
#@ woocommerce
msgid "Make your payment directly into our bank account. Please use your Order ID as the payment reference. Your order wont be shipped until the funds have cleared in our account."
msgstr "Gør bestillingen din direkte til vår bankkonto. Bruk order-ID som betalingsreferanse. Din ordre leveres når vi har mottatt din betaling."
msgstr "Betal bestillingen din direkte til vår bankkonto. Bruk ordre-ID som betalingsreferanse. Din ordre leveres når vi har mottatt din betaling."
#: classes/gateways/bacs/class-wc-bacs.php:74
#: classes/gateways/bacs/class-wc-bacs.php:140
@ -4426,7 +4426,7 @@ msgstr "Ordredetaljer"
#: templates/order/order-details.php:15
#@ woocommerce
msgid "Qty"
msgstr "Antal"
msgstr "Antall"
#: templates/checkout/form-pay.php:14
#: templates/checkout/review-order.php:17
@ -4639,7 +4639,7 @@ msgstr "Frakt:"
#: templates/emails/customer-processing-order.php:46
#@ woocommerce
msgid "Tel:"
msgstr "Telefonnr."
msgstr "Tlf:"
#: admin/woocommerce-admin-functions.php:145
#: templates/emails/email-addresses.php:7
@ -4710,7 +4710,7 @@ msgstr "Skriv en anmeldelse"
#: templates/single-product-reviews.php:66
#@ woocommerce
msgid "There are no reviews yet, would you like to <a href=\"#review_form\" class=\"inline show_review_form\">submit yours</a>?"
msgstr "Det finnes ingen anmeldelser ennå, vil du <a href=\"#review_form\" class=\"inline show_review_form\"> skriv en </a>?"
msgstr "Det finnes ingen anmeldelser ennå, vil du <a href=\"#review_form\" class=\"inline show_review_form\"> skrive en </a>?"
#: admin/post-types/writepanels/writepanel-order_data.php:167
#: admin/woocommerce-admin-users.php:145
@ -4807,7 +4807,7 @@ msgstr "WooCommerce Utvalgte produkter"
#: widgets/widget-featured_products.php:55
#@ woocommerce
msgid "Featured Products"
msgstr "Anbelate produkter"
msgstr "Anbefalte produkter"
#: widgets/widget-best_sellers.php:144
#: widgets/widget-featured_products.php:131
@ -6225,7 +6225,7 @@ msgstr "Takk for din bestilling! Dine opplysninger ser du nedenfor."
#: templates/emails/admin-new-order.php:5
#@ woocommerce
msgid "You have received an order from"
msgstr "Du har mottatt ordre fra"
msgstr "Du har mottatt en ordre fra"
#: templates/single-product-reviews.php:64
#@ woocommerce
@ -6470,7 +6470,7 @@ msgstr "Artikkel"
#: woocommerce-ajax.php:722
#@ woocommerce
msgid "Delete item"
msgstr "Rediger artikkel"
msgstr "Fjern artikkel"
#: admin/post-types/writepanels/writepanel-order_data.php:356
#: woocommerce-ajax.php:723
@ -8213,7 +8213,7 @@ msgstr "Fortsett å handle &rarr;"
#: woocommerce-functions.php:359
#@ woocommerce
msgid "Product successfully added to your cart."
msgstr "Pruduktet er lagt til i din handlekurv."
msgstr "Produktet er lagt til i din handlekurv."
#: woocommerce-functions.php:552
#@ woocommerce
@ -8998,7 +8998,7 @@ msgstr "Sorter produkter"
#, php-format
#@ woocommerce
msgid "Order %s"
msgstr "Rekkefølge %s"
msgstr "Ordre %s"
#: admin/post-types/writepanels/writepanel-coupon_data.php:49
#@ woocommerce
@ -9577,7 +9577,7 @@ msgstr "Antall salg"
#: admin/woocommerce-admin-reports.php:850
#@ woocommerce
msgid "Sales amount"
msgstr "Salgsantall"
msgstr "Salgsbeløp"
#: admin/woocommerce-admin-functions.php:328
#@ woocommerce
@ -10042,7 +10042,7 @@ msgstr "%s varer av %s har blitt satt i restordre #%s."
#: classes/class-wc-email.php:418
#@ woocommerce
msgid "Note"
msgstr "Noter"
msgstr "Notat"
#: classes/class-wc-email.php:452
#, php-format
@ -11325,4 +11325,4 @@ msgstr "Brukernavn eller e-post adresse"
#: woocommerce.php:0
#@ woocommerce
msgid "1.6.3"
msgstr "1.6.3"
msgstr "1.6.3"

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

21
i18n/states/AU.php Normal file
View File

@ -0,0 +1,21 @@
<?php
/**
* Australian states
*
* @author WooThemes
* @category i18n
* @package WooCommerce/i18n
* @version 2.0.0
*/
global $states;
$states['AU'] = array(
'ACT' => __( 'Australian Capital Territory', 'woocommerce' ),
'NSW' => __( 'New South Wales', 'woocommerce' ),
'NT' => __( 'Northern Territory', 'woocommerce' ),
'QLD' => __( 'Queensland', 'woocommerce' ),
'SA' => __( 'South Australia', 'woocommerce' ),
'TAS' => __( 'Tasmania', 'woocommerce' ),
'VIC' => __( 'Victoria', 'woocommerce' ),
'WA' => __( 'Western Australia', 'woocommerce' )
);

40
i18n/states/BR.php Normal file
View File

@ -0,0 +1,40 @@
<?php
/**
* Brazillian states
*
* @author WooThemes
* @category i18n
* @package WooCommerce/i18n
* @version 2.0.0
*/
global $states;
$states['BR'] = array(
'AC' => __( 'Acre', 'woocommerce' ),
'AL' => __( 'Alagoas', 'woocommerce' ),
'AP' => __( 'Amap&aacute;', 'woocommerce' ),
'AM' => __( 'Amazonas', 'woocommerce' ),
'BH' => __( 'Bahia', 'woocommerce' ),
'CE' => __( 'Cear&aacute;', 'woocommerce' ),
'DF' => __( 'Distrito Federal', 'woocommerce' ),
'ES' => __( 'Esp&iacute;rito Santo', 'woocommerce' ),
'GO' => __( 'Goi&aacute;s', 'woocommerce' ),
'MA' => __( 'Maranh&atilde;o', 'woocommerce' ),
'MT' => __( 'Mato Grosso', 'woocommerce' ),
'MS' => __( 'Mato Grosso do Sul', 'woocommerce' ),
'MG' => __( 'Minas Gerais', 'woocommerce' ),
'PA' => __( 'Par&aacute;', 'woocommerce' ),
'PB' => __( 'Para&iacute;ba', 'woocommerce' ),
'PR' => __( 'Paran&aacute;', 'woocommerce' ),
'PE' => __( 'Pernambuco', 'woocommerce' ),
'PI' => __( 'Piau&iacute;', 'woocommerce' ),
'RJ' => __( 'Rio de Janeiro', 'woocommerce' ),
'RN' => __( 'Rio Grande do Norte', 'woocommerce' ),
'RS' => __( 'Rio Grande do Sul', 'woocommerce' ),
'RO' => __( 'Rond&ocirc;nia', 'woocommerce' ),
'RR' => __( 'Roraima', 'woocommerce' ),
'SC' => __( 'Santa Catarina', 'woocommerce' ),
'SP' => __( 'S&atilde;o Paulo', 'woocommerce' ),
'SE' => __( 'Sergipe', 'woocommerce' ),
'TO' => __( 'Tocantins', 'woocommerce' )
);

26
i18n/states/CA.php Normal file
View File

@ -0,0 +1,26 @@
<?php
/**
* Canadian states
*
* @author WooThemes
* @category i18n
* @package WooCommerce/i18n
* @version 2.0.0
*/
global $states;
$states['CA'] = array(
'AB' => __( 'Alberta', 'woocommerce' ),
'BC' => __( 'British Columbia', 'woocommerce' ),
'MB' => __( 'Manitoba', 'woocommerce' ),
'NB' => __( 'New Brunswick', 'woocommerce' ),
'NF' => __( 'Newfoundland', 'woocommerce' ),
'NT' => __( 'Northwest Territories', 'woocommerce' ),
'NS' => __( 'Nova Scotia', 'woocommerce' ),
'NU' => __( 'Nunavut', 'woocommerce' ),
'ON' => __( 'Ontario', 'woocommerce' ),
'PE' => __( 'Prince Edward Island', 'woocommerce' ),
'QC' => __( 'Quebec', 'woocommerce' ),
'SK' => __( 'Saskatchewan', 'woocommerce' ),
'YT' => __( 'Yukon Territory', 'woocommerce' )
);

45
i18n/states/CN.php Normal file
View File

@ -0,0 +1,45 @@
<?php
/**
* Chinese states
*
* @author WooThemes
* @category i18n
* @package WooCommerce/i18n
* @version 2.0.0
*/
global $states;
$states['CN'] = array(
'CN1' => __( 'Yunnan / &#20113;&#21335;', 'woocommerce' ),
'CN2' => __( 'Beijing / &#21271;&#20140;', 'woocommerce' ),
'CN3' => __( 'Tianjin / &#22825;&#27941;', 'woocommerce' ),
'CN4' => __( 'Hebei / &#27827;&#21271;', 'woocommerce' ),
'CN5' => __( 'Shanxi / &#23665;&#35199;', 'woocommerce' ),
'CN6' => __( 'Inner Mongolia / &#20839;&#33945;&#21476;', 'woocommerce' ),
'CN7' => __( 'Liaoning / &#36797;&#23425;', 'woocommerce' ),
'CN8' => __( 'Jilin / &#21513;&#26519;', 'woocommerce' ),
'CN9' => __( 'Heilongjiang / &#40657;&#40857;&#27743;', 'woocommerce' ),
'CN10' => __( 'Shanghai / &#19978;&#28023;', 'woocommerce' ),
'CN11' => __( 'Jiangsu / &#27743;&#33487;', 'woocommerce' ),
'CN12' => __( 'Zhejiang / &#27993;&#27743;', 'woocommerce' ),
'CN13' => __( 'Anhui / &#23433;&#24509;', 'woocommerce' ),
'CN14' => __( 'Fujian / &#31119;&#24314;', 'woocommerce' ),
'CN15' => __( 'Jiangxi / &#27743;&#35199;', 'woocommerce' ),
'CN16' => __( 'Shandong / &#23665;&#19996;', 'woocommerce' ),
'CN17' => __( 'Henan / &#27827;&#21335;', 'woocommerce' ),
'CN18' => __( 'Hubei / &#28246;&#21271;', 'woocommerce' ),
'CN19' => __( 'Hunan / &#28246;&#21335;', 'woocommerce' ),
'CN20' => __( 'Guangdong / &#24191;&#19996;', 'woocommerce' ),
'CN21' => __( 'Guangxi Zhuang / &#24191;&#35199;&#22766;&#26063;', 'woocommerce' ),
'CN22' => __( 'Hainan / &#28023;&#21335;', 'woocommerce' ),
'CN23' => __( 'Chongqing / &#37325;&#24198;', 'woocommerce' ),
'CN24' => __( 'Sichuan / &#22235;&#24029;', 'woocommerce' ),
'CN25' => __( 'Guizhou / &#36149;&#24030;', 'woocommerce' ),
'CN26' => __( 'Shaanxi / &#38485;&#35199;', 'woocommerce' ),
'CN27' => __( 'Gansu / &#29976;&#32899;', 'woocommerce' ),
'CN28' => __( 'Qinghai / &#38738;&#28023;', 'woocommerce' ),
'CN29' => __( 'Ningxia Hui / &#23425;&#22799;', 'woocommerce' ),
'CN30' => __( 'Macau / &#28595;&#38376;', 'woocommerce' ),
'CN31' => __( 'Tibet / &#35199;&#34255;', 'woocommerce' ),
'CN32' => __( 'Xinjiang / &#26032;&#30086;', 'woocommerce' )
);

16
i18n/states/HK.php Normal file
View File

@ -0,0 +1,16 @@
<?php
/**
* Hong Kong states
*
* @author WooThemes
* @category i18n
* @package WooCommerce/i18n
* @version 2.0.0
*/
global $states;
$states['HK'] = array(
'HONG KONG' => __( 'Hong Kong Island', 'woocommerce' ),
'KOWLOON' => __( 'Kowloon', 'woocommerce' ),
'NEW TERRITORIES' => __( 'New Territories', 'woocommerce' )
);

28
i18n/states/HZ.php Normal file
View File

@ -0,0 +1,28 @@
<?php
/**
* New Zealand states
*
* @author WooThemes
* @category i18n
* @package WooCommerce/i18n
* @version 2.0.0
*/
global $states;
$states['HZ'] = array(
'AK' => __( 'Auckland', 'woocommerce' ),
'BP' => __( 'Bay of Plenty', 'woocommerce' ),
'CT' => __( 'Canterbury', 'woocommerce' ),
'HB' => __( 'Hawke&rsquo;s Bay', 'woocommerce' ),
'MW' => __( 'Manawatu-Wanganui', 'woocommerce' ),
'MB' => __( 'Marlborough', 'woocommerce' ),
'NS' => __( 'Nelson', 'woocommerce' ),
'NL' => __( 'Northland', 'woocommerce' ),
'OT' => __( 'Otago', 'woocommerce' ),
'SL' => __( 'Southland', 'woocommerce' ),
'TK' => __( 'Taranaki', 'woocommerce' ),
'TM' => __( 'Tasman', 'woocommerce' ),
'WA' => __( 'Waikato', 'woocommerce' ),
'WE' => __( 'Wellington', 'woocommerce' ),
'WC' => __( 'West Coast', 'woocommerce' )
);

48
i18n/states/IN.php Normal file
View File

@ -0,0 +1,48 @@
<?php
/**
* Indian states
*
* @author WooThemes
* @category i18n
* @package WooCommerce/i18n
* @version 2.0.0
*/
global $states;
$states['IN'] = array(
'AP' => __( 'Andra Pradesh', 'woocommerce' ),
'AR' => __( 'Arunachal Pradesh', 'woocommerce' ),
'AS' => __( 'Assam', 'woocommerce' ),
'BR' => __( 'Bihar', 'woocommerce' ),
'CT' => __( 'Chhattisgarh', 'woocommerce' ),
'GA' => __( 'Goa', 'woocommerce' ),
'GJ' => __( 'Gujarat', 'woocommerce' ),
'HR' => __( 'Haryana', 'woocommerce' ),
'HP' => __( 'Himachal Pradesh', 'woocommerce' ),
'JK' => __( 'Jammu and Kashmir', 'woocommerce' ),
'JH' => __( 'Jharkhand', 'woocommerce' ),
'KA' => __( 'Karnataka', 'woocommerce' ),
'KL' => __( 'Kerala', 'woocommerce' ),
'MP' => __( 'Madhya Pradesh', 'woocommerce' ),
'MH' => __( 'Maharashtra', 'woocommerce' ),
'MN' => __( 'Manipur', 'woocommerce' ),
'ML' => __( 'Meghalaya', 'woocommerce' ),
'MZ' => __( 'Mizoram', 'woocommerce' ),
'NL' => __( 'Nagaland', 'woocommerce' ),
'OR' => __( 'Orissa', 'woocommerce' ),
'PB' => __( 'Punjab', 'woocommerce' ),
'RJ' => __( 'Rajasthan', 'woocommerce' ),
'SK' => __( 'Sikkim', 'woocommerce' ),
'TN' => __( 'Tamil Nadu', 'woocommerce' ),
'TR' => __( 'Tripura', 'woocommerce' ),
'UT' => __( 'Uttaranchal', 'woocommerce' ),
'UP' => __( 'Uttar Pradesh', 'woocommerce' ),
'WB' => __( 'West Bengal', 'woocommerce' ),
'AN' => __( 'Andaman and Nicobar Islands', 'woocommerce' ),
'CH' => __( 'Chandigarh', 'woocommerce' ),
'DN' => __( 'Dadar and Nagar Haveli', 'woocommerce' ),
'DD' => __( 'Daman and Diu', 'woocommerce' ),
'DL' => __( 'Delhi', 'woocommerce' ),
'LD' => __( 'Lakshadeep', 'woocommerce' ),
'PY' => __( 'Pondicherry (Puducherry)', 'woocommerce' )
);

29
i18n/states/MY.php Normal file
View File

@ -0,0 +1,29 @@
<?php
/**
* Malaysian states
*
* @author WooThemes
* @category i18n
* @package WooCommerce/i18n
* @version 2.0.0
*/
global $states;
$states['MY'] = array(
'JHR' => __( 'Johor', 'woocommerce' ),
'KDH' => __( 'Kedah', 'woocommerce' ),
'KTN' => __( 'Kelantan', 'woocommerce' ),
'MLK' => __( 'Melaka', 'woocommerce' ),
'NSN' => __( 'Negeri Sembilan', 'woocommerce' ),
'PHG' => __( 'Pahang', 'woocommerce' ),
'PRK' => __( 'Perak', 'woocommerce' ),
'PLS' => __( 'Perlis', 'woocommerce' ),
'PNG' => __( 'Pulau Pinang', 'woocommerce' ),
'SBH' => __( 'Sabah', 'woocommerce' ),
'SWK' => __( 'Sarawak', 'woocommerce' ),
'SGR' => __( 'Selangor', 'woocommerce' ),
'TRG' => __( 'Terengganu', 'woocommerce' ),
'KUL' => __( 'W.P. Kuala Lumpur', 'woocommerce' ),
'LBN' => __( 'W.P. Labuan', 'woocommerce' ),
'PJY' => __( 'W.P. Putrajaya', 'woocommerce' )
);

90
i18n/states/TH.php Normal file
View File

@ -0,0 +1,90 @@
<?php
/**
* Thailand states
*
* @author WooThemes
* @category i18n
* @package WooCommerce/i18n
* @version 2.0.0
*/
global $states;
$states['TH'] = array(
'TH-37' => __( 'Amnat Charoen (&#3629;&#3635;&#3609;&#3634;&#3592;&#3648;&#3592;&#3619;&#3636;&#3597;)', 'woocommerce' ),
'TH-15' => __( 'Ang Thong (&#3629;&#3656;&#3634;&#3591;&#3607;&#3629;&#3591;)', 'woocommerce' ),
'TH-14' => __( 'Ayutthaya (&#3614;&#3619;&#3632;&#3609;&#3588;&#3619;&#3624;&#3619;&#3637;&#3629;&#3618;&#3640;&#3608;&#3618;&#3634;)', 'woocommerce' ),
'TH-10' => __( 'Bangkok (&#3585;&#3619;&#3640;&#3591;&#3648;&#3607;&#3614;&#3617;&#3627;&#3634;&#3609;&#3588;&#3619;)', 'woocommerce' ),
'TH-38' => __( 'Bueng Kan (&#3610;&#3638;&#3591;&#3585;&#3634;&#3628;)', 'woocommerce' ),
'TH-31' => __( 'Buri Ram (&#3610;&#3640;&#3619;&#3637;&#3619;&#3633;&#3617;&#3618;&#3660;)', 'woocommerce' ),
'TH-24' => __( 'Chachoengsao (&#3593;&#3632;&#3648;&#3594;&#3636;&#3591;&#3648;&#3607;&#3619;&#3634;)', 'woocommerce' ),
'TH-18' => __( 'Chai Nat (&#3594;&#3633;&#3618;&#3609;&#3634;&#3607;)', 'woocommerce' ),
'TH-36' => __( 'Chaiyaphum (&#3594;&#3633;&#3618;&#3616;&#3641;&#3617;&#3636;)', 'woocommerce' ),
'TH-22' => __( 'Chanthaburi (&#3592;&#3633;&#3609;&#3607;&#3610;&#3640;&#3619;&#3637;)', 'woocommerce' ),
'TH-50' => __( 'Chiang Mai (&#3648;&#3594;&#3637;&#3618;&#3591;&#3651;&#3627;&#3617;&#3656;)', 'woocommerce' ),
'TH-57' => __( 'Chiang Rai (&#3648;&#3594;&#3637;&#3618;&#3591;&#3619;&#3634;&#3618;)', 'woocommerce' ),
'TH-20' => __( 'Chonburi (&#3594;&#3621;&#3610;&#3640;&#3619;&#3637;)', 'woocommerce' ),
'TH-86' => __( 'Chumphon (&#3594;&#3640;&#3617;&#3614;&#3619;)', 'woocommerce' ),
'TH-46' => __( 'Kalasin (&#3585;&#3634;&#3628;&#3626;&#3636;&#3609;&#3608;&#3640;&#3660;)', 'woocommerce' ),
'TH-62' => __( 'Kamphaeng Phet (&#3585;&#3635;&#3649;&#3614;&#3591;&#3648;&#3614;&#3594;&#3619;)', 'woocommerce' ),
'TH-71' => __( 'Kanchanaburi (&#3585;&#3634;&#3597;&#3592;&#3609;&#3610;&#3640;&#3619;&#3637;)', 'woocommerce' ),
'TH-40' => __( 'Khon Kaen (&#3586;&#3629;&#3609;&#3649;&#3585;&#3656;&#3609;)', 'woocommerce' ),
'TH-81' => __( 'Krabi (&#3585;&#3619;&#3632;&#3610;&#3637;&#3656;)', 'woocommerce' ),
'TH-52' => __( 'Lampang (&#3621;&#3635;&#3611;&#3634;&#3591;)', 'woocommerce' ),
'TH-51' => __( 'Lamphun (&#3621;&#3635;&#3614;&#3641;&#3609;)', 'woocommerce' ),
'TH-42' => __( 'Loei (&#3648;&#3621;&#3618;)', 'woocommerce' ),
'TH-16' => __( 'Lopburi (&#3621;&#3614;&#3610;&#3640;&#3619;&#3637;)', 'woocommerce' ),
'TH-58' => __( 'Mae Hong Son (&#3649;&#3617;&#3656;&#3630;&#3656;&#3629;&#3591;&#3626;&#3629;&#3609;)', 'woocommerce' ),
'TH-44' => __( 'Maha Sarakham (&#3617;&#3627;&#3634;&#3626;&#3634;&#3619;&#3588;&#3634;&#3617;)', 'woocommerce' ),
'TH-49' => __( 'Mukdahan (&#3617;&#3640;&#3585;&#3604;&#3634;&#3627;&#3634;&#3619;)', 'woocommerce' ),
'TH-26' => __( 'Nakhon Nayok (&#3609;&#3588;&#3619;&#3609;&#3634;&#3618;&#3585;)', 'woocommerce' ),
'TH-73' => __( 'Nakhon Pathom (&#3609;&#3588;&#3619;&#3611;&#3600;&#3617;)', 'woocommerce' ),
'TH-48' => __( 'Nakhon Phanom (&#3609;&#3588;&#3619;&#3614;&#3609;&#3617;)', 'woocommerce' ),
'TH-30' => __( 'Nakhon Ratchasima (&#3609;&#3588;&#3619;&#3619;&#3634;&#3594;&#3626;&#3637;&#3617;&#3634;)', 'woocommerce' ),
'TH-60' => __( 'Nakhon Sawan (&#3609;&#3588;&#3619;&#3626;&#3623;&#3619;&#3619;&#3588;&#3660;)', 'woocommerce' ),
'TH-80' => __( 'Nakhon Si Thammarat (&#3609;&#3588;&#3619;&#3624;&#3619;&#3637;&#3608;&#3619;&#3619;&#3617;&#3619;&#3634;&#3594;)', 'woocommerce' ),
'TH-55' => __( 'Nan (&#3609;&#3656;&#3634;&#3609;)', 'woocommerce' ),
'TH-96' => __( 'Narathiwat (&#3609;&#3619;&#3634;&#3608;&#3636;&#3623;&#3634;&#3626;)', 'woocommerce' ),
'TH-39' => __( 'Nong Bua Lam Phu (&#3627;&#3609;&#3629;&#3591;&#3610;&#3633;&#3623;&#3621;&#3635;&#3616;&#3641;)', 'woocommerce' ),
'TH-43' => __( 'Nong Khai (&#3627;&#3609;&#3629;&#3591;&#3588;&#3634;&#3618;)', 'woocommerce' ),
'TH-12' => __( 'Nonthaburi (&#3609;&#3609;&#3607;&#3610;&#3640;&#3619;&#3637;)', 'woocommerce' ),
'TH-13' => __( 'Pathum Thani (&#3611;&#3607;&#3640;&#3617;&#3608;&#3634;&#3609;&#3637;)', 'woocommerce' ),
'TH-94' => __( 'Pattani (&#3611;&#3633;&#3605;&#3605;&#3634;&#3609;&#3637;)', 'woocommerce' ),
'TH-82' => __( 'Phang Nga (&#3614;&#3633;&#3591;&#3591;&#3634;)', 'woocommerce' ),
'TH-93' => __( 'Phatthalung (&#3614;&#3633;&#3607;&#3621;&#3640;&#3591;)', 'woocommerce' ),
'TH-56' => __( 'Phayao (&#3614;&#3632;&#3648;&#3618;&#3634;)', 'woocommerce' ),
'TH-67' => __( 'Phetchabun (&#3648;&#3614;&#3594;&#3619;&#3610;&#3641;&#3619;&#3603;&#3660;)', 'woocommerce' ),
'TH-76' => __( 'Phetchaburi (&#3648;&#3614;&#3594;&#3619;&#3610;&#3640;&#3619;&#3637;)', 'woocommerce' ),
'TH-66' => __( 'Phichit (&#3614;&#3636;&#3592;&#3636;&#3605;&#3619;)', 'woocommerce' ),
'TH-65' => __( 'Phitsanulok (&#3614;&#3636;&#3625;&#3603;&#3640;&#3650;&#3621;&#3585;)', 'woocommerce' ),
'TH-54' => __( 'Phrae (&#3649;&#3614;&#3619;&#3656;)', 'woocommerce' ),
'TH-83' => __( 'Phuket (&#3616;&#3641;&#3648;&#3585;&#3655;&#3605;)', 'woocommerce' ),
'TH-25' => __( 'Prachin Buri (&#3611;&#3619;&#3634;&#3592;&#3637;&#3609;&#3610;&#3640;&#3619;&#3637;)', 'woocommerce' ),
'TH-77' => __( 'Prachuap Khiri Khan (&#3611;&#3619;&#3632;&#3592;&#3623;&#3610;&#3588;&#3637;&#3619;&#3637;&#3586;&#3633;&#3609;&#3608;&#3660;)', 'woocommerce' ),
'TH-85' => __( 'Ranong (&#3619;&#3632;&#3609;&#3629;&#3591;)', 'woocommerce' ),
'TH-70' => __( 'Ratchaburi (&#3619;&#3634;&#3594;&#3610;&#3640;&#3619;&#3637;)', 'woocommerce' ),
'TH-21' => __( 'Rayong (&#3619;&#3632;&#3618;&#3629;&#3591;)', 'woocommerce' ),
'TH-45' => __( 'Roi Et (&#3619;&#3657;&#3629;&#3618;&#3648;&#3629;&#3655;&#3604;)', 'woocommerce' ),
'TH-27' => __( 'Sa Kaeo (&#3626;&#3619;&#3632;&#3649;&#3585;&#3657;&#3623;)', 'woocommerce' ),
'TH-47' => __( 'Sakon Nakhon (&#3626;&#3585;&#3621;&#3609;&#3588;&#3619;)', 'woocommerce' ),
'TH-11' => __( 'Samut Prakan (&#3626;&#3617;&#3640;&#3607;&#3619;&#3611;&#3619;&#3634;&#3585;&#3634;&#3619;)', 'woocommerce' ),
'TH-74' => __( 'Samut Sakhon (&#3626;&#3617;&#3640;&#3607;&#3619;&#3626;&#3634;&#3588;&#3619;)', 'woocommerce' ),
'TH-75' => __( 'Samut Songkhram (&#3626;&#3617;&#3640;&#3607;&#3619;&#3626;&#3591;&#3588;&#3619;&#3634;&#3617;)', 'woocommerce' ),
'TH-19' => __( 'Saraburi (&#3626;&#3619;&#3632;&#3610;&#3640;&#3619;&#3637;)', 'woocommerce' ),
'TH-91' => __( 'Satun (&#3626;&#3605;&#3641;&#3621;)', 'woocommerce' ),
'TH-17' => __( 'Sing Buri (&#3626;&#3636;&#3591;&#3627;&#3660;&#3610;&#3640;&#3619;&#3637;)', 'woocommerce' ),
'TH-33' => __( 'Sisaket (&#3624;&#3619;&#3637;&#3626;&#3632;&#3648;&#3585;&#3625;)', 'woocommerce' ),
'TH-90' => __( 'Songkhla (&#3626;&#3591;&#3586;&#3621;&#3634;)', 'woocommerce' ),
'TH-64' => __( 'Sukhothai (&#3626;&#3640;&#3650;&#3586;&#3607;&#3633;&#3618;)', 'woocommerce' ),
'TH-72' => __( 'Suphan Buri (&#3626;&#3640;&#3614;&#3619;&#3619;&#3603;&#3610;&#3640;&#3619;&#3637;)', 'woocommerce' ),
'TH-84' => __( 'Surat Thani (&#3626;&#3640;&#3619;&#3634;&#3625;&#3598;&#3619;&#3660;&#3608;&#3634;&#3609;&#3637;)', 'woocommerce' ),
'TH-32' => __( 'Surin (&#3626;&#3640;&#3619;&#3636;&#3609;&#3607;&#3619;&#3660;)', 'woocommerce' ),
'TH-63' => __( 'Tak (&#3605;&#3634;&#3585;)', 'woocommerce' ),
'TH-92' => __( 'Trang (&#3605;&#3619;&#3633;&#3591;)', 'woocommerce' ),
'TH-23' => __( 'Trat (&#3605;&#3619;&#3634;&#3604;)', 'woocommerce' ),
'TH-34' => __( 'Ubon Ratchathani (&#3629;&#3640;&#3610;&#3621;&#3619;&#3634;&#3594;&#3608;&#3634;&#3609;&#3637;)', 'woocommerce' ),
'TH-41' => __( 'Udon Thani (&#3629;&#3640;&#3604;&#3619;&#3608;&#3634;&#3609;&#3637;)', 'woocommerce' ),
'TH-61' => __( 'Uthai Thani (&#3629;&#3640;&#3607;&#3633;&#3618;&#3608;&#3634;&#3609;&#3637;)', 'woocommerce' ),
'TH-53' => __( 'Uttaradit (&#3629;&#3640;&#3605;&#3619;&#3604;&#3636;&#3605;&#3606;&#3660;)', 'woocommerce' ),
'TH-95' => __( 'Yala (&#3618;&#3632;&#3621;&#3634;)', 'woocommerce' ),
'TH-35' => __( 'Yasothon (&#3618;&#3650;&#3626;&#3608;&#3619;)', 'woocommerce' )
);

67
i18n/states/US.php Normal file
View File

@ -0,0 +1,67 @@
<?php
/**
* United States
*
* @author WooThemes
* @category i18n
* @package WooCommerce/i18n
* @version 2.0.0
*/
global $states;
$states['US'] = array(
'AL' => __( 'Alabama', 'woocommerce' ),
'AK' => __( 'Alaska', 'woocommerce' ),
'AZ' => __( 'Arizona', 'woocommerce' ),
'AR' => __( 'Arkansas', 'woocommerce' ),
'CA' => __( 'California', 'woocommerce' ),
'CO' => __( 'Colorado', 'woocommerce' ),
'CT' => __( 'Connecticut', 'woocommerce' ),
'DE' => __( 'Delaware', 'woocommerce' ),
'DC' => __( 'District Of Columbia', 'woocommerce' ),
'FL' => __( 'Florida', 'woocommerce' ),
'GA' => __( 'Georgia', 'woocommerce' ),
'HI' => __( 'Hawaii', 'woocommerce' ),
'ID' => __( 'Idaho', 'woocommerce' ),
'IL' => __( 'Illinois', 'woocommerce' ),
'IN' => __( 'Indiana', 'woocommerce' ),
'IA' => __( 'Iowa', 'woocommerce' ),
'KS' => __( 'Kansas', 'woocommerce' ),
'KY' => __( 'Kentucky', 'woocommerce' ),
'LA' => __( 'Louisiana', 'woocommerce' ),
'ME' => __( 'Maine', 'woocommerce' ),
'MD' => __( 'Maryland', 'woocommerce' ),
'MA' => __( 'Massachusetts', 'woocommerce' ),
'MI' => __( 'Michigan', 'woocommerce' ),
'MN' => __( 'Minnesota', 'woocommerce' ),
'MS' => __( 'Mississippi', 'woocommerce' ),
'MO' => __( 'Missouri', 'woocommerce' ),
'MT' => __( 'Montana', 'woocommerce' ),
'NE' => __( 'Nebraska', 'woocommerce' ),
'NV' => __( 'Nevada', 'woocommerce' ),
'NH' => __( 'New Hampshire', 'woocommerce' ),
'NJ' => __( 'New Jersey', 'woocommerce' ),
'NM' => __( 'New Mexico', 'woocommerce' ),
'NY' => __( 'New York', 'woocommerce' ),
'NC' => __( 'North Carolina', 'woocommerce' ),
'ND' => __( 'North Dakota', 'woocommerce' ),
'OH' => __( 'Ohio', 'woocommerce' ),
'OK' => __( 'Oklahoma', 'woocommerce' ),
'OR' => __( 'Oregon', 'woocommerce' ),
'PA' => __( 'Pennsylvania', 'woocommerce' ),
'RI' => __( 'Rhode Island', 'woocommerce' ),
'SC' => __( 'South Carolina', 'woocommerce' ),
'SD' => __( 'South Dakota', 'woocommerce' ),
'TN' => __( 'Tennessee', 'woocommerce' ),
'TX' => __( 'Texas', 'woocommerce' ),
'UT' => __( 'Utah', 'woocommerce' ),
'VT' => __( 'Vermont', 'woocommerce' ),
'VA' => __( 'Virginia', 'woocommerce' ),
'WA' => __( 'Washington', 'woocommerce' ),
'WV' => __( 'West Virginia', 'woocommerce' ),
'WI' => __( 'Wisconsin', 'woocommerce' ),
'WY' => __( 'Wyoming', 'woocommerce' ),
'AA' => __( 'Armed Forces (AA)', 'woocommerce' ),
'AE' => __( 'Armed Forces (AE)', 'woocommerce' ),
'AP' => __( 'Armed Forces (AP)', 'woocommerce' )
);

22
i18n/states/ZA.php Normal file
View File

@ -0,0 +1,22 @@
<?php
/**
* South African states
*
* @author WooThemes
* @category i18n
* @package WooCommerce/i18n
* @version 2.0.0
*/
global $states;
$states['ZA'] = array(
'EC' => __( 'Eastern Cape', 'woocommerce' ) ,
'FS' => __( 'Free State', 'woocommerce' ) ,
'GP' => __( 'Gauteng', 'woocommerce' ) ,
'KZN' => __( 'KwaZulu-Natal', 'woocommerce' ) ,
'LP' => __( 'Limpopo', 'woocommerce' ) ,
'MP' => __( 'Mpumalanga', 'woocommerce' ) ,
'NC' => __( 'Northern Cape', 'woocommerce' ) ,
'NW' => __( 'North West', 'woocommerce' ) ,
'WC' => __( 'Western Cape', 'woocommerce' )
);

View File

@ -5,9 +5,9 @@
* This file holds localisation strings that are scanned by localisation plugins. It is not included anywhere.
*
* @author WooThemes
* @category Languages
* @package WooCommerce/Languages
* @version 1.6.4
* @category i18n
* @package WooCommerce/i18n
* @version 2.0.0
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -191,12 +191,14 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* Feature - Revised the way coupons are stored per order and added new coupon reports on usage.
* Feature - Updated/new dummy data (including .csv files to be used with [Product CSV Import Suite](http://www.woothemes.com/products/product-csv-import-suite/)).
* Feature - Option to hold stock for unpaid orders (defaults to 60mins). When this time limit is reached, and the order is not paid for, stock is released and the order is cancelled.
* Feature - Added set_stock() method to product class.
* Templating - Revised pagination, sorting areas (sorting is now above products, numbered pagination below) and added a result count.
* Templating - email-order-items.php change get_downloadable_file_url() to get_downloadable_file_urls() to support multiple files.
* Templating - loop-end and start for product loops, allow changing the UL's used by default to something else.
* Templating - woocommerce_page_title function for archive titles.
* Templating - CSS namespacing changes (courtesy of Brian Feister).
* Templating - My account page broken up into template files (by Brian Richards)
* Tweak - Cron jobs for scheduled sales.
* Tweak - Improved product data panels.
@ -244,6 +246,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* Localization - French update by Arnaud Cheminand and absoluteweb.
* Localization - Romanian update by silviu-bucsa and a1ur3l.
* Localization - Dutch updates by Ramoonus.
* Localization - Swedish updates by Mikael Jorhult.
* Localization - Localized shortcode button.
* Localization - Norwegian translation by frilyd.
* Localization - Italian update by Giuseppe-Mazzapica.
@ -1165,6 +1168,8 @@ The biggest change is that we're redone order item storage making them easier (a
Order items are no longer serialised data and store in meta - they are stored in there own table with their own meta. Existing data can be updated upon upgrade (you will be prompted). You should backup before upgrading.
On the frontend; if your store is overwriting the core WooCommerce CSS you will need to prefix those overrides with the .woocommerce class as we do in woocommerce.css as of 2.0.
= 1.6.2 =
1.6 introduced some template changes, for loops in particular. See the changelog for details and ensure theme compatibility before upgrading.

View File

@ -69,31 +69,26 @@ function get_woocommerce_view_order() {
* @return void
*/
function woocommerce_my_account( $atts ) {
global $woocommerce, $current_user;
global $woocommerce;
$woocommerce->nocache();
if ( ! is_user_logged_in() ) :
if ( ! is_user_logged_in() ) {
woocommerce_get_template( 'myaccount/form-login.php' );
else :
} else {
extract(shortcode_atts(array(
'recent_orders' => 5
), $atts));
$recent_orders = ('all' == $recent_orders) ? -1 : $recent_orders;
get_currentuserinfo();
extract( shortcode_atts( array(
'order_count' => 5
), $atts ) );
woocommerce_get_template( 'myaccount/my-account.php', array(
'current_user' => $current_user,
'recent_orders' => $recent_orders
'current_user' => get_user_by( 'id', get_current_user_id() ),
'order_count' => 'all' == $order_count ? -1 : $order_count
) );
endif;
}
}
/**
@ -282,7 +277,7 @@ function woocommerce_view_order() {
$order = new WC_Order( $order_id );
if ( $order_id == 0 ) {
woocommerce_get_template('myaccount/my-orders.php', array( 'recent_orders' => 10 ));
woocommerce_get_template('myaccount/my-orders.php', array( 'order_count' => 10 ));
return;
}

View File

@ -16,7 +16,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
<p><?php _e( 'If this was a mistake, just ignore this email and nothing will happen.', 'woocommerce' ); ?></p>
<p><?php _e( 'To reset your password, visit the following address:', 'woocommerce' ); ?></p>
<p>
<a href="<?php echo esc_url( get_permalink( woocommerce_get_page_id( 'lost_password' ) ) . sprintf( '?key=%s&login=%s', $reset_key, $user_login ) ); ?>">
<a href="<?php echo esc_url( add_query_arg( array( 'key' => $reset_key, 'login' => rawurlencode( $user_login ) ), get_permalink( woocommerce_get_page_id( 'lost_password' ) ) ) ); ?>">
<?php _e( 'Click here to reset your password', 'woocommerce' ); ?></a>
</p>
<p></p>

View File

@ -18,15 +18,18 @@ if ( ! woocommerce_products_will_display() )
?>
<p class="woocommerce_result_count">
<?php
$paged = max( 1, $wp_query->get( 'paged' ) );
$per_page = $wp_query->get( 'posts_per_page' );
$max = $wp_query->found_posts;
$first = ( $per_page * $paged ) - $per_page + 1;
$last = $wp_query->get( 'posts_per_page' ) * $paged;
$paged = max( 1, $wp_query->get( 'paged' ) );
$per_page = $wp_query->get( 'posts_per_page' );
$total = $wp_query->found_posts;
$first = ( $per_page * $paged ) - $per_page + 1;
$last = min( $total, $wp_query->get( 'posts_per_page' ) * $paged );
if ( $last > $max )
$last = $max;
printf( __( 'Showing %s - %s of %s results', 'woocommerce' ), $first, $last, $max );
if ( 1 == $total ) {
_e( 'Showing the single result', 'woocommerce' );
} elseif ( $total <= $per_page ) {
printf( __( 'Showing all %d results', 'woocommerce' ), $total );
} else {
printf( _x( 'Showing %1$d%2$d of %3$d results', '%1$d = first, %2$d = last, %3$d = total', 'woocommerce' ), $first, $last, $total );
}
?>
</p>

View File

@ -39,10 +39,11 @@ get_currentuserinfo();
endforeach;
?>
<input type="submit" class="button" name="save_address" value="<?php _e( 'Save Address', 'woocommerce' ); ?>" />
<?php $woocommerce->nonce_field('edit_address') ?>
<input type="hidden" name="action" value="edit_address" />
<p>
<input type="submit" class="button" name="save_address" value="<?php _e( 'Save Address', 'woocommerce' ); ?>" />
<?php $woocommerce->nonce_field('edit_address') ?>
<input type="hidden" name="action" value="edit_address" />
</p>
</form>

View File

@ -4,7 +4,7 @@
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 1.6.4
* @version 2.0.0
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@ -13,42 +13,21 @@ global $woocommerce;
$woocommerce->show_messages(); ?>
<p class="myaccount_user"><?php printf( __( 'Hello, <strong>%s</strong>. From your account dashboard you can view your recent orders, manage your shipping and billing addresses and <a href="%s">change your password</a>.', 'woocommerce' ), $current_user->display_name, get_permalink( woocommerce_get_page_id( 'change_password' ) ) ); ?></p>
<p class="myaccount_user">
<?php
printf(
__( 'Hello, <strong>%s</strong>. From your account dashboard you can view your recent orders, manage your shipping and billing addresses and <a href="%s">change your password</a>.', 'woocommerce' ),
$current_user->display_name,
get_permalink( woocommerce_get_page_id( 'change_password' ) )
);
?>
</p>
<?php do_action( 'woocommerce_before_my_account' ); ?>
<?php if ( $downloads = $woocommerce->customer->get_downloadable_products() ) : ?>
<?php woocommerce_get_template( 'myaccount/my-downloads.php' ); ?>
<h2><?php _e( 'Available downloads', 'woocommerce' ); ?></h2>
<ul class="digital-downloads">
<?php foreach ( $downloads as $download ) : ?>
<li>
<?php
do_action( 'woocommerce_available_download_start', $download );
if ( is_numeric( $download['downloads_remaining'] ) )
echo apply_filters( 'woocommerce_available_download_count', '<span class="count">' . sprintf( _n( '%s download remaining', '%s downloads remaining', $download['downloads_remaining'], 'woocommerce' ), $download['downloads_remaining'] ) . '</span> ', $download );
echo apply_filters( 'woocommerce_available_download_link', '<a href="' . esc_url( $download['download_url'] ) . '">' . $download['download_name'] . '</a>', $download );
do_action( 'woocommerce_available_download_end', $download );
?>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<h2><?php _e( 'Recent Orders', 'woocommerce' ); ?></h2>
<?php woocommerce_get_template( 'myaccount/my-orders.php', array( 'recent_orders' => $recent_orders ) ); ?>
<h2><?php _e( 'My Address', 'woocommerce' ); ?></h2>
<p class="myaccount_address"><?php _e( 'The following addresses will be used on the checkout page by default.', 'woocommerce' ); ?></p>
<?php woocommerce_get_template( 'myaccount/my-orders.php', array( 'order_count' => $order_count ) ); ?>
<?php woocommerce_get_template( 'myaccount/my-address.php' ); ?>

View File

@ -4,7 +4,7 @@
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 1.6.4
* @version 2.0.0
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@ -12,73 +12,62 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $woocommerce;
$customer_id = get_current_user_id();
if ( get_option('woocommerce_ship_to_billing_address_only') == 'no' ) {
$page_title = apply_filters( 'woocommerce_my_account_my_address_title', __( 'My Addresses', 'woocommerce' ) );
$get_addresses = array(
'billing' => __( 'Billing Address', 'woocommerce' ),
'shipping' => __( 'Shipping Address', 'woocommerce' )
);
} else {
$page_title = apply_filters( 'woocommerce_my_account_my_address_title', __( 'My Address', 'woocommerce' ) );
$get_addresses = array(
'billing' => __( 'Billing Address', 'woocommerce' )
);
}
$col = 1;
?>
<?php if (get_option('woocommerce_ship_to_billing_address_only')=='no') : ?>
<h2><?php echo $page_title; ?></h2>
<div class="col2-set addresses">
<p class="myaccount_address">
<?php echo apply_filters( 'woocommerce_my_account_my_address_description', __( 'The following addresses will be used on the checkout page by default.', 'woocommerce' ) ); ?>
</p>
<div class="col-1">
<?php if ( get_option('woocommerce_ship_to_billing_address_only') == 'no' ) echo '<div class="col2-set addresses">'; ?>
<?php endif; ?>
<?php foreach ( $get_addresses as $name => $title ) : ?>
<header class="title">
<h3><?php _e( 'Billing Address', 'woocommerce' ); ?></h3>
<a href="<?php echo esc_url( add_query_arg('address', 'billing', get_permalink(woocommerce_get_page_id('edit_address'))) ); ?>" class="edit"><?php _e( 'Edit', 'woocommerce' ); ?></a>
</header>
<address>
<?php
$address = array(
'first_name' => get_user_meta( $customer_id, 'billing_first_name', true ),
'last_name' => get_user_meta( $customer_id, 'billing_last_name', true ),
'company' => get_user_meta( $customer_id, 'billing_company', true ),
'address_1' => get_user_meta( $customer_id, 'billing_address_1', true ),
'address_2' => get_user_meta( $customer_id, 'billing_address_2', true ),
'city' => get_user_meta( $customer_id, 'billing_city', true ),
'state' => get_user_meta( $customer_id, 'billing_state', true ),
'postcode' => get_user_meta( $customer_id, 'billing_postcode', true ),
'country' => get_user_meta( $customer_id, 'billing_country', true )
);
<div class="col-<?php echo ( ( $col = $col * -1 ) < 0 ) ? 1 : 2; ?> address">
<header class="title">
<h3><?php echo $title; ?></h3>
<a href="<?php echo esc_url( add_query_arg('address', $name, get_permalink(woocommerce_get_page_id( 'edit_address' ) ) ) ); ?>" class="edit"><?php _e( 'Edit', 'woocommerce' ); ?></a>
</header>
<address>
<?php
$address = array(
'first_name' => get_user_meta( $customer_id, $name . '_first_name', true ),
'last_name' => get_user_meta( $customer_id, $name . '_last_name', true ),
'company' => get_user_meta( $customer_id, $name . '_company', true ),
'address_1' => get_user_meta( $customer_id, $name . '_address_1', true ),
'address_2' => get_user_meta( $customer_id, $name . '_address_2', true ),
'city' => get_user_meta( $customer_id, $name . '_city', true ),
'state' => get_user_meta( $customer_id, $name . '_state', true ),
'postcode' => get_user_meta( $customer_id, $name . '_postcode', true ),
'country' => get_user_meta( $customer_id, $name . '_country', true )
);
$formatted_address = $woocommerce->countries->get_formatted_address( $address );
$formatted_address = $woocommerce->countries->get_formatted_address( $address );
if (!$formatted_address) _e( 'You have not set up a billing address yet.', 'woocommerce' ); else echo $formatted_address;
?>
</address>
if ( ! $formatted_address )
_e( 'You have not set up this type of address yet.', 'woocommerce' );
else
echo $formatted_address;
?>
</address>
</div>
<?php endforeach; ?>
<?php if (get_option('woocommerce_ship_to_billing_address_only')=='no') : ?>
</div><!-- /.col-1 -->
<div class="col-2">
<header class="title">
<h3><?php _e( 'Shipping Address', 'woocommerce' ); ?></h3>
<a href="<?php echo esc_url( add_query_arg('address', 'shipping', get_permalink(woocommerce_get_page_id('edit_address'))) ); ?>" class="edit"><?php _e( 'Edit', 'woocommerce' ); ?></a>
</header>
<address>
<?php
$address = array(
'first_name' => get_user_meta( $customer_id, 'shipping_first_name', true ),
'last_name' => get_user_meta( $customer_id, 'shipping_last_name', true ),
'company' => get_user_meta( $customer_id, 'shipping_company', true ),
'address_1' => get_user_meta( $customer_id, 'shipping_address_1', true ),
'address_2' => get_user_meta( $customer_id, 'shipping_address_2', true ),
'city' => get_user_meta( $customer_id, 'shipping_city', true ),
'state' => get_user_meta( $customer_id, 'shipping_state', true ),
'postcode' => get_user_meta( $customer_id, 'shipping_postcode', true ),
'country' => get_user_meta( $customer_id, 'shipping_country', true )
);
$formatted_address = $woocommerce->countries->get_formatted_address( $address );
if (!$formatted_address) _e( 'You have not set up a shipping address yet.', 'woocommerce' ); else echo $formatted_address;
?>
</address>
</div><!-- /.col-2 -->
</div><!-- /.col2-set -->
<?php endif; ?>
<?php if ( get_option('woocommerce_ship_to_billing_address_only') == 'no' ) echo '</div>'; ?>

Some files were not shown because too many files have changed in this diff Show More