More meaningful code.

This commit is contained in:
Manos Psychogyiopoulos 2012-06-29 18:16:43 +03:00
parent 3e97cc3ef1
commit 123d04f0e5
1 changed files with 10 additions and 2 deletions

View File

@ -49,9 +49,17 @@ global $woocommerce;
<!-- Product Name -->
<td class="product-name">
<?php
if ( !$_product->is_visible() || ( get_post_meta( $_product->id, '_visibility', true ) == 'hidden' ) )
if ( !$_product->is_visible() )
echo apply_filters('woocommerce_in_cart_product_title', $_product->get_title(), $values, $cart_item_key );
else
else if ( $_product instanceof WC_Product_Variation ) {
$_parent = new WC_Product( $_product->id );
if ( !$_parent->is_visible() )
echo apply_filters('woocommerce_in_cart_product_title', $_product->get_title(), $values, $cart_item_key );
else
printf('<a href="%s">%s</a>', esc_url( get_permalink( apply_filters('woocommerce_in_cart_product_id', $values['product_id'] ) ) ), apply_filters('woocommerce_in_cart_product_title', $_product->get_title(), $values, $cart_item_key ) );
}
else
printf('<a href="%s">%s</a>', esc_url( get_permalink( apply_filters('woocommerce_in_cart_product_id', $values['product_id'] ) ) ), apply_filters('woocommerce_in_cart_product_title', $_product->get_title(), $values, $cart_item_key ) );
// Meta data