Main Menu
Sub Menu

wpdm_after_checkout – executes after a customer completes checkout

Description


This hook is triggered after payment successfully completed for an order. You may use the hook to send custom instructions for the purchased products to your customer or send a custom order notification email to any email addresses.

Parameters


A registered action function is passed the following parameters.

$order_id
The ID of the order just completed

Usage

<?php add_action("wpdm_after_checkout", "your_function"); ?>

Examples

add_action("wpdm_after_checkout", "wpdm_send_instructions");
function wpdm_send_instructions($order_id){
    $items = Order::getOrderItems($order_id);    
    $customer = Order::customerInfo($order_id);
    foreach($items as $item){
        $product_id = $item['pid'];
        $params = array(
           'to_email' => $customer['email'],
           'subject' => 'Custom Setup Instructions',
           'message' => 'Your Email Message for Product #'.$product_id,
           );
        \WPDM\Email::send("default", $params); 
    }
}

 

Last updated on Jan 29, 2021

Need More Clarification?

For any technical issue, if you are already using pro version please post in pro forum and free version users please post in free forum. Otherwise, if you have any pre-sale or order related query please contact live chat support team. For technical support.

Need Customization?

If you need additional customization on WordPress Download Manager or any type of custom support on WordPress you may contact our customization service.