wpsc_payment_successful action hook not working in WPeCommerce 3.9.1
-
Store URL: not yet available
WordPress version: 4.1
WP eCommerce version: 3.9.1
Gold Cart version: –
Theme: custom and default themesHi,
I am trying to run some PHP code after every successful purchase using the wpsc_payment_successful action hook.I have added the following code to the functions.php file:
add_action( ‘wpsc_payment_successful’ , ‘purchase_complete’ );
I have made numerous succesful purchases but the function is never run. I have tested the PHP code and function to make sure there are no errors and it works fine when called upon by other means. So it’s the wpsc_payment_successful that is not working as it should.
I have tried disabling all plugins except WP eCommerce and changing to a different theme but it doesn’t help.
When searching on the issue I’ve found that there has been problems with this hook as far back as 2012:
If there would be some kind of workaround, alternative method or quick fix to check for succesful purchases this would be much appreciated. Using wpsc_confirm_checkout will not suffice as the payment can be pending or failed.
As further development it would be nice if I could get identify the product that was purchased by id and have the function run slightly different code depending on the product. Is there any way to get the product id from a successful purchase?
Thank you!
- The topic ‘wpsc_payment_successful action hook not working in WPeCommerce 3.9.1’ is closed to new replies.