Bulk edit sales schedule on variations

Closes #6300
This commit is contained in:
Mike Jolley 2014-11-17 16:50:25 +00:00
parent e6a5825f8c
commit a0bf72f7b5
5 changed files with 25 additions and 2 deletions

View File

@ -298,6 +298,25 @@ jQuery( function ( $ ) {
$( ':input[name^="' + bulk_edit + '"]').not('[name*="dates"]').val( value ).change();
}
break;
case 'variable_sale_schedule' :
var start = window.prompt( woocommerce_admin_meta_boxes_variations.i18n_scheduled_sale_start );
var end = window.prompt( woocommerce_admin_meta_boxes_variations.i18n_scheduled_sale_end );
var set = false;
if ( start != null && start != '' ) {
$('.woocommerce_variable_attributes .sale_schedule').click();
$( ':input[name^="variable_sale_price_dates_from"]').val( start ).change();
set = true;
}
if ( end != null && end != '') {
$('.woocommerce_variable_attributes .sale_schedule').click();
$( ':input[name^="variable_sale_price_dates_to"]').val( end ).change();
set = true;
}
if ( ! set ) {
$('.woocommerce_variable_attributes .cancel_sale_schedule').click();
}
break;
default:
$( 'select#field_to_edit' ).trigger( bulk_edit );
break;

File diff suppressed because one or more lines are too long

View File

@ -162,7 +162,9 @@ class WC_Admin_Assets {
'i18n_variation_added' => esc_js( __( "variation added", 'woocommerce' ) ),
'i18n_variations_added' => esc_js( __( "variations added", 'woocommerce' ) ),
'i18n_no_variations_added' => esc_js( __( "No variations added", 'woocommerce' ) ),
'i18n_remove_variation' => esc_js( __( 'Are you sure you want to remove this variation?', 'woocommerce' ) )
'i18n_remove_variation' => esc_js( __( 'Are you sure you want to remove this variation?', 'woocommerce' ) ),
'i18n_scheduled_sale_start' => esc_js( __( 'Sale start date (YYYY-MM-DD format or leave blank)', 'woocommerce' ) ),
'i18n_scheduled_sale_end' => esc_js( __( 'Sale end date (YYYY-MM-DD format or leave blank)', 'woocommerce' ) )
);
wp_localize_script( 'wc-admin-variation-meta-boxes', 'woocommerce_admin_meta_boxes_variations', $params );

View File

@ -830,6 +830,7 @@ class WC_Meta_Box_Product_Data {
<option value="variable_sale_price"><?php _e( 'Sale prices', 'woocommerce' ); ?></option>
<option value="variable_sale_price_increase"><?php _e( 'Sale prices increase by (fixed amount or %)', 'woocommerce' ); ?></option>
<option value="variable_sale_price_decrease"><?php _e( 'Sale prices decrease by (fixed amount or %)', 'woocommerce' ); ?></option>
<option value="variable_sale_schedule"><?php _e( 'Scheduled sale dates', 'woocommerce' ); ?></option>
</optgroup>
<optgroup label="<?php esc_attr_e( 'Inventory', 'woocommerce' ); ?>">
<option value="toggle_manage_stock"><?php _e( 'Toggle &quot;Manage stock&quot;', 'woocommerce' ); ?></option>

View File

@ -134,6 +134,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* Feature - Made tax importer expand postcode ranges.
* Feature - Print styles for reports.
* Feature - Remove products from the cart in the widget.
* Feature - Bulk edit sales schedule on variations.
* Refactor - Removed deprecated methods from WC_Frontend_Scripts and rewrote script registration and localization to run once.
* Refactor - Routing all email functionality through one send() method.
* Refactor - Replaced existing email css inliner with Emogrifier.