Tweak - Filters for attribute default values.

This commit is contained in:
Mike Jolley 2013-03-15 19:31:51 +00:00
parent 4e3768bd42
commit 946ecaaae2
5 changed files with 24 additions and 7 deletions

View File

@ -416,13 +416,27 @@ function woocommerce_product_data_box() {
</tr>
<tr>
<td>
<label><input type="checkbox" class="checkbox" <?php if ( ! empty( $attribute['is_visible'] ) ) checked( $attribute['is_visible'], 1 ); ?> name="attribute_visibility[<?php echo $i; ?>]" value="1" /> <?php _e( 'Visible on the product page', 'woocommerce' ); ?></label>
<label><input type="checkbox" class="checkbox" <?php
if ( isset( $attribute['is_visible'] ) )
checked( $attribute['is_visible'], 1 );
else
checked( apply_filters( 'default_attribute_visibility', false, $tax ), true );
?> name="attribute_visibility[<?php echo $i; ?>]" value="1" /> <?php _e( 'Visible on the product page', 'woocommerce' ); ?></label>
</td>
</tr>
<tr>
<td>
<div class="enable_variation show_if_variable">
<label><input type="checkbox" class="checkbox" <?php if ( ! empty( $attribute['is_variation'] ) ) checked( $attribute['is_variation'], 1 ); ?> name="attribute_variation[<?php echo $i; ?>]" value="1" /> <?php _e( 'Used for variations', 'woocommerce' ); ?></label>
<label><input type="checkbox" class="checkbox" <?php
if ( isset( $attribute['is_variation'] ) )
checked( $attribute['is_variation'], 1 );
else
checked( apply_filters( 'default_attribute_variation', false, $tax ), true );
?> name="attribute_variation[<?php echo $i; ?>]" value="1" /> <?php _e( 'Used for variations', 'woocommerce' ); ?></label>
</div>
</td>
</tr>

View File

@ -463,7 +463,9 @@ function woocommerce_admin_scripts() {
'currency_format_decimal_sep' => esc_attr( stripslashes( get_option( 'woocommerce_price_decimal_sep' ) ) ),
'currency_format_thousand_sep' => esc_attr( stripslashes( get_option( 'woocommerce_price_thousand_sep' ) ) ),
'currency_format' => esc_attr( str_replace( array( '%1$s', '%2$s' ), array( '%s', '%v' ), get_woocommerce_price_format() ) ), // For accounting JS
'product_types' => array_map( 'sanitize_title', get_terms( 'product_type', array( 'fields' => 'names' ) ) )
'product_types' => array_map( 'sanitize_title', get_terms( 'product_type', array( 'fields' => 'names' ) ) ),
'default_attribute_visibility' => apply_filters( 'default_attribute_visibility', false ),
'default_attribute_variation' => apply_filters( 'default_attribute_variation', false )
);
wp_localize_script( 'woocommerce_writepanel', 'woocommerce_writepanel_params', $woocommerce_witepanel_params );

View File

@ -1128,13 +1128,13 @@ jQuery( function($){
</tr>\
<tr>\
<td>\
<label><input type="checkbox" class="checkbox" checked="checked" name="attribute_visibility[' + size + ']" value="1" /> ' + woocommerce_writepanel_params.visible_label + '</label>\
<label><input type="checkbox" class="checkbox" ' + ( woocommerce_writepanel_params.default_attribute_visibility ? 'checked="checked"' : '' ) + ' name="attribute_visibility[' + size + ']" value="1" /> ' + woocommerce_writepanel_params.visible_label + '</label>\
</td>\
</tr>\
<tr>\
<td>\
<div class="enable_variation show_if_variable" ' + enable_variation + '>\
<label><input type="checkbox" class="checkbox" name="attribute_variation[' + size + ']" value="1" /> ' + woocommerce_writepanel_params.used_for_variations_label + '</label>\
<label><input type="checkbox" class="checkbox" ' + ( woocommerce_writepanel_params.default_attribute_variation ? 'checked="checked"' : '' ) + ' name="attribute_variation[' + size + ']" value="1" /> ' + woocommerce_writepanel_params.used_for_variations_label + '</label>\
</div>\
</td>\
</tr>\

File diff suppressed because one or more lines are too long

View File

@ -173,6 +173,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* Tweak - Add order_id to woocommerce_download_product hook
* Tweak - Disabled prettyPhoto deeplinking
* Tweak - Applied a width to the product name column (edit products) to fix layout small screens
* Tweak - Filters for attribute default values.
* Fix - WC_Order_Item_Meta support for keys with multiple values.
* Fix - Codestyling bug with meta.php
* Fix - Icon replacement in .woocommerce-info for Gecko