• avisonjohn

    (@avisonjohn)


    I have been looking at different plugins and really like the YITH Points & Rewards plugin.
    However, I need to write a separate PHP script, which will allow me to either ‘redeem’ or ‘subtract’ points from a user (given their User ID).
    Essentially, I have a small web app, and when the user accesses this webapp, I need to be able to ‘redeem’ 1 point from their current balance.
    I would also need to be able to check their current balance to ensure that they have credits available.

    Is there a way of grabbing this information from the database, or are there any functions and/or hooks available for this?

Viewing 1 replies (of 1 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hello,
    you can use this to remove points to your customers:

    YITH_WC_Points_Rewards()->add_point_to_customer( $user_id, $points, 'admin_action);

    to remove points add ‘-‘ before the number of points to add.

    The total points are stored inside a meta of customer:

    $total_points = get_user_meta( $customer_id, '_ywpar_user_total_points', true );

Viewing 1 replies (of 1 total)

The topic ‘Manually redeem/subtract points’ is closed to new replies.