// === DEDUCT POINTS ON ORDER CREATION === add_action('woocommerce_checkout_order_created', 'deduct_mycred_points_on_order_created'); function deduct_mycred_points_on_order_created($order) { if (!is_user_logged_in()) return; $user_id = get_current_user_id(); $points_used = WC()->session->get('mycred_partial_points'); if (!$points_used || $points_used <= 0) return; // Log the deduction with order reference mycred_subtract( 'partial_payment', // Reference $user_id, // User ID $points_used, // Amount 'Used for partial payment on Order #' . $order->get_id(), // Log $order->get_id() // Data reference ); // Clear session so it doesn't get applied again WC()->session->__unset('mycred_points_lock'); WC()->session->__unset('mycred_partial_points'); } Posts – Posts – iceasarmartinez – Ubid710.com
Profile Photo

iceasarmartinezOffline

out of 5
0 Ratings

    Sorry, no posts found!

    Please wait...

    Media

    User Balance 0 / Reward Points

    User Badges

    Presented by BLifted.net
    Our Official and only Email is UBid7100@gmail.com
    Ubid7100.com Copyright © 2025 Ubid710.com
    0
      0
      Your Cart
      Your cart is emptyReturn to Shop