Buying myCRED points using WooCommerce instead of going through shortcodes

front page Forums How-to Questions Buying myCRED points using WooCommerce instead of going through shortcodes

Viewing 15 posts - 1 through 15 (of 22 total)
  • Author
  • #14546
    AvatarHuy N


    I would like to make a WooCommerce Product (for example, Gold Package) that if a user Buys them (using real money, just like buying a regular WooCommerce product), a certain points will be added to that user accounts. It’s like a virtual currency system.

    Is that possible with myCRED?

    P/S: Please do not recommend buyCRED. I am trying to avoid shortcode. I’d like people to see it as a product.

    Thank you.



    I promise, I will not mention buyCRED 🙂

    Go create a new product in WooCommerce and make it virtual. In the top right corner you should see “myCRED Reward” which allows you to set a point amount the user gets when they pay for this product. Set the amount you want them to get and save.

    A user then needs to be logged in and buy this product using real money to get the points. Once the payment has been marked as paid by the gateway you use, the points are paid out.

    A few things to keep in mind:

    1. Points will not be awarded if the user is not logged in and does not create an account with their order.

    2. By default, myCRED will not pay out points if the order was paid with points (can be overriden).

    3. If the user is set to be excluded from using myCRED, they will also not receive points.

    4. If you use a manual payment gateway like check or bank transfer then points will not be awarded out. (can be overriden).


    I also set it up like this.
    But we have a problem, cause the erotic stuff we sell are streaming cam shows, so many payment provders are out.
    We need to have a package with coijns to be paid over bank transfer and invoice, but we would need to have to know how it can be overriden, that the coins can be rewarded…
    Can you help please?



    I ttried now witht he setting of the product
    virtual ticked
    downloadable product ticked which sets the product order status to completed on clients account overview, so that client can download product.
    But not in admins view, thats probably why it doesnt help.
    But the coins isnt balanced over to the coins.
    How can this be achieved.

    Cause this then work with a plugin like WooCommerce Order Status Control cause it sets the status to completed per choice.

    I need the coins to be credited to the coins aaccount after buy…
    Please help


    You could adjust the point payout to be done when an order has been marked as Completed instead of Paid.

    You could use this code snippet for example to do just that. Simply paste the code into your theme’s functions.php file.

    Alternatively you could always go and manually pay out a point purchase on the Users page in your admin area.


    yes, great will look. I just tried everything with status. and this doesnt work…

    or functions code:

    * Auto Complete all WooCommerce orders.
    * Add to theme functions.php file
    add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order' );
    function custom_woocommerce_auto_complete_order( $order_id ) {
        global $woocommerce;
        if ( !$order_id )
        $order = new WC_Order( $order_id );
        $order->update_status( 'completed' );

    But maybe this functions code will work when I would know what a virtual product is called instead of new WC_Order( $order_id )
    u no?
    lemme try your advice

    your code snippet would be great if it works for virtual producs only…
    is this much of stuff coding needed?


    In WooCommerce, purchasing a “Virtual Product” will cause the status to change to “Processing” when an order has been paid. If the product is “Downloadable” then the order should be set to “Completed” when paid.

    Now when it comes to manual payment gateways like “Check” or “Bank Transfer” this will not work since these gateways will never mark anything as “Paid” which in turn I suspect does not trigger the plugin you are using.

    I would not use the code you pasted in as it would mark all orders as completed once a user completes the checkout process.

    An alternative would be to add a “Payout” button / link on the orders page in WooCommerce. So if an order is marked to be paid via a manual gateway, the link shows up for admins and clicking it would then trigger the payout process in myCRED for that particular order. But this option would have some requirements:

    – All products must be set to be virtual and not downloadable (unless users also need to download something with each point purchase).
    – No third-party plugins can be used that attempts to do similar tasks.


    Deactivated the plugin first:
    then ok, I added the code to the functions.php of the child theme.
    And I ordered with bank transfer and it doesnt change a status.
    no coins rewarded too.

    Yes, I could add the coins manually withou even to change anything in woo.
    But as we are selling streaming shows, the client would like to enter immideately…


    This is also a problem of the logical shopping cart flow… mmh. wondering


    The code snippet I give you does NOT change status. It changes myCRED, to instead of waiting for an order to be marked by Woo as “paid” it should wait for the order to get the status “Completed”.

    So make an order, select to pay using bank transfer for example, place the order so it shows up as pending payment, then go and edit the order and mark it as completed. The points should then be paid out (assuming you pasted the code I gave you into your theme’s functions.php file).


    ok, thx for the code.
    I just mean, when I need to go anywhere to press anything, then it is not automated on bank/ cheque … then I could also load the balance up when I reviewed the order.
    It would kindly be needed that the order causes reward of points… However, thehe virtual product only gets a status that will trigger the mycred coins to be rewarded to the buyers account automated.
    Does this work?

    I can confirm that your snippet works perfect here on my end.
    Checked the test orders and marked as completed and immediately the buyers account is charged.

    … but automisation… where can we hook it into ?


    yes, you can not automate the manual gateways, they rely on you informing them when a payment is completed. The same goes for myCRED. It relies on specific instances to occur in WooCommerce in order to know when to pay out.


    ok. lemme talk back with my partners


    Hello, Im back…
    this is mssg i get when trying to activate a custom plugin with the code referenced in your post above

    Plugin could not be activated because it triggered a fatal error.

    Fatal error: Cannot redeclare mycred_pro_adjust_woo_rewards() (previously declared in /home/evidentro/public_html/ in /home/evidentro/public_html/ myCRED Point Rewards/Adjust myCRED Point Rewards.php on line 15

    using myCred 1.6.4 I would greatly appreciate some guidance on how I can get the scripting correct

    thanks 4 a great plugin and your supporting it


    @technique. As the error message states, you have code in your theme’s functions.php file that you pasted in which conflicts with the plugin. Please remove the code in your theme’s functions.php file in order for the plugin to take over and run.

Viewing 15 posts - 1 through 15 (of 22 total)

You must be logged in to reply to this topic.

[elfsight_popup id="1"]