function wpr_display_giftcard_on_order($order_id) { $giftPayment = wpr_get_order_card_payment($order_id); if ($giftPayment > 0) { ?> <tr> <td class="label"><?php _e('Gift Card Payment', 'rpgiftcards'); ?> :</td> <td class="giftcardTotal"> <div class="view"><?php echo wc_price($giftPayment); ?> </div> </td> </tr> <?php } }
public function wpr_giftcard_usage_data($post) { $giftcardIDs = get_post_meta($post->ID, 'wpr_existingOrders_id', true); if (!empty($giftcardIDs)) { ?> <div id="giftcard_usage" class="panel woocommerce_options_panel"> <div class="options_group"> <?php foreach ($giftcardIDs as $giftID) { $giftcardPayment = wpr_get_order_card_payment($giftID); $giftcarBalance = wpr_get_order_card_balance($giftID); //$giftcarBalance -= $giftcardPayment; $orederLink = admin_url('post.php?post=' . $giftID . '&action=edit'); ?> <div class="box-inside"> <p> <strong><?php _e('Order Number:', 'rpgiftcards'); ?> </strong> <span><a href="<?php echo $orederLink; ?> "><?php echo esc_attr($giftID); ?> </a></span> <br /> <strong><?php _e('Amount Used:', 'rpgiftcards'); ?> </strong> <span><?php echo woocommerce_price($giftcardPayment); ?> </span> <br /> <strong><?php _e('Card Balance After Order:', 'rpgiftcards'); ?> </strong> <span><?php echo woocommerce_price($giftcarBalance); ?> </span> </p> </div> <?php } ?> </div> </div> <?php } else { ?> <div id="giftcard_usage" class="panel woocommerce_options_panel"> <div class="options_group" style="text-align: center;"> <strong><?php _e('Gift card has not been used.', 'rpgiftcards'); ?> </strong> </div> </div> <?php } }