In My theme there If the product has variation Is show some thing like 1x$18=$18 how to remove the Quantity if the product has variations. I need Something Like pack x $18 =$18 but If the Product has no variation it show as it is . Is there any "If condition to apply for variation"? Please help me.
<?php echo apply_filters( 'woocommerce_widget_cart_item_quantity', '<span class="quantity">' . sprintf( '%s × %s', $cart_item['quantity'], $product_price ) . '</span>', $cart_item, $cart_item_key ); ?>
I am Trying to make this
<?php
if( $product->is_type( 'simple' ) ){
echo apply_filters( 'woocommerce_widget_cart_item_quantity', '<span class="quantity">' . sprintf( '%s × %s', $cart_item['quantity'], $product_price ) . '</span>', $cart_item, $cart_item_key );
} else{
apply_filters( 'woocommerce_widget_cart_item_quantity', '<span class="quantity">' . sprintf( $product_price ) . '</span>', $cart_item, $cart_item_key );
}
$product = new WC_Product( get_the_ID() );
?>
But not Work
Move this line to top of code instead of end of code.