WordPress.org

Ready to get started?Download WordPress

Forums

myCRED
[resolved] [closed] Award myCRED Points for WooCommerce Products (7 posts)

  1. rocko1903
    Member
    Posted 6 months ago #

    Hello,

    First I would like to congratulate you for the plugin.

    My problem:

    I used this code (http://pastebin.com/05eDsibH), and the functions.php file I created rules in the custom fields of the product, but the credits are not rewarded for my users after approval of the purchase.

    Custom Fields:

    name: mycred
    value: 10

    What could be the problem?

    Thank you!

    https://wordpress.org/plugins/mycred/

  2. Gabriel
    Member
    Plugin Author

    Posted 6 months ago #

    Hey.

    For the code to fire, an order must gain the status "Completed". Pending or any other status will not award points.

    If that is the case, and you have a custom field for the product a user buys and it is not zero, then the script should award points.

    A few things to check:

    1. The code has been pasted into your themes functions.php file.

    2. The order is marked completed.

    If all is well, then your next step should be to enable WP_DEBUG and see if you get any error messages that are related to the script. Since you know which file you pasted the code in and on what row, any error messages that reference to this file or rows would highlight any errors. (note that WP_DEBUG will show ALL errors not just myCRED related).

    If there are no errors, I would make a test purchase in the store (while WP_DEBUG is enabled) and see if an error shows up during the payment process. Maybe WooCommerce does not fire the necessary action because of an other error. Once you have done testing you can disable WP_DEBUG again.

    The code has been tested upto WP 3.8.1, Woo 2.0.20, myCRED 1.3.3.2

  3. rocko1903
    Member
    Posted 6 months ago #

    Good News!

    It's working perfectly now, I had to make a small change:

    I changed this hook: woocommerce_payment_complete

    For this: woocommerce_order_status_completed

    Thanks for your great support!

  4. Gabriel
    Member
    Plugin Author

    Posted 6 months ago #

    Ah yes, that sounds correct.

  5. jamesialford
    Member
    Posted 2 months ago #

    I have tried what you have above and I get this. DEBUG turned on. I can buy the product. I have the customs field. Can you help out?

    Notice: wp_register_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /home4/jamesial/public_html/futurenfitness/wp-includes/functions.php on line 3245

    Notice: wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /home4/jamesial/public_html/futurenfitness/wp-includes/functions.php on line 3245

    Strict Standards: Redefining already defined constructor for class wp_uc_widget in /home4/jamesial/public_html/futurenfitness/wp-content/plugins/wp-user-control/wp_uc_widget.php on line 113

    Strict Standards: Redefining already defined constructor for class wp_PluginException in /home4/jamesial/public_html/futurenfitness/wp-content/plugins/wp-user-control/inc/Exception.php on line 58

    Strict Standards: Redefining already defined constructor for class wp_PluginUtilities in /home4/jamesial/public_html/futurenfitness/wp-content/plugins/wp-user-control/inc/Utilities.php on line 58

    Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method WP_FullCalendar::init() should not be called statically in /home4/jamesial/public_html/futurenfitness/wp-includes/plugin.php on line 470

    Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method WP_FullCalendar::enqueue_scripts() should not be called statically in /home4/jamesial/public_html/futurenfitness/wp-includes/plugin.php on line 470

    Strict Standards: Non-static method WP_FullCalendar::localize_script() should not be called statically in /home4/jamesial/public_html/futurenfitness/wp-content/plugins/wp-fullcalendar/wp-fullcalendar.php on line 64

  6. jamesialford
    Member
    Posted 2 months ago #

    I figured out the errors are not related to this.

    The points are still not being assigned to the user after payment is complete.

    Anyone have a though what I can do?

  7. esmi
    Forum Moderator
    Posted 2 months ago #

    If you require assistance then, as per the Forum Welcome, please post your own topic instead of tagging onto someone else's topic.

    I am now closing this 4 month old resolved topic as it references an older version of WordPress.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.