From e58b101fd548615a8453cff11317300c7a61ad40 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Wed, 25 Sep 2013 09:36:04 +0100 Subject: [PATCH] If no variations exist, show out of stock notice. Closes #3763. --- .../single-product/add-to-cart/variable.php | 151 +++++++++--------- 1 file changed, 79 insertions(+), 72 deletions(-) diff --git a/templates/single-product/add-to-cart/variable.php b/templates/single-product/add-to-cart/variable.php index bf054ccd00c..9c9b8ca20ec 100644 --- a/templates/single-product/add-to-cart/variable.php +++ b/templates/single-product/add-to-cart/variable.php @@ -4,7 +4,7 @@ * * @author WooThemes * @package WooCommerce/Templates - * @version 2.0.3 + * @version 2.1.0 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly @@ -15,83 +15,90 @@ global $woocommerce, $product, $post;
- - - $options ) : $loop++; ?> - - - - - - -
+ + $options ) : $loop++; ?> + + + + + + +
' . __( 'Clear selection', 'woocommerce' ) . ''; + ?>
- // Get terms if this is a taxonomy - ordered - if ( taxonomy_exists( $name ) ) { + - $orderby = wc_attribute_orderby( $name ); - - switch ( $orderby ) { - case 'name' : - $args = array( 'orderby' => 'name', 'hide_empty' => false, 'menu_order' => false ); - break; - case 'id' : - $args = array( 'orderby' => 'id', 'order' => 'ASC', 'menu_order' => false ); - break; - case 'menu_order' : - $args = array( 'menu_order' => 'ASC' ); - break; - } - - $terms = get_terms( $name, $args ); - - foreach ( $terms as $term ) { - if ( ! in_array( $term->slug, $options ) ) - continue; - - echo ''; - } - } else { - - foreach ( $options as $option ) { - echo ''; - } - - } - } - ?> - ' . __( 'Clear selection', 'woocommerce' ) . ''; - ?>
- - - -