Fix for variation shipping class detection

This commit is contained in:
Mike Jolley 2012-02-10 12:16:21 +00:00
parent 9395aea467
commit 473a112c66
3 changed files with 5 additions and 2 deletions

View File

@ -321,7 +321,7 @@ function variable_product_type_options() {
\
<td><label><?php _e('Virtual', 'woocommerce'); ?> <a class="tips" tip="<?php _e('Enable this option if a product is not shipped or there is no shipping cost.', 'woocommerce'); ?>" href="#">[?]</a></label><input type="checkbox" class="checkbox" name="variable_is_virtual[' + loop + ']" /></td>\
\
<td><label><?php _e('Enabled', 'woocommerce'); ?></label><input type="checkbox" class="checkbox" name="variable_enabled[' + loop + ']" /></td>\
<td><label><?php _e('Enabled', 'woocommerce'); ?></label><input type="checkbox" class="checkbox" checked="checked" name="variable_enabled[' + loop + ']" /></td>\
\
<td>\
<div class="show_if_variation_downloadable file_path_field" style="display:none;"><label><?php _e('File path:', 'woocommerce'); ?> <a class="tips" tip="<?php _e('Enter a File Path to make this variation a downloadable product, or leave blank.', 'woocommerce'); ?>" href="#">[?]</a></label><input type="text" size="5" class="file_path" name="variable_file_path[' + loop + ']" placeholder="<?php _e('File path/URL', 'woocommerce'); ?>" /> <input type="button" class="upload_file_button button" value="<?php _e('&uarr;', 'woocommerce'); ?>" title="<?php _e('Upload', 'woocommerce'); ?>" /></div>\

View File

@ -267,7 +267,7 @@ class WC_Product_Variation extends WC_Product {
*/
function get_shipping_class() {
if (!$this->variation_shipping_class) :
$classes = get_the_terms( $this->id, 'product_shipping_class' );
$classes = get_the_terms( $this->variation_id, 'product_shipping_class' );
if ($classes && !is_wp_error($classes)) $this->variation_shipping_class = current($classes)->slug; else $this->variation_shipping_class = parent::get_shipping_class();
endif;
return $this->variation_shipping_class;

View File

@ -82,6 +82,9 @@ Yes you can! Join in on our GitHub repository :) https://github.com/woothemes/wo
== Changelog ==
= 1.4.3 =
* Fix for variation shipping class detection
= 1.4.2 - 09/02/2012 =
* Uninstall fix
* Improved template loader - passes args instead of using globals