small markup tweaks

This commit is contained in:
Mike Jolley 2012-05-26 15:18:29 +01:00
parent 7f0048480c
commit 7bcb3deb62
3 changed files with 31 additions and 28 deletions

View File

@ -11,7 +11,7 @@
if(d=="woocommerce_shortcodes_button"){
d=e.createMenuButton( "woocommerce_shortcodes_button",{
title:"Insert WooCommerce Shortcode",
title:"Insert Shortcode",
icons:false
});
@ -35,7 +35,7 @@
b.addSeparator();
c=b.addMenu({title:"WooCommerce Pages"});
c=b.addMenu({title:"Pages"});
a.addImmediate(c,"Cart","[woocommerce_cart]" );
a.addImmediate(c,"Checkout","[woocommerce_checkout]" );
a.addImmediate(c,"Order tracking","[woocommerce_order_tracking]" );

View File

@ -157,6 +157,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* Fix - Strange error where detecting the page (is_page etc) would break the canonical redirect in some instances when hooked into 'wp'. Used the later get_header hook instead.
* Fix - fix for https://bugs.php.net/bug.php?id=61166 (thanks Max Rice)
* Fix - postcode validation when country is different for shipping vs billing
* Fix - user_email typo
= 1.5.6 - 17/05/2012 =
* Feature - Default display for shipping methods is radio buttons. Before, when methods were enabled/disabled based on coupons or customer, changed methods could go unnoticed. Radio options are always visible.

View File

@ -5,36 +5,38 @@
global $product;
if( $product->get_price() === '' && $product->product_type!=='external') return;
if( $product->get_price() === '' && $product->product_type != 'external' ) return;
?>
<?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>
<?php
else :
switch ($product->product_type) :
case "variable" :
$link = get_permalink($product->id);
$label = apply_filters('variable_add_to_cart_text', __('Select options', 'woocommerce'));
break;
case "grouped" :
$link = get_permalink($product->id);
$label = apply_filters('grouped_add_to_cart_text', __('View options', 'woocommerce'));
break;
case "external" :
$link = get_permalink($product->id);
$label = apply_filters('external_add_to_cart_text', __('Read More', 'woocommerce'));
break;
default :
$link = esc_url( $product->add_to_cart_url() );
$label = apply_filters('add_to_cart_text', __('Add to cart', 'woocommerce'));
break;
endswitch;
<?php else : ?>
<?php
switch ( $product->product_type ) {
case "variable" :
$link = get_permalink($product->id);
$label = apply_filters('variable_add_to_cart_text', __('Select options', 'woocommerce'));
break;
case "grouped" :
$link = get_permalink($product->id);
$label = apply_filters('grouped_add_to_cart_text', __('View options', 'woocommerce'));
break;
case "external" :
$link = get_permalink($product->id);
$label = apply_filters('external_add_to_cart_text', __('Read More', 'woocommerce'));
break;
default :
$link = esc_url( $product->add_to_cart_url() );
$label = apply_filters('add_to_cart_text', __('Add to cart', 'woocommerce'));
break;
}
printf('<a href="%s" rel="nofollow" data-product_id="%s" class="button add_to_cart_button product_type_%s">%s</a>', $link, $product->id, $product->product_type, $label);
printf('<a href="%s" rel="nofollow" data-product_id="%s" class="button add_to_cart_button product_type_%s">%s</a>', $link, $product->id, $product->product_type, $label);
?>
endif;
?>
<?php endif; ?>