Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Julian Jöris 2011-11-24 11:44:38 +01:00
commit e6adfeb470
14 changed files with 494 additions and 319 deletions

View File

@ -88,6 +88,7 @@ function woocommerce_admin_scripts() {
wp_enqueue_script( 'jquery-ui-datepicker' ); wp_enqueue_script( 'jquery-ui-datepicker' );
wp_enqueue_script( 'media-upload' ); wp_enqueue_script( 'media-upload' );
wp_enqueue_script( 'thickbox' ); wp_enqueue_script( 'thickbox' );
wp_enqueue_script('chosen');
$woocommerce_witepanel_params = array( $woocommerce_witepanel_params = array(
'remove_item_notice' => __("Remove this item? If you have previously reduced this item's stock, or this order was submitted by a customer, will need to manually restore the item's stock.", 'woothemes'), 'remove_item_notice' => __("Remove this item? If you have previously reduced this item's stock, or this order was submitted by a customer, will need to manually restore the item's stock.", 'woothemes'),

View File

@ -136,6 +136,8 @@ function woocommerce_admin_fields($options) {
global $woocommerce; global $woocommerce;
foreach ($options as $value) : foreach ($options as $value) :
if (!isset( $value['class'] )) $value['class'] = '';
if (!isset( $value['css'] )) $value['css'] = '';
switch($value['type']) : switch($value['type']) :
case 'title': case 'title':
if (isset($value['name']) && $value['name']) echo '<h3>'.$value['name'].'</h3>'; if (isset($value['name']) && $value['name']) echo '<h3>'.$value['name'].'</h3>';
@ -227,10 +229,12 @@ function woocommerce_admin_fields($options) {
$page_setting = (int) get_option($value['id']); $page_setting = (int) get_option($value['id']);
$args = array( 'name' => $value['id'], $args = array( 'name' => $value['id'],
'id' => $value['id']. '" style="width: 200px;', 'id' => $value['id'],
'sort_column' => 'menu_order', 'sort_column' => 'menu_order',
'sort_order' => 'ASC', 'sort_order' => 'ASC',
'show_option_none' => __('Select a page...', 'woothemes'), 'show_option_none' => ' ',
'class' => $value['class'],
'echo' => false,
'selected' => $page_setting); 'selected' => $page_setting);
if( isset($value['args']) ) $args = wp_parse_args($value['args'], $args); if( isset($value['args']) ) $args = wp_parse_args($value['args'], $args);
@ -238,7 +242,7 @@ function woocommerce_admin_fields($options) {
?><tr valign="top" class="single_select_page"> ?><tr valign="top" class="single_select_page">
<th scope="row" class="titledesc"><?php echo $value['name'] ?></th> <th scope="row" class="titledesc"><?php echo $value['name'] ?></th>
<td class="forminp"> <td class="forminp">
<?php wp_dropdown_pages($args); ?> <span class="description"><?php echo $value['desc'] ?></span> <?php echo str_replace(' id=', " data-placeholder='".__('Select a page...', 'woothemes')."' style='".$value['css']."' class='".$value['class']."' id=", wp_dropdown_pages($args)); ?> <span class="description"><?php echo $value['desc'] ?></span>
</td> </td>
</tr><?php </tr><?php
break; break;
@ -284,15 +288,40 @@ function woocommerce_admin_fields($options) {
?><tr valign="top"> ?><tr valign="top">
<th scope="row" class="titledesc"><?php echo $value['name'] ?></th> <th scope="row" class="titledesc"><?php echo $value['name'] ?></th>
<td class="forminp" id="tax_rates"> <td class="forminp">
<div class="taxrows">
<table class="taxrows widefat" cellspacing="0">
<thead>
<tr>
<th class="check-column"><input type="checkbox"></th>
<th class="country"><?php _e('Countries/states', 'woothemes'); ?></th>
<th><?php _e('Tax Class', 'woothemes'); ?></th>
<th><?php _e('Rate', 'woothemes'); ?> <a class="tips" tip="<?php _e('Enter a tax rate (percentage) to 4 decimal places.', 'woothemes'); ?>">[?]</a></th>
<th><?php _e('Apply to shipping', 'woothemes'); ?> <a class="tips" tip="<?php _e('Choose whether or not this tax rate also gets applied to shipping.', 'woothemes'); ?>">[?]</a></th>
</tr>
</thead>
<tfoot>
<tr>
<th colspan="2"><a href="#" class="add button"><?php _e('+ Add Tax Rate', 'woothemes'); ?></a></th>
<th colspan="3"><a href="#" class="dupe button"><?php _e('Duplicate selected rows', 'woothemes'); ?></a> <a href="#" class="remove button"><?php _e('Delete selected rows', 'woothemes'); ?></a></th>
</tr>
</tfoot>
<tbody id="tax_rates">
<?php $i = -1; if ($tax_rates && is_array($tax_rates) && sizeof($tax_rates)>0) foreach( $tax_rates as $rate ) : $i++; ?> <?php $i = -1; if ($tax_rates && is_array($tax_rates) && sizeof($tax_rates)>0) foreach( $tax_rates as $rate ) : $i++; ?>
<div class="taxrow"> <tr class="tax_rate">
<select name="tax_country[<?php echo $i; ?>][]" title="Country" class="country_multiselect" size="10" multiple="multiple"> <td class="check-column"><input type="checkbox" name="select" /></td>
<td class="country">
<p class="edit"><button class="edit_options button"><?php _e('Edit', 'woothemes') ?></button> <label><?php echo woocommerce_tax_row_label( $rate['countries'] ); ?></label></p>
<div class="options" style="display:none">
<select name="tax_country[<?php echo $i; ?>][]" data-placeholder="<?php _e('Select countries/states&hellip;', 'woothemes'); ?>" class="tax_chosen_select select" size="10" multiple="multiple">
<?php echo $woocommerce->countries->country_multiselect_options( $rate['countries'] ); ?> <?php echo $woocommerce->countries->country_multiselect_options( $rate['countries'] ); ?>
</select> </select>
<select name="tax_class[<?php echo $i; ?>]" title="Tax Class"> <?php echo '<p><button class="select_all button">'.__('All', 'woothemes').'</button><button class="select_none button">'.__('None', 'woothemes').'</button><button class="button select_us_states">'.__('US States', 'woothemes').'</button><button class="button select_europe">'.__('EU States', 'woothemes').'</button></p>'; ?>
</div>
</td>
<td class="tax_class">
<select name="tax_class[<?php echo $i; ?>]" title="Tax Class" class="select">
<option value=""><?php _e('Standard Rate', 'woothemes'); ?></option> <option value=""><?php _e('Standard Rate', 'woothemes'); ?></option>
<?php <?php
if ($tax_classes) foreach ($tax_classes as $class) : if ($tax_classes) foreach ($tax_classes as $class) :
@ -302,46 +331,142 @@ function woocommerce_admin_fields($options) {
endforeach; endforeach;
?> ?>
</select> </select>
</td>
<td class="rate">
<input type="text" class="text" value="<?php echo esc_attr( $rate['rate'] ); ?>" name="tax_rate[<?php echo $i; ?>]" title="<?php _e('Rate', 'woothemes'); ?>" placeholder="<?php _e('Rate', 'woothemes'); ?>" maxlength="8" />% <input type="text" class="text" value="<?php echo esc_attr( $rate['rate'] ); ?>" name="tax_rate[<?php echo $i; ?>]" title="<?php _e('Rate', 'woothemes'); ?>" placeholder="<?php _e('Rate', 'woothemes'); ?>" maxlength="8" />%
<label class="checkbox"><input type="checkbox" name="tax_shipping[<?php echo $i; ?>]" <?php if (isset($rate['shipping'])) checked($rate['shipping'], 'yes'); ?> /> <?php _e('Apply to shipping', 'woothemes'); ?></label><a href="#" class="remove button">&times;</a> </td>
</div> <td class="apply_to_shipping">
<input type="checkbox" class="checkbox" name="tax_shipping[<?php echo $i; ?>]" <?php if (isset($rate['shipping'])) checked($rate['shipping'], 'yes'); ?> />
</td>
</tr>
<?php endforeach; ?> <?php endforeach; ?>
</div> </tbody>
<p><a href="#" class="add button"><?php _e('+ Add Tax Rule', 'woothemes'); ?></a></p> </table>
<script type="text/javascript"> <script type="text/javascript">
jQuery(function() { jQuery(function() {
// Tax
jQuery('#tax_rates a.add').live('click', function(){ jQuery('tr.tax_rate .edit_options').live('click', function(){
var size = jQuery('.taxrows .taxrow').size(); jQuery(this).closest('td').find('.options').slideToggle();
if (jQuery(this).text()=='<?php _e('Edit', 'woothemes'); ?>') {
jQuery(this).closest('tr').find("select.tax_chosen_select").chosen();
jQuery(this).text('<?php _e('Done', 'woothemes'); ?>');
} else {
jQuery(this).text('<?php _e('Edit', 'woothemes'); ?>');
}
return false;
});
jQuery('tr.tax_rate .select_all').live('click', function(){
jQuery(this).closest('td').find('select option').attr("selected","selected");
jQuery(this).closest('td').find('select.tax_chosen_select').trigger("change");
return false;
});
jQuery('tr.tax_rate .select_none').live('click', function(){
jQuery(this).closest('td').find('select option').removeAttr("selected");
jQuery(this).closest('td').find('select.tax_chosen_select').trigger("change");
return false;
});
jQuery('tr.tax_rate .select_us_states').live('click', function(){
jQuery(this).closest('td').find('select optgroup[label="United States"] option').attr("selected","selected");
jQuery(this).closest('td').find('select.tax_chosen_select').trigger("change");
return false;
});
jQuery('tr.tax_rate .options select').live('change', function(){
jQuery(this).trigger("liszt:updated");
jQuery(this).closest('td').find('label').text( jQuery(":selected", this).length + '<?php _e(' countries/states selected', 'woothemes') ?>' );
});
jQuery('tr.tax_rate .select_europe').live('click', function(){
jQuery(this).closest('td').find('option[value="AL"], option[value="AD"], option[value="AM"], option[value="AT"], option[value="BY"], option[value="BE"], option[value="BA"], option[value="BG"], option[value="CH"], option[value="CY"], option[value="CZ"], option[value="DE"], option[value="DK"], option[value="EE"], option[value="ES"], option[value="FO"], option[value="FI"], option[value="FR"], option[value="GB"], option[value="GE"], option[value="GI"], option[value="GR"], option[value="HU"], option[value="HR"], option[value="IE"], option[value="IS"], option[value="IT"], option[value="LT"], option[value="LU"], option[value="LV"], option[value="MC"], option[value="MK"], option[value="MT"], option[value="NO"], option[value="NL"], option[value="PO"], option[value="PT"], option[value="RO"], option[value="RU"], option[value="SE"], option[value="SI"], option[value="SK"], option[value="SM"], option[value="TR"], option[value="UA"], option[value="VA"]').attr("selected","selected");
jQuery(this).closest('td').find('select.tax_chosen_select').trigger("change");
return false;
});
jQuery('.taxrows a.add').live('click', function(){
var size = jQuery('#tax_rates tr').size();
// Add the row // Add the row
jQuery('<div class="taxrow">\ jQuery('<tr class="tax_rate new_rate">\
<select name="tax_country[' + size + '][]" title="Country" class="country_multiselect" size="10" multiple="multiple"><?php echo $woocommerce->countries->country_multiselect_options('',true); ?></select>\ <td class="check-column"><input type="checkbox" name="select" /></td>\
<select name="tax_class[' + size + ']" title="Tax Class"><option value=""><?php _e('Standard Rate', 'woothemes'); ?></option><?php <td class="country">\
<p class="edit"><button class="edit_options button"><?php _e('Edit', 'woothemes') ?></button> <label><?php _e('No countries selected', 'woothemes'); ?></label></p>\
<div class="options" style="display:none">\
<select name="tax_country[' + size + '][]" data-placeholder="<?php _e('Select countries/states&hellip;', 'woothemes'); ?>" class="tax_chosen_select select" size="10" multiple="multiple">\
<?php echo $woocommerce->countries->country_multiselect_options(); ?>\
</select>\
<?php echo '<p><button class="select_all button">'.__('All', 'woothemes').'</button><button class="select_none button">'.__('None', 'woothemes').'</button><button class="button select_us_states">'.__('US States', 'woothemes').'</button><button class="button select_europe">'.__('EU States', 'woothemes').'</button></p>'; ?>\
</div>\
</td>\
<td class="tax_class">\
<select name="tax_class[' + size + ']" title="Tax Class" class="select">\
<option value=""><?php _e('Standard Rate', 'woothemes'); ?></option>\
<?php
if ($tax_classes) foreach ($tax_classes as $class) : if ($tax_classes) foreach ($tax_classes as $class) :
echo '<option value="'.esc_attr( sanitize_title($class) ).'">'.$class.'</option>'; echo '<option value="'.sanitize_title($class).'">'.$class.'</option>';
endforeach; endforeach;
?></select>\ ?>
</select>\
</td>\
<td class="rate">\
<input type="text" class="text" name="tax_rate[' + size + ']" title="<?php _e('Rate', 'woothemes'); ?>" placeholder="<?php _e('Rate', 'woothemes'); ?>" maxlength="8" />%\ <input type="text" class="text" name="tax_rate[' + size + ']" title="<?php _e('Rate', 'woothemes'); ?>" placeholder="<?php _e('Rate', 'woothemes'); ?>" maxlength="8" />%\
<label class="checkbox"><input type="checkbox" name="tax_shipping[' + size + ']" checked="checked" /> <?php _e('Apply to shipping', 'woothemes'); ?></label><a href="#" class="remove button">&times;</a>\ </td>\
</div>').appendTo('#tax_rates div.taxrows'); <td class="apply_to_shipping">\
<input type="checkbox" class="checkbox" name="tax_shipping[' + size + ']" />\
</td>\
</tr>').appendTo('#tax_rates');
// Multiselect jQuery(".new_rate select.tax_chosen_select").chosen();
jQuery(".country_multiselect").multiselect({ jQuery(".new_rate").removeClass('new_rate');
noneSelectedText: '<?php _e('Select countries/states', 'woothemes'); ?>',
selectedList: 4
});
return false; return false;
}); });
jQuery('#tax_rates a.remove').live('click', function(){ // Remove row
var answer = confirm("<?php _e('Delete this rule?', 'woothemes'); ?>"); jQuery('.taxrows a.remove').live('click', function(){
var answer = confirm("<?php _e('Delete the selected rates?', 'woothemes'); ?>")
if (answer) { if (answer) {
jQuery('input', jQuery(this).parent()).val(''); jQuery('table.taxrows tbody tr td.check-column input:checked').each(function(i, el){
jQuery(this).parent().hide(); jQuery(el).closest('tr').find('input.text, input.checkbox, select.select').val('');
jQuery(el).closest('tr').hide();
});
}
return false;
});
// Dupe row
jQuery('.taxrows a.dupe').live('click', function(){
var answer = confirm("<?php _e('Duplicate the selected rates?', 'woothemes'); ?>")
if (answer) {
jQuery('table.taxrows tbody tr td.check-column input:checked').each(function(i, el){
var dupe = jQuery(el).closest('tr').clone()
// Remove chosen selector
dupe.find('.chzn-done').removeClass('chzn-done').removeAttr('id').removeAttr('style');
dupe.find('.chzn-container').remove();
// Append
jQuery('table.taxrows tbody').append( dupe );
});
// Re-index keys
var loop = 0;
jQuery('#tax_rates tr.tax_rate').each(function( index, row ){
jQuery('input.text, input.checkbox, select.select', row).each(function( i, el ){
var t = jQuery(el);
t.attr('name', t.attr('name').replace(/\[([^[]*)\]/, "[" + loop + "]"));
});
loop++;
});
} }
return false; return false;
}); });
@ -355,3 +480,55 @@ function woocommerce_admin_fields($options) {
endswitch; endswitch;
endforeach; endforeach;
} }
/**
* Tax Row Label
*
* Show a label based on user selections
*/
function woocommerce_tax_row_label( $selected ) {
global $woocommerce;
$return = '';
// Get counts/countries
$counties_array = array();
$states_count = 0;
if ($selected) foreach ($selected as $country => $value) :
$country = woocommerce_clean($country);
if (sizeof($value)>1) :
$states_count+=sizeof($value);
endif;
if (!in_array($country, $counties_array)) $counties_array[] = $woocommerce->countries->countries[$country];
endforeach;
$states_text = '';
$countries_text = implode(', ', $counties_array);
// Show label
if (sizeof($counties_array)==0) :
$return .= __('No countries selected', 'woothemes');
elseif ( sizeof($counties_array) < 6 ) :
if ($states_count>0) $states_text = sprintf(_n('(1 state)', '(%s states)', $states_count, 'woothemes'), $states_count);
$return .= sprintf(__('%s', 'woothemes'), $countries_text) . ' ' . $states_text;
else :
if ($states_count>0) $states_text = sprintf(_n('and 1 state', 'and %s states', $states_count, 'woothemes'), $states_count);
$return .= sprintf(_n('1 country', '%1$s countries', sizeof($counties_array), 'woothemes'), sizeof($counties_array)) . ' ' . $states_text;
endif;
return $return;
}

View File

@ -70,10 +70,10 @@ $woocommerce_settings['general'] = apply_filters('woocommerce_general_settings',
'name' => __( 'Allowed Countries', 'woothemes' ), 'name' => __( 'Allowed Countries', 'woothemes' ),
'desc' => __( 'These are countries that you are willing to ship to.', 'woothemes' ), 'desc' => __( 'These are countries that you are willing to ship to.', 'woothemes' ),
'id' => 'woocommerce_allowed_countries', 'id' => 'woocommerce_allowed_countries',
'css' => 'min-width:300px;',
'std' => 'all', 'std' => 'all',
'type' => 'select', 'type' => 'select',
'class' => 'chosen_select', 'class' => 'chosen_select',
'css' => 'min-width:300px;',
'options' => array( 'options' => array(
'all' => __( 'All Countries', 'woothemes' ), 'all' => __( 'All Countries', 'woothemes' ),
'specific' => __( 'Specific Countries', 'woothemes' ) 'specific' => __( 'Specific Countries', 'woothemes' )
@ -251,9 +251,10 @@ $woocommerce_settings['pages'] = apply_filters('woocommerce_page_settings', arra
'name' => __( 'Shop Base Page', 'woothemes' ), 'name' => __( 'Shop Base Page', 'woothemes' ),
'desc' => sprintf( __( 'This sets the base page of your shop.', 'woothemes' ), '<a target="_blank" href="options-permalink.php">', '</a>' ), 'desc' => sprintf( __( 'This sets the base page of your shop.', 'woothemes' ), '<a target="_blank" href="options-permalink.php">', '</a>' ),
'id' => 'woocommerce_shop_page_id', 'id' => 'woocommerce_shop_page_id',
'css' => 'min-width:175px;',
'type' => 'single_select_page', 'type' => 'single_select_page',
'std' => '' 'std' => '',
'class' => 'chosen_select_nostd',
'css' => 'min-width:300px;',
), ),
array( array(
@ -261,6 +262,7 @@ $woocommerce_settings['pages'] = apply_filters('woocommerce_page_settings', arra
'desc' => __( 'This title to show on the shop base page. Leave blank to use the page title.', 'woothemes' ), 'desc' => __( 'This title to show on the shop base page. Leave blank to use the page title.', 'woothemes' ),
'id' => 'woocommerce_shop_page_title', 'id' => 'woocommerce_shop_page_title',
'type' => 'text', 'type' => 'text',
'css' => 'min-width:300px;',
'std' => 'All Products' // Default value for the page title - changed in settings 'std' => 'All Products' // Default value for the page title - changed in settings
), ),
@ -269,10 +271,10 @@ $woocommerce_settings['pages'] = apply_filters('woocommerce_page_settings', arra
'desc' => __( 'If you define a "Terms" page the customer will be asked if they accept them when checking out.', 'woothemes' ), 'desc' => __( 'If you define a "Terms" page the customer will be asked if they accept them when checking out.', 'woothemes' ),
'tip' => '', 'tip' => '',
'id' => 'woocommerce_terms_page_id', 'id' => 'woocommerce_terms_page_id',
'css' => 'min-width:50px;',
'std' => '', 'std' => '',
'type' => 'single_select_page', 'class' => 'chosen_select_nostd',
'args' => 'show_option_none=' . __('None', 'woothemes'), 'css' => 'min-width:300px;',
'type' => 'single_select_page'
), ),
array( array(
@ -321,72 +323,80 @@ $woocommerce_settings['pages'] = apply_filters('woocommerce_page_settings', arra
'name' => __( 'Cart Page', 'woothemes' ), 'name' => __( 'Cart Page', 'woothemes' ),
'desc' => __( 'Page contents: [woocommerce_cart]', 'woothemes' ), 'desc' => __( 'Page contents: [woocommerce_cart]', 'woothemes' ),
'id' => 'woocommerce_cart_page_id', 'id' => 'woocommerce_cart_page_id',
'css' => 'min-width:50px;',
'type' => 'single_select_page', 'type' => 'single_select_page',
'std' => '' 'std' => '',
'class' => 'chosen_select_nostd',
'css' => 'min-width:300px;',
), ),
array( array(
'name' => __( 'Checkout Page', 'woothemes' ), 'name' => __( 'Checkout Page', 'woothemes' ),
'desc' => __( 'Page contents: [woocommerce_checkout]', 'woothemes' ), 'desc' => __( 'Page contents: [woocommerce_checkout]', 'woothemes' ),
'id' => 'woocommerce_checkout_page_id', 'id' => 'woocommerce_checkout_page_id',
'css' => 'min-width:50px;',
'type' => 'single_select_page', 'type' => 'single_select_page',
'std' => '' 'std' => '',
'class' => 'chosen_select_nostd',
'css' => 'min-width:300px;',
), ),
array( array(
'name' => __( 'Pay Page', 'woothemes' ), 'name' => __( 'Pay Page', 'woothemes' ),
'desc' => __( 'Page contents: [woocommerce_pay] Parent: "Checkout"', 'woothemes' ), 'desc' => __( 'Page contents: [woocommerce_pay] Parent: "Checkout"', 'woothemes' ),
'id' => 'woocommerce_pay_page_id', 'id' => 'woocommerce_pay_page_id',
'css' => 'min-width:50px;',
'type' => 'single_select_page', 'type' => 'single_select_page',
'std' => '' 'std' => '',
'class' => 'chosen_select_nostd',
'css' => 'min-width:300px;',
), ),
array( array(
'name' => __('Thanks Page', 'woothemes'), 'name' => __('Thanks Page', 'woothemes'),
'desc' => __( 'Page contents: [woocommerce_thankyou] Parent: "Checkout"', 'woothemes' ), 'desc' => __( 'Page contents: [woocommerce_thankyou] Parent: "Checkout"', 'woothemes' ),
'id' => 'woocommerce_thanks_page_id', 'id' => 'woocommerce_thanks_page_id',
'css' => 'min-width:50px;',
'type' => 'single_select_page', 'type' => 'single_select_page',
'std' => '' 'std' => '',
'class' => 'chosen_select_nostd',
'css' => 'min-width:300px;',
), ),
array( array(
'name' => __( 'My Account Page', 'woothemes' ), 'name' => __( 'My Account Page', 'woothemes' ),
'desc' => __( 'Page contents: [woocommerce_my_account]', 'woothemes' ), 'desc' => __( 'Page contents: [woocommerce_my_account]', 'woothemes' ),
'id' => 'woocommerce_myaccount_page_id', 'id' => 'woocommerce_myaccount_page_id',
'css' => 'min-width:50px;',
'type' => 'single_select_page', 'type' => 'single_select_page',
'std' => '' 'std' => '',
'class' => 'chosen_select_nostd',
'css' => 'min-width:300px;',
), ),
array( array(
'name' => __( 'Edit Address Page', 'woothemes' ), 'name' => __( 'Edit Address Page', 'woothemes' ),
'desc' => __( 'Page contents: [woocommerce_edit_address] Parent: "My Account"', 'woothemes' ), 'desc' => __( 'Page contents: [woocommerce_edit_address] Parent: "My Account"', 'woothemes' ),
'id' => 'woocommerce_edit_address_page_id', 'id' => 'woocommerce_edit_address_page_id',
'css' => 'min-width:50px;',
'type' => 'single_select_page', 'type' => 'single_select_page',
'std' => '' 'std' => '',
'class' => 'chosen_select_nostd',
'css' => 'min-width:300px;',
), ),
array( array(
'name' => __( 'View Order Page', 'woothemes' ), 'name' => __( 'View Order Page', 'woothemes' ),
'desc' => __( 'Page contents: [woocommerce_view_order] Parent: "My Account"', 'woothemes' ), 'desc' => __( 'Page contents: [woocommerce_view_order] Parent: "My Account"', 'woothemes' ),
'id' => 'woocommerce_view_order_page_id', 'id' => 'woocommerce_view_order_page_id',
'css' => 'min-width:50px;',
'type' => 'single_select_page', 'type' => 'single_select_page',
'std' => '' 'std' => '',
'class' => 'chosen_select_nostd',
'css' => 'min-width:300px;',
), ),
array( array(
'name' => __( 'Change Password Page', 'woothemes' ), 'name' => __( 'Change Password Page', 'woothemes' ),
'desc' => __( 'Page contents: [woocommerce_change_password] Parent: "My Account"', 'woothemes' ), 'desc' => __( 'Page contents: [woocommerce_change_password] Parent: "My Account"', 'woothemes' ),
'id' => 'woocommerce_change_password_page_id', 'id' => 'woocommerce_change_password_page_id',
'css' => 'min-width:50px;',
'type' => 'single_select_page', 'type' => 'single_select_page',
'std' => '' 'std' => '',
'class' => 'chosen_select_nostd',
'css' => 'min-width:300px;',
), ),
array( 'type' => 'sectionend', 'id' => 'page_options'), array( 'type' => 'sectionend', 'id' => 'page_options'),
@ -460,7 +470,7 @@ $woocommerce_settings['catalog'] = apply_filters('woocommerce_catalog_settings',
'name' => __( 'Weight Unit', 'woothemes' ), 'name' => __( 'Weight Unit', 'woothemes' ),
'desc' => __( 'This controls what unit you will define weights in.', 'woothemes' ), 'desc' => __( 'This controls what unit you will define weights in.', 'woothemes' ),
'id' => 'woocommerce_weight_unit', 'id' => 'woocommerce_weight_unit',
'css' => 'min-width:175px;', 'css' => 'min-width:150px;',
'std' => 'GBP', 'std' => 'GBP',
'type' => 'select', 'type' => 'select',
'options' => array( 'options' => array(
@ -473,7 +483,7 @@ $woocommerce_settings['catalog'] = apply_filters('woocommerce_catalog_settings',
'name' => __( 'Dimensions Unit', 'woothemes' ), 'name' => __( 'Dimensions Unit', 'woothemes' ),
'desc' => __( 'This controls what unit you will define lengths in.', 'woothemes' ), 'desc' => __( 'This controls what unit you will define lengths in.', 'woothemes' ),
'id' => 'woocommerce_dimension_unit', 'id' => 'woocommerce_dimension_unit',
'css' => 'min-width:175px;', 'css' => 'min-width:150px;',
'std' => 'GBP', 'std' => 'GBP',
'type' => 'select', 'type' => 'select',
'options' => array( 'options' => array(
@ -499,7 +509,7 @@ $woocommerce_settings['catalog'] = apply_filters('woocommerce_catalog_settings',
'desc' => __( 'This controls the position of the currency symbol.', 'woothemes' ), 'desc' => __( 'This controls the position of the currency symbol.', 'woothemes' ),
'tip' => '', 'tip' => '',
'id' => 'woocommerce_currency_pos', 'id' => 'woocommerce_currency_pos',
'css' => 'min-width:175px;', 'css' => 'min-width:150px;',
'std' => 'left', 'std' => 'left',
'type' => 'select', 'type' => 'select',
'options' => array( 'options' => array(
@ -610,7 +620,7 @@ $woocommerce_settings['inventory'] = apply_filters('woocommerce_inventory_settin
'desc' => '', 'desc' => '',
'tip' => '', 'tip' => '',
'id' => 'woocommerce_notify_low_stock_amount', 'id' => 'woocommerce_notify_low_stock_amount',
'css' => 'min-width:50px;', 'css' => 'width:30px;',
'type' => 'text', 'type' => 'text',
'std' => '2' 'std' => '2'
), ),
@ -620,7 +630,7 @@ $woocommerce_settings['inventory'] = apply_filters('woocommerce_inventory_settin
'desc' => '', 'desc' => '',
'tip' => '', 'tip' => '',
'id' => 'woocommerce_notify_no_stock_amount', 'id' => 'woocommerce_notify_no_stock_amount',
'css' => 'min-width:50px;', 'css' => 'width:30px;',
'type' => 'text', 'type' => 'text',
'std' => '0' 'std' => '0'
), ),
@ -752,6 +762,7 @@ $woocommerce_settings['email'] = apply_filters('woocommerce_email_settings', arr
'desc' => __( 'The recipient of new order emails. Defaults to the admin email.', 'woothemes' ), 'desc' => __( 'The recipient of new order emails. Defaults to the admin email.', 'woothemes' ),
'id' => 'woocommerce_new_order_email_recipient', 'id' => 'woocommerce_new_order_email_recipient',
'type' => 'text', 'type' => 'text',
'css' => 'min-width:300px;',
'std' => esc_attr(get_option('admin_email')) 'std' => esc_attr(get_option('admin_email'))
), ),
@ -760,6 +771,7 @@ $woocommerce_settings['email'] = apply_filters('woocommerce_email_settings', arr
'desc' => __( 'The recipient of stock emails. Defaults to the admin email.', 'woothemes' ), 'desc' => __( 'The recipient of stock emails. Defaults to the admin email.', 'woothemes' ),
'id' => 'woocommerce_stock_email_recipient', 'id' => 'woocommerce_stock_email_recipient',
'type' => 'text', 'type' => 'text',
'css' => 'min-width:300px;',
'std' => esc_attr(get_option('admin_email')) 'std' => esc_attr(get_option('admin_email'))
), ),
@ -772,6 +784,7 @@ $woocommerce_settings['email'] = apply_filters('woocommerce_email_settings', arr
'desc' => __( 'The sender name for WooCommerce emails.', 'woothemes' ), 'desc' => __( 'The sender name for WooCommerce emails.', 'woothemes' ),
'id' => 'woocommerce_email_from_name', 'id' => 'woocommerce_email_from_name',
'type' => 'text', 'type' => 'text',
'css' => 'min-width:300px;',
'std' => esc_attr(get_bloginfo('name')) 'std' => esc_attr(get_bloginfo('name'))
), ),
@ -780,6 +793,7 @@ $woocommerce_settings['email'] = apply_filters('woocommerce_email_settings', arr
'desc' => __( 'The sender email address for WooCommerce emails.', 'woothemes' ), 'desc' => __( 'The sender email address for WooCommerce emails.', 'woothemes' ),
'id' => 'woocommerce_email_from_address', 'id' => 'woocommerce_email_from_address',
'type' => 'text', 'type' => 'text',
'css' => 'min-width:300px;',
'std' => get_option('admin_email') 'std' => get_option('admin_email')
), ),
@ -792,6 +806,7 @@ $woocommerce_settings['email'] = apply_filters('woocommerce_email_settings', arr
'desc' => sprintf(__( 'Enter a URL to an image you want to show in the email\'s header. Upload your image using the <a href="%s">media uploader</a>.', 'woothemes' ), admin_url('media-new.php')), 'desc' => sprintf(__( 'Enter a URL to an image you want to show in the email\'s header. Upload your image using the <a href="%s">media uploader</a>.', 'woothemes' ), admin_url('media-new.php')),
'id' => 'woocommerce_email_header_image', 'id' => 'woocommerce_email_header_image',
'type' => 'text', 'type' => 'text',
'css' => 'min-width:300px;',
'std' => '' 'std' => ''
), ),
@ -809,6 +824,7 @@ $woocommerce_settings['email'] = apply_filters('woocommerce_email_settings', arr
'desc' => __( 'The base colour for WooCommerce email templates. Default <code>#557da1</code>.', 'woothemes' ), 'desc' => __( 'The base colour for WooCommerce email templates. Default <code>#557da1</code>.', 'woothemes' ),
'id' => 'woocommerce_email_base_color', 'id' => 'woocommerce_email_base_color',
'type' => 'color', 'type' => 'color',
'css' => 'width:6em;',
'std' => '#557da1' 'std' => '#557da1'
), ),
@ -817,6 +833,7 @@ $woocommerce_settings['email'] = apply_filters('woocommerce_email_settings', arr
'desc' => __( 'The background colour for WooCommerce email templates. Default <code>#eeeeee</code>.', 'woothemes' ), 'desc' => __( 'The background colour for WooCommerce email templates. Default <code>#eeeeee</code>.', 'woothemes' ),
'id' => 'woocommerce_email_background_color', 'id' => 'woocommerce_email_background_color',
'type' => 'color', 'type' => 'color',
'css' => 'width:6em;',
'std' => '#eeeeee' 'std' => '#eeeeee'
), ),
@ -825,6 +842,7 @@ $woocommerce_settings['email'] = apply_filters('woocommerce_email_settings', arr
'desc' => __( 'The main body background colour. Default <code>#fdfdfd</code>.', 'woothemes' ), 'desc' => __( 'The main body background colour. Default <code>#fdfdfd</code>.', 'woothemes' ),
'id' => 'woocommerce_email_body_background_color', 'id' => 'woocommerce_email_body_background_color',
'type' => 'color', 'type' => 'color',
'css' => 'width:6em;',
'std' => '#fdfdfd' 'std' => '#fdfdfd'
), ),
@ -833,6 +851,7 @@ $woocommerce_settings['email'] = apply_filters('woocommerce_email_settings', arr
'desc' => __( 'The main body text colour. Default <code>#505050</code>.', 'woothemes' ), 'desc' => __( 'The main body text colour. Default <code>#505050</code>.', 'woothemes' ),
'id' => 'woocommerce_email_text_color', 'id' => 'woocommerce_email_text_color',
'type' => 'color', 'type' => 'color',
'css' => 'width:6em;',
'std' => '#505050' 'std' => '#505050'
), ),
@ -1041,12 +1060,6 @@ function woocommerce_settings() {
} }
}).change(); }).change();
// Country Multiselect boxes
jQuery(".country_multiselect").multiselect({
noneSelectedText: '<?php _e( 'Select countries/states', 'woothemes' ); ?>',
selectedList: 4
});
// Color picker // Color picker
jQuery('.colorpick').each(function(){ jQuery('.colorpick').each(function(){
jQuery('.colorpickdiv', jQuery(this).parent()).farbtastic(this); jQuery('.colorpickdiv', jQuery(this).parent()).farbtastic(this);
@ -1082,11 +1095,12 @@ function woocommerce_settings() {
}); });
}); });
// Chosen selects // Chosen selects
jQuery("select.chosen_select").chosen(); jQuery("select.chosen_select").chosen();
jQuery("select.chosen_select_nostd").chosen({
allow_single_deselect: 'true'
});
</script> </script>
</div> </div>
<?php <?php

View File

@ -237,7 +237,7 @@ function woocommerce_product_data_box() {
</td> </td>
<td class="values"> <td class="values">
<?php if ($tax->attribute_type=="select") : ?> <?php if ($tax->attribute_type=="select") : ?>
<select multiple="multiple" class="multiselect" name="attribute_values[<?php echo $i; ?>][]"> <select multiple="multiple" data-placeholder="<?php _e('Select terms', 'woothemes'); ?>" class="multiselect" name="attribute_values[<?php echo $i; ?>][]">
<?php <?php
$all_terms = get_terms( $attribute_taxonomy_name, 'orderby=name&hide_empty=0' ); $all_terms = get_terms( $attribute_taxonomy_name, 'orderby=name&hide_empty=0' );
if ($all_terms) : if ($all_terms) :

View File

@ -92,16 +92,18 @@ ul.recent-orders.stock_list a,ul.stock_list.stock_list a{text-decoration:none;}
#woocommmerce_dashboard_recent_reviews blockquote{padding:0;margin:0;} #woocommmerce_dashboard_recent_reviews blockquote{padding:0;margin:0;}
#woocommmerce_dashboard_recent_reviews .avatar{float:left;margin:0 10px 5px 0;} #woocommmerce_dashboard_recent_reviews .avatar{float:left;margin:0 10px 5px 0;}
#woocommmerce_dashboard_recent_reviews .star-rating{float:right;width:50px;height:10px;margin:3px 0 0 0;background:url(../images/admin-star.png) repeat-x left -10px;}#woocommmerce_dashboard_recent_reviews .star-rating span{background:url(../images/admin-star.png) repeat-x left 0;height:0;padding-top:10px;overflow:hidden;float:left;} #woocommmerce_dashboard_recent_reviews .star-rating{float:right;width:50px;height:10px;margin:3px 0 0 0;background:url(../images/admin-star.png) repeat-x left -10px;}#woocommmerce_dashboard_recent_reviews .star-rating span{background:url(../images/admin-star.png) repeat-x left 0;height:0;padding-top:10px;overflow:hidden;float:left;}
.woocommerce table.shippingrows td,.woocommerce table.shippingrows th{vertical-align:middle;} .woocommerce table.shippingrows td,.woocommerce table.taxrows td,.woocommerce table.shippingrows th,.woocommerce table.taxrows th{vertical-align:top;line-height:25px;}
.woocommerce table.shippingrows td a.remove{margin:0 !important;} .woocommerce table.shippingrows a.remove,.woocommerce table.taxrows a.remove{margin:0 !important;}
.woocommerce table.shippingrows .dupe,.woocommerce table.shippingrows .remove{float:right;margin-left:9px;} .woocommerce table.shippingrows .dupe,.woocommerce table.taxrows .dupe,.woocommerce table.shippingrows .remove,.woocommerce table.taxrows .remove{float:right;margin-left:9px;}
.woocommerce table.shippingrows tbody .check-column{padding:0;}.woocommerce table.shippingrows tbody .check-column input{margin:0 0 0 8px;} .woocommerce table.shippingrows tbody .check-column,.woocommerce table.taxrows tbody .check-column{padding-top:8px;}.woocommerce table.shippingrows tbody .check-column input,.woocommerce table.taxrows tbody .check-column input{margin:0 0 0 8px;}
.woocommerce table.shippingrows td.country{width:300px;}.woocommerce table.shippingrows td.country p{line-height:21px;margin:0;color:#666;} .woocommerce table.shippingrows td.apply_to_shipping,.woocommerce table.taxrows td.apply_to_shipping{padding-top:8px;}
.woocommerce table.shippingrows td.country button.edit_options{float:right;margin:0;} .woocommerce table.shippingrows td.rate input,.woocommerce table.taxrows td.rate input{width:100px;}
.woocommerce table.shippingrows td.country select{margin:9px 0;width:100%;height:160px !important;} .woocommerce table.shippingrows td.country,.woocommerce table.taxrows td.country{overflow:visible !important;}.woocommerce table.shippingrows td.country p,.woocommerce table.taxrows td.country p{line-height:25px;margin:0;color:#666;}
div.taxrows .taxrow{padding-bottom:8px;}div.taxrows .taxrow select{width:125px;} .woocommerce table.shippingrows td.country button.edit_options,.woocommerce table.taxrows td.country button.edit_options{float:right;}
div.taxrows .taxrow input.text{width:60px;} .woocommerce table.shippingrows td.country select,.woocommerce table.taxrows td.country select{margin:9px 0;width:100%;height:160px !important;}
div.taxrows .taxrow label.checkbox{line-height:1.5em;margin:0 8px;}div.taxrows .taxrow label.checkbox input{margin:0 4px 0 0;} .woocommerce table.shippingrows td.country p.edit,.woocommerce table.taxrows td.country p.edit,.woocommerce table.shippingrows td.country .options,.woocommerce table.taxrows td.country .options{min-width:400px;}
.woocommerce table.shippingrows td.country .chzn-container,.woocommerce table.taxrows td.country .chzn-container{width:100% !important;margin:9px 0 5px;}.woocommerce table.shippingrows td.country .chzn-container .chzn-drop,.woocommerce table.taxrows td.country .chzn-container .chzn-drop{width:100% !important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}
.woocommerce table.shippingrows td.country .chzn-container .search-field input,.woocommerce table.taxrows td.country .chzn-container .search-field input{width:150px !important;}
.woocommerce table.widefat table.coupon_rows{border:0 !important;width:100%;}.woocommerce table.widefat table.coupon_rows thead th{padding:1px;border:0;font-weight:normal;font-size:11px;color:#999;} .woocommerce table.widefat table.coupon_rows{border:0 !important;width:100%;}.woocommerce table.widefat table.coupon_rows thead th{padding:1px;border:0;font-weight:normal;font-size:11px;color:#999;}
.woocommerce table.widefat table.coupon_rows tbody td{padding:3px 3px 0 0;border:0;vertical-align:middle;}.woocommerce table.widefat table.coupon_rows tbody td input.text{width:95px;} .woocommerce table.widefat table.coupon_rows tbody td{padding:3px 3px 0 0;border:0;vertical-align:middle;}.woocommerce table.widefat table.coupon_rows tbody td input.text{width:95px;}
.woocommerce #tabs-wrap table a.remove{margin-left:4px;} .woocommerce #tabs-wrap table a.remove{margin-left:4px;}
@ -143,7 +145,7 @@ table.woocommerce_attributes td select.multiselect{height:8em !important;}
table.woocommerce_attributes td .ui-multiselect-checkboxes input{width:auto;} table.woocommerce_attributes td .ui-multiselect-checkboxes input{width:auto;}
table.woocommerce_attributes td input,table.woocommerce_variable_attributes td input,table.woocommerce_variable_attributes td textarea{font-size:14px;padding:4px;color:#555;} table.woocommerce_attributes td input,table.woocommerce_variable_attributes td input,table.woocommerce_variable_attributes td textarea{font-size:14px;padding:4px;color:#555;}
table.woocommerce_attributes .taxonomy td.name{padding:10px 15px;font-size:14px;color:#555;} table.woocommerce_attributes .taxonomy td.name{padding:10px 15px;font-size:14px;color:#555;}
table.woocommerce_attributes .taxonomy td.values{position:relative;} table.woocommerce_attributes .taxonomy td.values{position:relative;}table.woocommerce_attributes .taxonomy td.values .chzn-container{width:100% !important;margin:0 1px;display:block;}table.woocommerce_attributes .taxonomy td.values .chzn-container .chzn-drop{width:100% !important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}
table.woocommerce_attributes .center{text-align:center;} table.woocommerce_attributes .center{text-align:center;}
#woocommerce_attributes select.attribute_taxonomy,button.add_attribute,button.add_variable_attribute,button.add_variation,button.link_all_variations{float:right;} #woocommerce_attributes select.attribute_taxonomy,button.add_attribute,button.add_variable_attribute,button.add_variation,button.link_all_variations{float:right;}
#upsells_and_crosssells_product_data{padding:0 9px 9px;} #upsells_and_crosssells_product_data{padding:0 9px 9px;}
@ -191,44 +193,20 @@ table.bar_chart{width:100%;}table.bar_chart thead th{text-align:left;color:#ccc;
table.bar_chart tbody th{padding:6px 0;width:25%;text-align:left !important;font-weight:normal !important;border-bottom:1px solid #fee;} table.bar_chart tbody th{padding:6px 0;width:25%;text-align:left !important;font-weight:normal !important;border-bottom:1px solid #fee;}
table.bar_chart tbody td{position:relative;text-align:left;padding:6px 0 6px 0;border-bottom:1px solid #fee;}table.bar_chart tbody td span,table.bar_chart tbody td a{text-decoration:none;clear:both;background:#8a4b75;float:left;display:block;line-height:24px;height:24px;-moz-border-radius:4px;-webkit-border-radius:4px;-o-border-radius:4px;-khtml-border-radius:4px;border-radius:4px;}table.bar_chart tbody td span span,table.bar_chart tbody td a span{position:absolute;left:8px;color:#dec3d5 !important;font-size:11px;text-shadow:0 1px 0 #8a4b75;height:auto;background:transparent;} table.bar_chart tbody td{position:relative;text-align:left;padding:6px 0 6px 0;border-bottom:1px solid #fee;}table.bar_chart tbody td span,table.bar_chart tbody td a{text-decoration:none;clear:both;background:#8a4b75;float:left;display:block;line-height:24px;height:24px;-moz-border-radius:4px;-webkit-border-radius:4px;-o-border-radius:4px;-khtml-border-radius:4px;border-radius:4px;}table.bar_chart tbody td span span,table.bar_chart tbody td a span{position:absolute;left:8px;color:#dec3d5 !important;font-size:11px;text-shadow:0 1px 0 #8a4b75;height:auto;background:transparent;}
table.bar_chart tbody td span.alt{clear:both;background:#47a03e;margin-top:6px;}table.bar_chart tbody td span.alt span{margin:0;color:#c5dec2 !important;text-shadow:0 1px 0 #47a03e;background:transparent;} table.bar_chart tbody td span.alt{clear:both;background:#47a03e;margin-top:6px;}table.bar_chart tbody td span.alt span{margin:0;color:#c5dec2 !important;text-shadow:0 1px 0 #47a03e;background:transparent;}
.ui-multiselect{padding:3px 0 3px 4px;text-align:left;margin:1px;vertical-align:middle;height:24px;}
.ui-multiselect span.ui-icon{float:right;}
.ui-multiselect-single .ui-multiselect-checkboxes input{position:absolute !important;top:auto !important;left:-9999px;}
.ui-multiselect-single .ui-multiselect-checkboxes label{padding:5px !important;}
.woocommerce .panel .ui-multiselect{width:225px !important;}
#attributes_list td.values .ui-multiselect{width:100% !important;}
#attributes_list td.values .ui-multiselect-menu{width:auto !important;right:9px;}
.ui-multiselect-header{margin-bottom:3px;padding:3px 0 3px 4px;}
.ui-multiselect-header ul{font-size:0.9em;}
.ui-multiselect-header ul li{float:left;padding:0 10px 0 0;margin:0;}
.ui-multiselect-header a{text-decoration:none;}
.ui-multiselect-header a:hover{text-decoration:underline;}
.ui-multiselect-header span.ui-icon{float:left;}
.ui-multiselect-header li.ui-multiselect-close{float:right;text-align:right;padding-right:0;}
.ui-multiselect-menu{display:none;padding:3px;position:absolute;z-index:10000;}
.ui-multiselect-checkboxes{position:relative ;overflow-y:scroll;}
.ui-multiselect-checkboxes label{cursor:default;display:block;border:1px solid transparent;padding:3px 1px;}
.ui-multiselect-checkboxes label input{position:relative;top:0;vertical-align:middle;}
.ui-multiselect-checkboxes label span{padding-left:4px;}
.ui-multiselect-checkboxes li{clear:both;font-size:0.9em;padding-right:3px;}
.ui-multiselect-checkboxes li.ui-multiselect-optgroup-label{text-align:center;font-weight:bold;border-bottom:1px solid;}
.ui-multiselect-checkboxes li.ui-multiselect-optgroup-label a{display:block;padding:3px;margin:1px 0;text-decoration:none;}
.ui-multiselect-checkboxes li.ui-multiselect-optgroup-last{border-bottom:1px solid;}
* html .ui-multiselect-checkboxes label{border:none;}
#woocommerce_allowed_countries_chzn .chzn-search{display:none;} #woocommerce_allowed_countries_chzn .chzn-search{display:none;}
.chzn-container{font-size:13px;position:relative;display:inline-block;zoom:1;*display:inline;margin-right:5px;} .chzn-container{font-size:13px;position:relative;display:inline-block;zoom:1;*display:inline;margin-right:5px;}
.chzn-container .chzn-drop{background:#fff;border:1px solid #aaa;border-top:0;position:absolute;top:29px;left:0;-webkit-box-shadow:0 4px 5px rgba(0, 0, 0, 0.15);-moz-box-shadow:0 4px 5px rgba(0, 0, 0, 0.15);-o-box-shadow:0 4px 5px rgba(0, 0, 0, 0.15);box-shadow:0 4px 5px rgba(0, 0, 0, 0.15);z-index:999;} .chzn-container .chzn-drop{background:#fff;border:1px solid #aaa;border-top:0;position:absolute;top:29px;left:0;-webkit-box-shadow:0 4px 5px rgba(0, 0, 0, 0.15);-moz-box-shadow:0 4px 5px rgba(0, 0, 0, 0.15);-o-box-shadow:0 4px 5px rgba(0, 0, 0, 0.15);box-shadow:0 4px 5px rgba(0, 0, 0, 0.15);z-index:999;}
.chzn-container-single .chzn-single{background-color:#fff;background-image:-webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.5, white));background-image:-webkit-linear-gradient(center bottom, #eeeeee 0%, white 50%);background-image:-moz-linear-gradient(center bottom, #eeeeee 0%, white 50%);background-image:-o-linear-gradient(top, #eeeeee 0%, #ffffff 50%);background-image:-ms-linear-gradient(top, #eeeeee 0%, #ffffff 50%);background-image:linear-gradient(top, #eeeeee 0%, #ffffff 50%);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-moz-background-clip:padding;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #aaa;display:block;overflow:hidden;white-space:nowrap;position:relative;height:23px;line-height:23px;padding:0 0 0 8px;color:#444;text-decoration:none;} .chzn-container-single .chzn-single{background-color:#fff;background-image:-webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.5, white));background-image:-webkit-linear-gradient(center bottom, #eeeeee 0%, white 50%);background-image:-moz-linear-gradient(center bottom, #eeeeee 0%, white 50%);background-image:-o-linear-gradient(top, #eeeeee 0%, #ffffff 50%);background-image:-ms-linear-gradient(top, #eeeeee 0%, #ffffff 50%);background-image:linear-gradient(top, #eeeeee 0%, #ffffff 50%);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-moz-background-clip:padding;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #aaa;display:block;overflow:hidden;white-space:nowrap;position:relative;height:23px;line-height:23px;padding:0 0 0 8px;color:#444;text-decoration:none;}
.chzn-container-single .chzn-single span{margin-right:26px;display:block;overflow:hidden;white-space:nowrap;-o-text-overflow:ellipsis;-ms-text-overflow:ellipsis;text-overflow:ellipsis;} .chzn-container-single .chzn-single span{margin-right:26px;display:block;overflow:hidden;white-space:nowrap;-o-text-overflow:ellipsis;-ms-text-overflow:ellipsis;text-overflow:ellipsis;}
.chzn-container-single .chzn-single abbr{display:block;position:absolute;right:26px;top:8px;width:12px;height:13px;font-size:1px;background:url(../images/chosen-sprite.png) right top no-repeat;} .chzn-container-single .chzn-single abbr{display:block;position:absolute;right:26px;top:6px;width:12px;height:13px;font-size:1px;background:url(../images/chosen-sprite.png) right top no-repeat;}
.chzn-container-single .chzn-single abbr:hover{background-position:right -11px;} .chzn-container-single .chzn-single abbr:hover{background-position:right -11px;}
.chzn-container-single .chzn-single div{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0;-moz-background-clip:padding;-webkit-background-clip:padding-box;background-clip:padding-box;background:#ccc;background-image:-webkit-gradient(linear, left bottom, left top, color-stop(0, #cccccc), color-stop(0.6, #eeeeee));background-image:-webkit-linear-gradient(center bottom, #cccccc 0%, #eeeeee 60%);background-image:-moz-linear-gradient(center bottom, #cccccc 0%, #eeeeee 60%);background-image:-o-linear-gradient(bottom, #cccccc 0%, #eeeeee 60%);background-image:-ms-linear-gradient(top, #cccccc 0%, #eeeeee 60%);background-image:linear-gradient(top, #cccccc 0%, #eeeeee 60%);border-left:1px solid #aaa;position:absolute;right:0;top:0;display:block;height:100%;width:18px;} .chzn-container-single .chzn-single div{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0;-moz-background-clip:padding;-webkit-background-clip:padding-box;background-clip:padding-box;background:#ccc;background-image:-webkit-gradient(linear, left bottom, left top, color-stop(0, #cccccc), color-stop(0.6, #eeeeee));background-image:-webkit-linear-gradient(center bottom, #cccccc 0%, #eeeeee 60%);background-image:-moz-linear-gradient(center bottom, #cccccc 0%, #eeeeee 60%);background-image:-o-linear-gradient(bottom, #cccccc 0%, #eeeeee 60%);background-image:-ms-linear-gradient(top, #cccccc 0%, #eeeeee 60%);background-image:linear-gradient(top, #cccccc 0%, #eeeeee 60%);border-left:1px solid #aaa;position:absolute;right:0;top:0;display:block;height:100%;width:18px;}
.chzn-container-single .chzn-single div b{background:url('../images/chosen-sprite.png') no-repeat 0 0;display:block;width:100%;height:100%;} .chzn-container-single .chzn-single div b{background:url('../images/chosen-sprite.png') no-repeat 0 -1px;display:block;width:100%;height:100%;}
.chzn-container-single .chzn-search{padding:3px 4px;position:relative;margin:0;white-space:nowrap;z-index:1010;} .chzn-container-single .chzn-search{padding:3px 4px;position:relative;margin:0;white-space:nowrap;z-index:1010;}
.chzn-container-single .chzn-search input{background:#ffffff url('../images/chosen-sprite.png') no-repeat 100% -22px;background:url('../images/chosen-sprite.png') no-repeat 100% -22px,-webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));background:url('../images/chosen-sprite.png') no-repeat 100% -22px,-webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);background:url('../images/chosen-sprite.png') no-repeat 100% -22px,-moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);background:url('../images/chosen-sprite.png') no-repeat 100% -22px,-o-linear-gradient(bottom, white 85%, #eeeeee 99%);background:url('../images/chosen-sprite.png') no-repeat 100% -22px,-ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%);background:url('../images/chosen-sprite.png') no-repeat 100% -22px,linear-gradient(top, #ffffff 85%, #eeeeee 99%);margin:1px 0;padding:4px 20px 4px 5px;outline:0;border:1px solid #aaa;font-family:sans-serif;font-size:1em;width:100% !important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;} .chzn-container-single .chzn-search input{background:#ffffff url('../images/chosen-sprite.png') no-repeat 100% -22px;background:url('../images/chosen-sprite.png') no-repeat 100% -22px,-webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));background:url('../images/chosen-sprite.png') no-repeat 100% -22px,-webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);background:url('../images/chosen-sprite.png') no-repeat 100% -22px,-moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);background:url('../images/chosen-sprite.png') no-repeat 100% -22px,-o-linear-gradient(bottom, white 85%, #eeeeee 99%);background:url('../images/chosen-sprite.png') no-repeat 100% -22px,-ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%);background:url('../images/chosen-sprite.png') no-repeat 100% -22px,linear-gradient(top, #ffffff 85%, #eeeeee 99%);margin:1px 0;padding:4px 20px 4px 5px;outline:0;border:1px solid #aaa;font-family:sans-serif;font-size:1em;width:100% !important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}
.chzn-container-single .chzn-drop{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px;-moz-background-clip:padding;-webkit-background-clip:padding-box;background-clip:padding-box;} .chzn-container-single .chzn-drop{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px;-moz-background-clip:padding;-webkit-background-clip:padding-box;background-clip:padding-box;}
.chzn-container-single-nosearch .chzn-search input{position:absolute;left:-9000px;} .chzn-container-single-nosearch .chzn-search input{position:absolute;left:-9000px;}
.chzn-container-multi .chzn-choices{background-color:#fff;background-image:-webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));background-image:-webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);background-image:-moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);background-image:-o-linear-gradient(bottom, white 85%, #eeeeee 99%);background-image:-ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%);background-image:linear-gradient(top, #ffffff 85%, #eeeeee 99%);border:1px solid #aaa;margin:0;padding:0;cursor:text;overflow:hidden;height:auto !important;height:1%;position:relative;} .chzn-container-multi .chzn-choices{background-color:#fff;background-image:-webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));background-image:-webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);background-image:-moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);background-image:-o-linear-gradient(bottom, white 85%, #eeeeee 99%);background-image:-ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%);background-image:linear-gradient(top, #ffffff 85%, #eeeeee 99%);border:1px solid #dfdfdf;margin:0;padding:0;cursor:text;overflow:hidden;height:auto !important;height:1%;position:relative;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;}
.chzn-container-multi .chzn-choices li{float:left;list-style:none;} .chzn-container-multi .chzn-choices li{float:left;list-style:none;}
.chzn-container-multi .chzn-choices .search-field{white-space:nowrap;margin:0;padding:0;} .chzn-container-multi .chzn-choices .search-field{white-space:nowrap;margin:0;padding:0;}
.chzn-container-multi .chzn-choices .search-field input{color:#666;background:transparent !important;border:0 !important;padding:5px;margin:1px 0;outline:0;-webkit-box-shadow:none;-moz-box-shadow:none;-o-box-shadow:none;box-shadow:none;} .chzn-container-multi .chzn-choices .search-field input{color:#666;background:transparent !important;border:0 !important;padding:5px;margin:1px 0;outline:0;-webkit-box-shadow:none;-moz-box-shadow:none;-o-box-shadow:none;box-shadow:none;}

View File

@ -520,58 +520,66 @@ ul.recent-orders, ul.stock_list {
} }
/* Settings */ /* Settings */
.woocommerce table.shippingrows td, .woocommerce table.shippingrows th { .woocommerce table.shippingrows, .woocommerce table.taxrows {
vertical-align: middle; td, th {
vertical-align: top;
line-height: 25px;
} }
.woocommerce table.shippingrows td a.remove { a.remove {
margin: 0 !important; margin: 0 !important;
} }
.woocommerce table.shippingrows .dupe, .woocommerce table.shippingrows .remove { .dupe, .remove {
float: right; float: right;
margin-left: 9px; margin-left: 9px;
} }
.woocommerce table.shippingrows tbody .check-column { tbody .check-column {
padding: 0; padding-top: 8px;
input { input {
margin: 0 0 0 8px; margin: 0 0 0 8px;
} }
} }
.woocommerce table.shippingrows td.country { td.apply_to_shipping {
width: 300px; padding-top: 8px;
}
td.rate {
input {
width: 100px;
}
}
td.country {
overflow: visible !important;
p { p {
line-height: 21px; line-height: 25px;
margin: 0; margin: 0;
color: #666; color: #666;
} }
button.edit_options { button.edit_options {
float: right; float: right;
margin: 0;
} }
select { select {
margin: 9px 0; margin: 9px 0;
width: 100%; width: 100%;
height: 160px !important; height: 160px !important;
} }
p.edit, .options {
min-width: 400px;
}
.chzn-container {
width: 100% !important;
margin: 9px 0 5px;
.chzn-drop {
width: 100% !important;
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
box-sizing: border-box; /* Opera/IE 8+ */
}
.search-field input {
width: 150px !important;
}
}
}
} }
div.taxrows {
.taxrow {
padding-bottom: 8px;
select {
width: 125px;
}
input.text {
width: 60px;
}
label.checkbox {
line-height: 1.5em;
margin: 0 8px;
input {
margin: 0 4px 0 0;
}
}
}
}
.woocommerce table.widefat { .woocommerce table.widefat {
table.coupon_rows { table.coupon_rows {
@ -800,6 +808,17 @@ table.woocommerce_attributes .taxonomy td.name {
} }
table.woocommerce_attributes .taxonomy td.values { table.woocommerce_attributes .taxonomy td.values {
position: relative; position: relative;
.chzn-container {
width: 100% !important;
margin: 0 1px;
display: block;
.chzn-drop {
width: 100% !important;
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
box-sizing: border-box; /* Opera/IE 8+ */
}
}
} }
table.woocommerce_attributes .center { table.woocommerce_attributes .center {
text-align: center; text-align: center;
@ -1123,42 +1142,8 @@ table.bar_chart {
} }
} }
/* Multiselect /* Chosen multiselect enhancement
----------------------------------*/ ----------------------------------*/
.ui-multiselect { padding:3px 0 3px 4px; text-align:left; margin: 1px; vertical-align: middle; height: 24px; }
.ui-multiselect span.ui-icon { float:right }
.ui-multiselect-single .ui-multiselect-checkboxes input { position:absolute !important; top: auto !important; left:-9999px; }
.ui-multiselect-single .ui-multiselect-checkboxes label { padding:5px !important; }
.woocommerce .panel .ui-multiselect { width: 225px !important; }
#attributes_list td.values .ui-multiselect { width: 100% !important; }
#attributes_list td.values .ui-multiselect-menu { width: auto !important; right: 9px; }
.ui-multiselect-header { margin-bottom:3px; padding:3px 0 3px 4px }
.ui-multiselect-header ul { font-size:0.9em }
.ui-multiselect-header ul li { float:left; padding:0 10px 0 0; margin: 0; }
.ui-multiselect-header a { text-decoration:none }
.ui-multiselect-header a:hover { text-decoration:underline }
.ui-multiselect-header span.ui-icon { float:left }
.ui-multiselect-header li.ui-multiselect-close { float:right; text-align:right; padding-right:0 }
.ui-multiselect-menu { display:none; padding:3px; position:absolute; z-index:10000 }
.ui-multiselect-checkboxes { position:relative /* fixes bug in IE6/7 */; overflow-y:scroll }
.ui-multiselect-checkboxes label { cursor:default; display:block; border:1px solid transparent; padding:3px 1px; }
.ui-multiselect-checkboxes label input { position:relative; top:0; vertical-align: middle; }
.ui-multiselect-checkboxes label span { padding-left: 4px; }
.ui-multiselect-checkboxes li { clear:both; font-size:0.9em; padding-right:3px }
.ui-multiselect-checkboxes li.ui-multiselect-optgroup-label { text-align:center; font-weight:bold; border-bottom:1px solid }
.ui-multiselect-checkboxes li.ui-multiselect-optgroup-label a { display:block; padding:3px; margin:1px 0; text-decoration:none }
.ui-multiselect-checkboxes li.ui-multiselect-optgroup-last { border-bottom:1px solid }
/* remove label borders in IE6 because IE6 does not support transparency */
* html .ui-multiselect-checkboxes label { border:none }
#woocommerce_allowed_countries_chzn .chzn-search { #woocommerce_allowed_countries_chzn .chzn-search {
display: none; display: none;
} }
@ -1226,7 +1211,7 @@ table.bar_chart {
display: block; display: block;
position: absolute; position: absolute;
right: 26px; right: 26px;
top: 8px; top: 6px;
width: 12px; width: 12px;
height: 13px; height: 13px;
font-size: 1px; font-size: 1px;
@ -1258,7 +1243,7 @@ table.bar_chart {
width: 18px; width: 18px;
} }
.chzn-container-single .chzn-single div b { .chzn-container-single .chzn-single div b {
background: url('../images/chosen-sprite.png') no-repeat 0 0; background: url('../images/chosen-sprite.png') no-repeat 0 -1px;
display: block; display: block;
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -1313,7 +1298,7 @@ table.bar_chart {
background-image: -o-linear-gradient(bottom, white 85%, #eeeeee 99%); background-image: -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
background-image: -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%); background-image: -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%);
background-image: linear-gradient(top, #ffffff 85%,#eeeeee 99%); background-image: linear-gradient(top, #ffffff 85%,#eeeeee 99%);
border: 1px solid #aaa; border: 1px solid #dfdfdf;
margin: 0; margin: 0;
padding: 0; padding: 0;
cursor: text; cursor: text;
@ -1321,6 +1306,11 @@ table.bar_chart {
height: auto !important; height: auto !important;
height: 1%; height: 1%;
position: relative; position: relative;
-moz-border-radius:3px;
-webkit-border-radius:3px;
-o-border-radius:3px;
-khtml-border-radius:3px;
border-radius:3px;
} }
.chzn-container-multi .chzn-choices li { .chzn-container-multi .chzn-choices li {
float: left; float: left;

View File

@ -1,50 +1,3 @@
/*
* jQuery MultiSelect UI Widget 1.11pre
* Copyright (c) 2011 Eric Hynds
*
* http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/
*
* Depends:
* - jQuery 1.4.2+
* - jQuery UI 1.8 widget factory
*
* Optional:
* - jQuery UI effects
* - jQuery UI position utility
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
*/
(function($,undefined){var multiselectID=0;$.widget("ech.multiselect",{options:{header:true,height:175,minWidth:225,classes:'',checkAllText:'Check all',uncheckAllText:'Uncheck all',noneSelectedText:'Select options',selectedText:'# selected',selectedList:0,show:'',hide:'',autoOpen:false,multiple:true,position:{}},_create:function(){var el=this.element.hide(),o=this.options;this.speed=$.fx.speeds._default;this._isOpen=false;var
button=(this.button=$('<button type="button"><span class="ui-icon ui-icon-triangle-2-n-s"></span></button>')).addClass('ui-multiselect ui-widget ui-state-default ui-corner-all').addClass(o.classes).attr({'title':el.attr('title'),'aria-haspopup':true,'tabIndex':el.attr('tabIndex')}).insertAfter(el),buttonlabel=(this.buttonlabel=$('<span />')).html(o.noneSelectedText).appendTo(button),menu=(this.menu=$('<div />')).addClass('ui-multiselect-menu ui-widget ui-widget-content ui-corner-all').addClass(o.classes).insertAfter(button),header=(this.header=$('<div />')).addClass('ui-widget-header ui-corner-all ui-multiselect-header ui-helper-clearfix').appendTo(menu),headerLinkContainer=(this.headerLinkContainer=$('<ul />')).addClass('ui-helper-reset').html(function(){if(o.header===true){return'<li><a class="ui-multiselect-all" href="#"><span class="ui-icon ui-icon-check"></span><span>'+o.checkAllText+'</span></a></li><li><a class="ui-multiselect-none" href="#"><span class="ui-icon ui-icon-closethick"></span><span>'+o.uncheckAllText+'</span></a></li>';}else if(typeof o.header==="string"){return'<li>'+o.header+'</li>';}else{return'';}}).append('<li class="ui-multiselect-close"><a href="#" class="ui-multiselect-close"><span class="ui-icon ui-icon-circle-close"></span></a></li>').appendTo(header),checkboxContainer=(this.checkboxContainer=$('<ul />')).addClass('ui-multiselect-checkboxes ui-helper-reset').appendTo(menu);this._bindEvents();this.refresh(true);if(!o.multiple){menu.addClass('ui-multiselect-single');}},_init:function(){if(this.options.header===false){this.header.hide();}
if(!this.options.multiple){this.headerLinkContainer.find('.ui-multiselect-all, .ui-multiselect-none').hide();}
if(this.options.autoOpen){this.open();}
if(this.element.is(':disabled')){this.disable();}},refresh:function(init){var el=this.element,o=this.options,menu=this.menu,checkboxContainer=this.checkboxContainer,optgroups=[],html=[],id=el.attr('id')||multiselectID++;this.element.find('option').each(function(i){var $this=$(this),parent=this.parentNode,title=this.innerHTML,description=this.title,value=this.value,inputID=this.id||'ui-multiselect-'+id+'-option-'+i,isDisabled=this.disabled,isSelected=this.selected,labelClasses=['ui-corner-all'],optLabel;if(parent.tagName.toLowerCase()==='optgroup'){optLabel=parent.getAttribute('label');if($.inArray(optLabel,optgroups)===-1){html.push('<li class="ui-multiselect-optgroup-label"><a href="#">'+optLabel+'</a></li>');optgroups.push(optLabel);}}
if(isDisabled){labelClasses.push('ui-state-disabled');}
if(isSelected&&!o.multiple){labelClasses.push('ui-state-active');}
html.push('<li class="'+(isDisabled?'ui-multiselect-disabled':'')+'">');html.push('<label for="'+inputID+'" title="'+description+'" class="'+labelClasses.join(' ')+'">');html.push('<input id="'+inputID+'" name="multiselect_'+id+'" type="'+(o.multiple?"checkbox":"radio")+'" value="'+value+'" title="'+title+'"');if(isSelected){html.push(' checked="checked"');html.push(' aria-selected="true"');}
if(isDisabled){html.push(' disabled="disabled"');html.push(' aria-disabled="true"');}
html.push(' /><span>'+title+'</span></label></li>');if(parent.tagName.toLowerCase()==='optgroup'){var $next_parent=$this.next('option').parent();if(!$next_parent.is('optgroup')){html.push('<li class="ui-multiselect-optgroup-last"></li>');}}});checkboxContainer.html(html.join(''));this.labels=menu.find('label');this._setButtonWidth();this._setMenuWidth();this.button[0].defaultValue=this.update();if(!init){this._trigger('refresh');}},update:function(){var o=this.options,$inputs=this.labels.find('input'),$checked=$inputs.filter(':checked'),numChecked=$checked.length,value;if(numChecked===0){value=o.noneSelectedText;}else{if($.isFunction(o.selectedText)){value=o.selectedText.call(this,numChecked,$inputs.length,$checked.get());}else if(/\d/.test(o.selectedList)&&o.selectedList>0&&numChecked<=o.selectedList){value=$checked.map(function(){return this.title;}).get().join(', ');}else{value=o.selectedText.replace('#',numChecked).replace('#',$inputs.length);}}
this.buttonlabel.html(value);return value;},_bindEvents:function(){var self=this,button=this.button;function clickHandler(){self[self._isOpen?'close':'open']();return false;}
button.find('span').bind('click.multiselect',clickHandler);button.bind({click:clickHandler,keypress:function(e){switch(e.which){case 27:case 38:case 37:self.close();break;case 39:case 40:self.open();break;}},mouseenter:function(){if(!button.hasClass('ui-state-disabled')){$(this).addClass('ui-state-hover');}},mouseleave:function(){$(this).removeClass('ui-state-hover');},focus:function(){if(!button.hasClass('ui-state-disabled')){$(this).addClass('ui-state-focus');}},blur:function(){$(this).removeClass('ui-state-focus');}});this.header.delegate('a','click.multiselect',function(e){if($(this).hasClass('ui-multiselect-close')){self.close();}else{self[$(this).hasClass('ui-multiselect-all')?'checkAll':'uncheckAll']();}
e.preventDefault();});this.menu.delegate('li.ui-multiselect-optgroup-label a','click.multiselect',function(e){e.preventDefault();var $this=$(this),$inputs=$this.parent().nextUntil('li.ui-multiselect-optgroup-label, li.ui-multiselect-optgroup-last').find('input:visible:not(:disabled)'),nodes=$inputs.get(),label=$this.parent().text();if(self._trigger('beforeoptgrouptoggle',e,{inputs:nodes,label:label})===false){return;}
self._toggleChecked($inputs.filter(':checked').length!==$inputs.length,$inputs);self._trigger('optgrouptoggle',e,{inputs:nodes,label:label,checked:nodes[0].checked});}).delegate('label','mouseenter.multiselect',function(){if(!$(this).hasClass('ui-state-disabled')){self.labels.removeClass('ui-state-hover');$(this).addClass('ui-state-hover').find('input').focus();}}).delegate('label','keydown.multiselect',function(e){e.preventDefault();switch(e.which){case 9:case 27:self.close();break;case 38:case 40:case 37:case 39:self._traverse(e.which,this);break;case 13:$(this).find('input')[0].click();break;}}).delegate('input[type="checkbox"], input[type="radio"]','click.multiselect',function(e){var $this=$(this),val=this.value,checked=this.checked,tags=self.element.find('option');if(this.disabled||self._trigger('click',e,{value:val,text:this.title,checked:checked})===false){e.preventDefault();return;}
$this.attr('aria-selected',checked);tags.each(function(){if(this.value===val){this.selected=checked;if(checked){this.setAttribute('selected','selected');}else{this.removeAttribute('selected');}}else if(!self.options.multiple){this.selected=false;}});if(!self.options.multiple){self.labels.removeClass('ui-state-active');$this.closest('label').toggleClass('ui-state-active',checked);self.close();}
self.element.trigger("change");setTimeout($.proxy(self.update,self),10);});$(document).bind('mousedown.multiselect',function(e){if(self._isOpen&&!$.contains(self.menu[0],e.target)&&!$.contains(self.button[0],e.target)&&e.target!==self.button[0]){self.close();}});$(this.element[0].form).bind('reset.multiselect',function(){setTimeout(function(){self.update();},10);});},_setButtonWidth:function(){var width=this.element.outerWidth(),o=this.options;if(/\d/.test(o.minWidth)&&width<o.minWidth){width=o.minWidth;}
this.button.width(width);},_setMenuWidth:function(){var m=this.menu,width=this.button.outerWidth()-
parseInt(m.css('padding-left'),10)-
parseInt(m.css('padding-right'),10)-
parseInt(m.css('border-right-width'),10)-
parseInt(m.css('border-left-width'),10);m.width(width||this.button.outerWidth());},_traverse:function(which,start){var $start=$(start),moveToLast=which===38||which===37,$next=$start.parent()[moveToLast?'prevAll':'nextAll']('li:not(.ui-multiselect-disabled, .ui-multiselect-optgroup-label)')[moveToLast?'last':'first']();if(!$next.length){var $container=this.menu.find('ul:last');this.menu.find('label')[moveToLast?'last':'first']().trigger('mouseover');$container.scrollTop(moveToLast?$container.height():0);}else{$next.find('label').trigger('mouseover');}},_toggleCheckbox:function(prop,flag){return function(){!this.disabled&&(this[prop]=flag);if(flag){this.setAttribute('aria-selected',true);}else{this.removeAttribute('aria-selected');}}},_toggleChecked:function(flag,group){var $inputs=(group&&group.length)?group:this.labels.find('input'),self=this;$inputs.each(this._toggleCheckbox('checked',flag));this.update();var values=$inputs.map(function(){return this.value;}).get();this.element.find('option').each(function(){if(!this.disabled&&$.inArray(this.value,values)>-1){self._toggleCheckbox('selected',flag).call(this);}});if($inputs.length){this.element.trigger("change");}},_toggleDisabled:function(flag){this.button.attr({'disabled':flag,'aria-disabled':flag})[flag?'addClass':'removeClass']('ui-state-disabled');this.menu.find('input').attr({'disabled':flag,'aria-disabled':flag}).parent()[flag?'addClass':'removeClass']('ui-state-disabled');this.element.attr({'disabled':flag,'aria-disabled':flag});},open:function(e){var self=this,button=this.button,menu=this.menu,speed=this.speed,o=this.options;if(this._trigger('beforeopen')===false||button.hasClass('ui-state-disabled')||this._isOpen){return;}
var $container=menu.find('ul:last'),effect=o.show,pos=button.position();if($.isArray(o.show)){effect=o.show[0];speed=o.show[1]||self.speed;}
$container.scrollTop(0).height(o.height);if($.ui.position&&!$.isEmptyObject(o.position)){o.position.of=o.position.of||button;menu.show().position(o.position).hide().show(effect,speed);}else{menu.css({top:pos.top+button.outerHeight(),left:pos.left}).show(effect,speed);}
this.labels.eq(0).trigger('mouseover').trigger('mouseenter').find('input').trigger('focus');button.addClass('ui-state-active');this._isOpen=true;this._trigger('open');},close:function(){if(this._trigger('beforeclose')===false){return;}
var o=this.options,effect=o.hide,speed=this.speed;if($.isArray(o.hide)){effect=o.hide[0];speed=o.hide[1]||this.speed;}
this.menu.hide(effect,speed);this.button.removeClass('ui-state-active').trigger('blur').trigger('mouseleave');this._isOpen=false;this._trigger('close');},enable:function(){this._toggleDisabled(false);},disable:function(){this._toggleDisabled(true);},checkAll:function(e){this._toggleChecked(true);this._trigger('checkAll');},uncheckAll:function(){this._toggleChecked(false);this._trigger('uncheckAll');},getChecked:function(){return this.menu.find('input').filter(':checked');},destroy:function(){$.Widget.prototype.destroy.call(this);this.button.remove();this.menu.remove();this.element.show();return this;},isOpen:function(){return this._isOpen;},widget:function(){return this.menu;},_setOption:function(key,value){var menu=this.menu;switch(key){case'header':menu.find('div.ui-multiselect-header')[value?'show':'hide']();break;case'checkAllText':menu.find('a.ui-multiselect-all span').eq(-1).text(value);break;case'uncheckAllText':menu.find('a.ui-multiselect-none span').eq(-1).text(value);break;case'height':menu.find('ul:last').height(parseInt(value,10));break;case'minWidth':this.options[key]=parseInt(value,10);this._setButtonWidth();this._setMenuWidth();break;case'selectedText':case'selectedList':case'noneSelectedText':this.options[key]=value;this.update();break;case'classes':menu.add(this.button).removeClass(this.options.classes).addClass(value);break;}
$.Widget.prototype._setOption.apply(this,arguments);}});})(jQuery);
/*! /*!
jQuery blockUI plugin jQuery blockUI plugin
Version 2.37 (29-JAN-2011) Version 2.37 (29-JAN-2011)

File diff suppressed because one or more lines are too long

View File

@ -263,10 +263,7 @@ jQuery( function($){
// ATTRIBUTE TABLES // ATTRIBUTE TABLES
// Multiselect attributes // Multiselect attributes
$("#attributes_list select.multiselect").multiselect({ $("#attributes_list select.multiselect").chosen();
noneSelectedText: woocommerce_writepanel_params.select_terms,
selectedList: 4
});
// Initial order // Initial order
var woocommerce_attributes_table_items = $('#attributes_list').children('tr').get(); var woocommerce_attributes_table_items = $('#attributes_list').children('tr').get();

File diff suppressed because one or more lines are too long

View File

@ -113,7 +113,8 @@
this.results_showing = false; this.results_showing = false;
this.result_highlighted = null; this.result_highlighted = null;
this.result_single_selected = null; this.result_single_selected = null;
this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].value === "" ? this.options.allow_single_deselect : false;
this.disable_search_threshold = this.options.disable_search_threshold || 0; this.disable_search_threshold = this.options.disable_search_threshold || 0;
this.choices = 0; this.choices = 0;
return this.results_none_found = this.options.no_results_text || "No results match"; return this.results_none_found = this.options.no_results_text || "No results match";

File diff suppressed because one or more lines are too long

View File

@ -326,8 +326,6 @@ class woocommerce_cart {
*/ */
function get_discounted_price( $values, $price ) { function get_discounted_price( $values, $price ) {
$this->discount_product = 0;
if ($this->applied_coupons) foreach ($this->applied_coupons as $code) : if ($this->applied_coupons) foreach ($this->applied_coupons as $code) :
$coupon = &new woocommerce_coupon( $code ); $coupon = &new woocommerce_coupon( $code );
@ -370,10 +368,18 @@ class woocommerce_cart {
if ($this_item_is_discounted) : if ($this_item_is_discounted) :
if ($coupon->type=='fixed_product') : if ($coupon->type=='fixed_product') :
$this->discount_product = $this->discount_product + ( $coupon->amount * $values['quantity'] ); if ($price < $coupon->amount) :
$discount_amount = $price;
else :
$discount_amount = $coupon->amount;
endif;
$price = $price - $coupon->amount; $price = $price - $coupon->amount;
if ($price<0) $price = 0;
$this->discount_product = $this->discount_product + ( $discount_amount * $values['quantity'] );
elseif ($coupon->type=='percent_product') : elseif ($coupon->type=='percent_product') :
$percent_discount = ( $values['data']->get_price_excluding_tax( false ) / 100 ) * $coupon->amount; $percent_discount = ( $values['data']->get_price_excluding_tax( false ) / 100 ) * $coupon->amount;
@ -389,20 +395,45 @@ class woocommerce_cart {
case "fixed_cart" : case "fixed_cart" :
/**
* This is the most complex discount - we need to divide the discount between rows based on their price in
* proportion to the subtotal. This is so rows with different tax rates get a fair discount, and so rows
* with no price (free) don't get discount too.
*/
// Get item discount by dividing item cost by subtotal to get a %
$discount_percent = ($values['data']->get_price_excluding_tax( false )*$values['quantity']) / $this->subtotal_ex_tax;
// Use pence to help prevent rounding errors // Use pence to help prevent rounding errors
$coupon_amount_pence = $coupon->amount * 100; $coupon_amount_pence = $coupon->amount * 100;
// Get item discount by dividing by total number of products in the cart // Work out the discount for the row
$item_discount = $coupon_amount_pence / $this->cart_contents_count; $item_discount = $coupon_amount_pence * $discount_percent;
// Work out discount per item
$item_discount = $item_discount / $values['quantity'];
// Pence
$price = ( $price * 100 );
// Check if discount is more than price
if ($price < $item_discount) :
$discount_amount = $price;
else :
$discount_amount = $item_discount;
endif;
// Take discount off of price (in pence) // Take discount off of price (in pence)
$price = ( $price * 100 ) - $item_discount; $price = $price - $discount_amount;
// Back to pounds // Back to pounds
$price = $price / 100; $price = $price / 100;
// Cannot be below 0
if ($price<0) $price = 0;
// Add coupon to discount total (once, since this is a fixed cart discount and we don't want rounding issues) // Add coupon to discount total (once, since this is a fixed cart discount and we don't want rounding issues)
$this->discount_product = $this->discount_product + (($item_discount*$values['quantity']) / 100); $this->discount_product = $this->discount_product + (($discount_amount*$values['quantity']) / 100);
break; break;
@ -470,7 +501,15 @@ class woocommerce_cart {
// Apply the discount // Apply the discount
if ($this_item_is_discounted) : if ($this_item_is_discounted) :
if ($coupon->type=='fixed_product') : if ($coupon->type=='fixed_product') :
$this->discount_total = $this->discount_total + ( $coupon->amount * $values['quantity'] );
if ($price < $coupon->amount) :
$discount_amount = $price;
else :
$discount_amount = $coupon->amount;
endif;
$this->discount_total = $this->discount_total + ( $discount_amount * $values['quantity'] );
elseif ($coupon->type=='percent_product') : elseif ($coupon->type=='percent_product') :
$this->discount_total = $this->discount_total + ( $price / 100 ) * $coupon->amount; $this->discount_total = $this->discount_total + ( $price / 100 ) * $coupon->amount;
endif; endif;
@ -522,12 +561,59 @@ class woocommerce_cart {
$this->reset_totals(); $this->reset_totals();
// Get count of all items + weights // Get count of all items + weights + subtotal (we may need this for discounts)
if (sizeof($this->cart_contents)>0) foreach ($this->cart_contents as $cart_item_key => $values) : if (sizeof($this->cart_contents)>0) foreach ($this->cart_contents as $cart_item_key => $values) :
$this->cart_contents_weight = $this->cart_contents_weight + ($values['data']->get_weight() * $values['quantity']);
$_product = $values['data'];
$this->cart_contents_weight = $this->cart_contents_weight + ($_product->get_weight() * $values['quantity']);
$this->cart_contents_count = $this->cart_contents_count + $values['quantity']; $this->cart_contents_count = $this->cart_contents_count + $values['quantity'];
// Base Price (inlusive of tax for now)
$base_price = $_product->get_price();
$tax_amount = 0;
if ($this->prices_include_tax) :
if ( get_option('woocommerce_calc_taxes')=='yes' && $_product->is_taxable() ) :
$tax_rate = $this->tax->get_shop_base_rate( $_product->get_tax_class() );
$tax_amount = $this->tax->calc_tax( $base_price * $values['quantity'], $tax_rate, true );
// Rounding
if ( get_option( 'woocommerce_tax_round_at_subtotal' ) == 'no' ) :
$tax_amount = round( $tax_amount, 2 );
endif;
endif;
// Sub total is based on base prices (without discounts)
$this->subtotal = $this->subtotal + ( $base_price * $values['quantity'] );
$this->subtotal_ex_tax = $this->subtotal_ex_tax + ( $base_price * $values['quantity'] ) - round($tax_amount, 2);
else :
if ( get_option('woocommerce_calc_taxes')=='yes' && $_product->is_taxable() ) :
$tax_rate = $this->tax->get_rate( $_product->get_tax_class() );
$tax_amount = $this->tax->calc_tax( $base_price * $values['quantity'], $tax_rate, false );
// Rounding
if ( get_option( 'woocommerce_tax_round_at_subtotal' ) == 'no' ) :
$tax_amount = round( $tax_amount, 2 );
endif;
endif;
// Sub total is based on base prices (without discounts)
$this->subtotal = $this->subtotal + ( $base_price * $values['quantity'] ) + $tax_amount;
$this->subtotal_ex_tax = $this->subtotal_ex_tax + ($base_price * $values['quantity']);
endif;
endforeach; endforeach;
// Now calc the main totals, including discounts
if ($this->prices_include_tax) : if ($this->prices_include_tax) :
/** /**
@ -567,7 +653,6 @@ class woocommerce_cart {
/** /**
* Regular tax calculation (customer inside base and the tax class is unmodified * Regular tax calculation (customer inside base and the tax class is unmodified
*/ */
$tax_amount = $this->tax->calc_tax( $base_price * $values['quantity'], $tax_rate, true );
$discounted_tax_amount = $this->tax->calc_tax( $discounted_price * $values['quantity'], $tax_rate, true ); $discounted_tax_amount = $this->tax->calc_tax( $discounted_price * $values['quantity'], $tax_rate, true );
/** /**
@ -600,13 +685,12 @@ class woocommerce_cart {
// Rounding // Rounding
if ( get_option( 'woocommerce_tax_round_at_subtotal' ) == 'no' ) : if ( get_option( 'woocommerce_tax_round_at_subtotal' ) == 'no' ) :
$tax_amount = round( $tax_amount, 2 );
$discounted_tax_amount = round( $discounted_tax_amount, 2 ); $discounted_tax_amount = round( $discounted_tax_amount, 2 );
endif; endif;
else : else :
$tax_amount = $discounted_tax_amount = 0; $discounted_tax_amount = 0;
endif; endif;
@ -622,10 +706,6 @@ class woocommerce_cart {
// Cart contents total is based on discounted prices and is used for the final total calculation // Cart contents total is based on discounted prices and is used for the final total calculation
$this->cart_contents_total = $this->cart_contents_total + $total_item_price; $this->cart_contents_total = $this->cart_contents_total + $total_item_price;
// Sub total is based on base prices (without discounts)
$this->subtotal = $this->subtotal + ( $base_price * $values['quantity'] );
$this->subtotal_ex_tax = $this->subtotal_ex_tax + ( $base_price * $values['quantity'] ) - round($tax_amount, 2);
endforeach; endif; endforeach; endif;
else : else :
@ -650,17 +730,15 @@ class woocommerce_cart {
// Now calc product rates // Now calc product rates
$tax_rate = $this->tax->get_rate( $_product->get_tax_class() ); $tax_rate = $this->tax->get_rate( $_product->get_tax_class() );
$tax_amount = $this->tax->calc_tax( $base_price * $values['quantity'], $tax_rate, false );
$discounted_tax_amount = $this->tax->calc_tax( $discounted_price * $values['quantity'], $tax_rate, false ); $discounted_tax_amount = $this->tax->calc_tax( $discounted_price * $values['quantity'], $tax_rate, false );
// Rounding // Rounding
if ( get_option( 'woocommerce_tax_round_at_subtotal' ) == 'no' ) : if ( get_option( 'woocommerce_tax_round_at_subtotal' ) == 'no' ) :
$tax_amount = round( $tax_amount, 2 );
$discounted_tax_amount = round( $discounted_tax_amount, 2 ); $discounted_tax_amount = round( $discounted_tax_amount, 2 );
endif; endif;
else : else :
$tax_amount = $discounted_tax_amount = 0; $discounted_tax_amount = 0;
endif; endif;
// Total item price (price, discount and quantity) // Total item price (price, discount and quantity)
@ -675,10 +753,6 @@ class woocommerce_cart {
// Cart contents total is based on discounted prices and is used for the final total calculation // Cart contents total is based on discounted prices and is used for the final total calculation
$this->cart_contents_total = $this->cart_contents_total + $total_item_price; $this->cart_contents_total = $this->cart_contents_total + $total_item_price;
// Sub total is based on base prices (without discounts)
$this->subtotal = $this->subtotal + ( $base_price * $values['quantity'] ) + $tax_amount;
$this->subtotal_ex_tax = $this->subtotal_ex_tax + $base_price * $values['quantity'];
endforeach; endif; endforeach; endif;
endif; endif;
@ -982,7 +1056,7 @@ class woocommerce_cart {
function get_product_subtotal( $price, $tax_rate, $quantity ) { function get_product_subtotal( $price, $tax_rate, $quantity ) {
global $woocommerce; global $woocommerce;
if ( get_option('woocommerce_calc_taxes')=='yes' && $tax_rate>0 && (get_option('woocommerce_display_cart_prices_excluding_tax')=='yes' || !$this->prices_include_tax) ) : if ( get_option('woocommerce_calc_taxes')=='yes' && $tax_rate>0 && (get_option('woocommerce_display_cart_prices_excluding_tax')=='yes' && $this->prices_include_tax) ) :
$tax_amount = $this->tax->calc_tax( $price * $quantity, $tax_rate, true ); $tax_amount = $this->tax->calc_tax( $price * $quantity, $tax_rate, true );
$row_price = ( $price * $quantity ) - round($tax_amount, 2); $row_price = ( $price * $quantity ) - round($tax_amount, 2);

View File

@ -433,7 +433,7 @@ if (!function_exists('woocommerce_variable_add_to_cart')) {
endif; endif;
?> ?>
<?php endif;?> <?php endif;?>
</td> </select></td>
</tr> </tr>
<?php endforeach;?> <?php endforeach;?>
</tbody> </tbody>
@ -1272,7 +1272,7 @@ function woocommerce_order_details_table( $order_id ) {
</tr> </tr>
<?php if ($order->order_shipping>0) : ?><tr> <?php if ($order->order_shipping>0) : ?><tr>
<td colspan="2"><?php _e('Shipping', 'woothemes'); ?></td> <td colspan="2"><?php _e('Shipping', 'woothemes'); ?></td>
<td><?php echo $order->get_shipping_to_display(); ?></small></td> <td><?php echo $order->get_shipping_to_display(); ?></td>
</tr><?php endif; ?> </tr><?php endif; ?>
<?php if ($order->get_total_tax()>0) : ?><tr> <?php if ($order->get_total_tax()>0) : ?><tr>
<td colspan="2"><?php _e('Tax', 'woothemes'); ?></td> <td colspan="2"><?php _e('Tax', 'woothemes'); ?></td>