Merge pull request #3835 from tivnet/master

Fix product links in Cart when no variation
This commit is contained in:
Mike Jolley 2013-09-26 02:27:44 -07:00
commit 99500160ba
2 changed files with 2 additions and 2 deletions

View File

@ -64,7 +64,7 @@ do_action( 'woocommerce_before_cart' ); ?>
if ( ! $_product->is_visible() )
echo apply_filters( 'woocommerce_cart_item_name', $_product->get_title(), $cart_item, $cart_item_key );
else
echo apply_filters( 'woocommerce_cart_item_name', sprintf( '<a href="%s">%s</a>', add_query_arg( $cart_item['variation'], $_product->get_permalink() ), $_product->get_title() ), $cart_item, $cart_item_key );
echo apply_filters( 'woocommerce_cart_item_name', sprintf( '<a href="%s">%s</a>', ( $cart_item['variation'] ? add_query_arg( $cart_item['variation'], $_product->get_permalink() ) : $_product->get_permalink() ), $_product->get_title() ), $cart_item, $cart_item_key );
// Meta data
echo $woocommerce->cart->get_item_data( $cart_item );

View File

@ -813,7 +813,7 @@ endif;
* Returns the main instance of WC to prevent the need to use globals.
*
* @since 2.1
* @return object WooCommerce
* @return WooCommerce
*/
function WC() {
return WooCommerce::instance();