How to change cart product price dynamically in woocommerce worpdress

For change cart product price dynamically just copy and paste below code in your theme's functions.php

and change code according to your need.

add_action( 'woocommerce_get_price', 'rj_bill_payment_price_change_for_customer',10, 2 );
function rj_bill_payment_price_change_for_customer( $price, $product ) {
    global $wpdb,$post,$woocommerce;
   
// do stuff here as per your need

    return $price;

}

Comments

Popular posts from this blog

How to add a custom sorting or order by option on category archive or product archive page in woocommerce wordpress

How to create a custom wp_list_table and bulk action in wordpress

How to add image option in nav menu in wordpress