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 add a custom email functionality in woocommerce,wordpress for example new email template for shipping order

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