How to show “regular price” instead of a “discounted price” on mini-cart (Woo)

十年热恋 提交于 2019-12-24 01:15:34

问题


I have read like every single topic about woocommerce but cannot find out how to show regular price instead of a discounted price on mini-cart. (Yes, i want to show regular price in mini-cart.php)

I think i should modify mini-cart.php:41 but i dont know how i can show regular price.

$product_price     = apply_filters( 'woocommerce_cart_item_price', WC()->cart->get_product_price( $_product ), $cart_item, $cart_item_key );

Can someone help me with this one?


回答1:


Try this:

$product_price     = apply_filters( 'woocommerce_cart_item_price', WC()->cart->get_regular_price( $_product ), $cart_item, $cart_item_key );



回答2:


Yes i used this on mini-cart.php:41 and worked!

apply_filters( 'woocommerce_get_regular_price', $_product->get_regular_price(), $cart_item, $cart_item_key );


来源:https://stackoverflow.com/questions/41184796/how-to-show-regular-price-instead-of-a-discounted-price-on-mini-cart-woo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!