Do After New Purchase
After a customer has:
- purchased a video
- rented a video
- or purchased access to a series / season
you can optionally run your own function to update the users meta data and more.
Add the following to either your themes functions.php file or within your plugin files:
add_action( 'wpvs_do_after_new_product_purchase', 'wpvs_my_custom_after_purchase_function', 10, 3 ); function wpvs_my_custom_after_purchase_function($user_id, $product_id, $purchase_type) { // YOUR CUSTOM CODE HERE }
Parameters
- user_id: The ID of the user who purchased the video
- product_id:
- The Video (POST) ID when purchase_type is purchase or rental
- The Term ID (Series / Season) when purchase_type is termpurchase
- purchase_type: Type of purchase (purchase, rental or termpurchase)