Attempt to fix the variations all autofilling with last selection
authorLaury GvR <laury@gaslightmedia.com>
Thu, 21 Apr 2016 20:17:52 +0000 (16:17 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Thu, 21 Apr 2016 20:17:52 +0000 (16:17 -0400)
woocommerce/single-product/add-to-cart/variable.php

index 7b9bc20..30d3f6e 100644 (file)
@@ -40,7 +40,8 @@ do_action( 'woocommerce_before_add_to_cart_form' ); ?>
                         <td class="value">
                             <?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 ? apply_filters( 'woocommerce_reset_variations_link', '<a class="reset_variations" href="#">' . __( 'Clear', 'woocommerce' ) . '</a>' ) : '';
+                            ?>
                         </td>
                     </tr>
                     <?php $variations_ob = ob_get_clean(); $variations_arr[wc_attribute_label($attribute_name)] = $variations_ob; endforeach;