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 image option in nav menu in wordpress

How to change user id on checkout page for assign order to different user in woocommerce wordpress

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