public function print_cart_actions() { global $post; global $user_info; $cart_receipt = new AV8_Cart_Receipt(); $cart_receipt->load_receipt($post->ID); $actions = array(); $status = $cart_receipt->status(); switch ($status) { case 'Converted': //Click to see created order form $order_id = ''; $order_id = get_post_meta($post->ID, 'av8_order_id', true); if ($order_id > 0 && $order_id != '') { $order_post = get_post($order_id); $order_link = get_admin_url('', 'post.php?post=' . $order_id . '&action=edit'); $actions[] = new AV8_Cart_Action($order_link, 'View Order'); } do_action("av8_carts_action_converted", $actions); break; case 'Open': //Make sure this isn't a guest-owned cart if (isset($cart_receipt) && $cart_receipt->full_name() != '') { $full_name = $cart_receipt->full_name(); } else { $full_name = $cart_receipt->email(); } if ($cart_receipt->email() != false && $cart_receipt->email() != '') { $email_link = "mailto:" . $cart_receipt->email(); $actions[] = new AV8_Cart_Action($email_link, "Email {$full_name}"); } do_action("av8_carts_action_open", $actions); break; case 'Abandoned': //Allow the site admin to email the cart abandoner //Make sure this isn't a guest-owned cart if ($cart_receipt->full_name() != '' && $cart_receipt->full_name() != false) { $full_name = $cart_receipt->full_name(); } else { $full_name = $cart_receipt->email(); } if ($cart_receipt->email() != false && $cart_receipt->email() != '') { $email_link = "mailto:" . $cart_receipt->email(); $actions[] = new AV8_Cart_Action($email_link, "Email {$full_name}"); } do_action("av8_carts_action_abandoned"); break; default: break; } if (empty($actions)) { echo "<span style='color:lightgray;'>" . __("No Actions Available", "woocommerce_cart_reports") . "</span>"; } else { //Print the actions foreach ($actions as $action) { echo $action->display(); } } }