DEV Community

alvinarichard
alvinarichard

Posted on

Change WooCommerce Dynamic Pricing Display

WooCommerce pricing display is one of the essential part of product page. There are two ways to change WooCommerce pricing display.

• woocommerce_get_price_html: Price is shown on the product and shop pages.
• woocommerce_cart_item_price: Product prices are shown in the cart table.

Change Price Display for All WooCommerce Products


function cw_change_product_price_display( $price ) {
    $price .= ' At Each Item Product';
    return $price;
  }
  add_filter( 'woocommerce_get_price_html', 'cw_change_product_price_display' );
  add_filter( 'woocommerce_cart_item_price', 'cw_change_product_price_display' );

Enter fullscreen mode Exit fullscreen mode

Change Price Display Based on Product Fields

If you want to change price display for some products then add a field for each product on the list and retrieve this field in the code.

Top comments (1)

Collapse
 
xeeshop profile image
Xeeshop

Discount Price For Woocommerce provide you can be give price base on qty for particular product in woocommerce.