Learn Tutorials Point - LTP > WordPress > How to change order total after checkout in Woocommerce WordPress
How to change order total after checkout in Woocommerce WordPress
This code used to change the order total price after checkout product, this code adds your function.php
file in WordPress.
<?php add_action( 'woocommerce_checkout_create_order', 'change_total_on_checking', 20, 1 ); function change_total_on_checking( $order ) { // Get order total echo $total = $order->get_total(); ## -- Make your checking and calculations -- ## $new_total = $total * 2; // <== Fake calculation // Set the new calculated total $order->set_total( $new_total ); } ?>
Author: Learn Tutorials Point
We Well organized and easy-to-understand Interactive tutorials With lots of examples of how to use Tutorials WordPress, PHP, Bootstrap, Bootstrap 4, HTML, CSS, AJAX, jQuery, Woocommerce, Post, Database, Javascript, Theme, Responsive, Templates.
Trending Posts
Tags
ACF
Ading custom columns
admin
Bootstrap
Cart Price
categories
Change Price
class
Code
comments
Create
Creating custom post Type
CSS
current
custom
Customizing
Custom Post
Custom Post Type
Custom Taxonomy
database
Date
Fatch
form
function
HTML
Image
Install
javascript
jQuery
Menu
PHP
Post
Post Type
Price
product
responsive
Resular price
Single product
Table
taxonomy
Theme
Title
woocommerce
Wordpress
Wordpress Code
Every weekend i used to visit this site, for the reason that i wish for enjoyment, for the reason that this this web
page conations truly pleasant funny information too.