Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author myCred

    (@designbymerovingi)

    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

    Thread Starter rocko1903

    (@rocko1903)

    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!

    Plugin Author myCred

    (@designbymerovingi)

    Ah yes, that sounds correct.

    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

    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?

    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.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Award myCRED Points for WooCommerce Products’ is closed to new replies.