Support

Account

Forum Replies Created

  • The answer above was so close; the key to my success was $cart_item:

    function price_count_cart( $price_cart, $cart_item, $cart_item_key ) {
    	$product_id = $cart_item['product_id'];
    	$count_cart = get_field('count', $product_id);
    	if (!$count_cart) {
    		return $price_cart;
    	}
    	else {
    		return '<span class="custom-prc">'.$price_cart.' / <small>'.$count_cart.'</small></span>';	
    	}	
    }
    add_filter( 'woocommerce_cart_item_price', 'price_count_cart', 10, 3 );
Viewing 1 post (of 1 total)