Home › Forums › Front-end Issues › Custom Fields for products not showing in Cart page and Checkout › Reply To: Custom Fields for products not showing in Cart page and Checkout
$product_id
has no value in your code
function cw_change_product_price_display( $price, $product ) {
$sell_price = get_field('sell_price', $product->ID);
$sell_duration = get_field('duration', $product->ID);
$price .= " | SELL ₦$sell_price in $sell_duration";
return $price;
}
add_filter( 'woocommerce_get_price_html', 'cw_change_product_price_display' 10, 2);
add_filter( 'woocommerce_cart_item_price', 'cw_change_product_price_display' 10, 2);
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.