This commit is contained in:
Manos Psychogyiopoulos 2012-07-10 18:46:09 +03:00
parent 250604f267
commit 2faa412686
1 changed files with 9 additions and 9 deletions

18
templates/loop/add-to-cart.php Normal file → Executable file
View File

@ -10,7 +10,7 @@ if( $product->get_price() === '' && $product->product_type != 'external' ) retur
<?php if ( ! $product->is_in_stock() ) : ?> <?php if ( ! $product->is_in_stock() ) : ?>
<a href="<?php echo get_permalink($product->id); ?>" class="button"><?php echo apply_filters('out_of_stock_add_to_cart_text', __('Read More', 'woocommerce')); ?></a> <a href="<?php echo apply_filters( 'out_of_stock_add_to_cart_url', get_permalink( $product->id ) ); ?>" class="button"><?php echo apply_filters( 'out_of_stock_add_to_cart_text', __( 'Read More', 'woocommerce' ) ); ?></a>
<?php else : ?> <?php else : ?>
@ -18,20 +18,20 @@ if( $product->get_price() === '' && $product->product_type != 'external' ) retur
switch ( $product->product_type ) { switch ( $product->product_type ) {
case "variable" : case "variable" :
$link = get_permalink($product->id); $link = apply_filters( 'variable_add_to_cart_url', get_permalink( $product->id ) );
$label = apply_filters('variable_add_to_cart_text', __('Select options', 'woocommerce')); $label = apply_filters( 'variable_add_to_cart_text', __('Select options', 'woocommerce') );
break; break;
case "grouped" : case "grouped" :
$link = get_permalink($product->id); $link = apply_filters( 'grouped_add_to_cart_url', get_permalink( $product->id ) );
$label = apply_filters('grouped_add_to_cart_text', __('View options', 'woocommerce')); $label = apply_filters( 'grouped_add_to_cart_text', __('View options', 'woocommerce') );
break; break;
case "external" : case "external" :
$link = get_permalink($product->id); $link = apply_filters( 'external_add_to_cart_url', get_permalink( $product->id ) );
$label = apply_filters('external_add_to_cart_text', __('Read More', 'woocommerce')); $label = apply_filters( 'external_add_to_cart_text', __('Read More', 'woocommerce') );
break; break;
default : default :
$link = esc_url( $product->add_to_cart_url() ); $link = apply_filters( 'add_to_cart_url', esc_url( $product->add_to_cart_url() ) );
$label = apply_filters('add_to_cart_text', __('Add to cart', 'woocommerce')); $label = apply_filters( 'add_to_cart_text', __('Add to cart', 'woocommerce') );
break; break;
} }