How to change Order ID to use Sequential Order Number
-
We are using an affiliate addon and it uses the Order Number from WooCommerce but isn’t using the Sequential Order Number, it has the following code in functions.php to get its order number from. What would I change to make it work properly?
@ini_set(‘display_errors’, 0);
add_action(‘woocommerce_thankyou’, ‘affiliate_tracking’);
function affiliate_tracking( $order_id ) {
global $wpdb;
$order = new WC_Order( $order_id );
$order_total = $order->get_order_total();
$shipping = $order->order_shipping;
$total = $order_total – $shipping;
$coupon = $wpdb->get_var($wpdb->prepare(“SELECT order_item_name FROM wp_woocommerce_order_items where order_id = ‘$order_id’ and order_item_type = ‘coupon'”));
echo “<img src=’https://dev.elimidrol.com/affiliate-program/sale.php?profile=85&idev_saleamt=$total&idev_ordernum=$order_id&coupon_code=$coupon’ height=’1′ width=’1′ border=’0′>”; }I tried changing “$order_id” with “$order->get_order_number()” but that didn’t work. Thank you in advance.
https://www.ads-software.com/plugins/woocommerce-sequential-order-numbers/
- The topic ‘How to change Order ID to use Sequential Order Number’ is closed to new replies.