Merge pull request #9201 from woothemes/variations-hijax

Hijax for variations on frontend, closes #9200
This commit is contained in:
Claudio Sanches 2015-09-22 13:52:22 -03:00
commit 0b0727453e
2 changed files with 3 additions and 3 deletions

View File

@ -722,7 +722,7 @@ class WC_Form_Handler {
}
// Get valid value from variation
$valid_value = $variation->variation_data[ $taxonomy ];
$valid_value = isset( $variation->variation_data[ $taxonomy ] ) ? $variation->variation_data[ $taxonomy ] : '';
// Allow if valid
if ( '' === $valid_value || $valid_value === $value ) {

View File

@ -31,7 +31,7 @@ do_action( 'woocommerce_before_add_to_cart_form' ); ?>
<?php
$selected = isset( $_REQUEST[ 'attribute_' . sanitize_title( $attribute_name ) ] ) ? wc_clean( $_REQUEST[ 'attribute_' . sanitize_title( $attribute_name ) ] ) : $product->get_variation_default_attribute( $attribute_name );
wc_dropdown_variation_attribute_options( array( 'options' => $options, 'attribute' => $attribute_name, 'product' => $product, 'selected' => $selected ) );
echo end( $attribute_keys ) === $attribute_name ? '<a class="reset_variations" href="#">' . __( 'Clear selection', 'woocommerce' ) . '</a>' : '';
echo end( $attribute_keys ) === $attribute_name ? '<a class="reset_variations" href="#" style="visibility: hidden;">' . __( 'Clear selection', 'woocommerce' ) . '</a>' : '';
?>
</td>
</tr>
@ -41,7 +41,7 @@ do_action( 'woocommerce_before_add_to_cart_form' ); ?>
<?php do_action( 'woocommerce_before_add_to_cart_button' ); ?>
<div class="single_variation_wrap" style="display:none;">
<div class="single_variation_wrap">
<?php
/**
* woocommerce_before_single_variation Hook