Changing the price when choosing the shipping method
-
I had to change the output through woocommerce_get_price
add_action('woocommerce_get_price','change_price_regular_member', 10, 2); function change_price_regular_member($price, $productd){ $pprise = $prise; global $current_user; $user_info = get_userdata($current_user->id); if(get_current_user_id() == 0) $prise = ($price*0/100)+$price; else if (in_array('opt2', $user_info->roles)) { $product_id = $productd->id; $current_price = (int)get_field('markup_for_the_goods', $product_id); $prise = ($price*$current_price/100)+$price; } else $prise = ($price*0/100)+$price; return $prise; }
We have added delivery methods without cost to the site, and now when the delivery methods, the price changes.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Changing the price when choosing the shipping method’ is closed to new replies.