コード例 #1
0
        } else {
            ?>
        <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
        <td valign="top">
          <p><strong><?php 
            _e('Contact Information', 'cart66');
            ?>
</strong><br/>
          <?php 
            if (!empty($order->phone)) {
                ?>
            <?php 
                _e('Phone', 'cart66');
                ?>
: <?php 
                echo Cart66Common::formatPhone($order->phone);
                ?>
<br/>
          <?php 
            }
            ?>
          <?php 
            _e('Email', 'cart66');
            ?>
: <?php 
            echo $order->email;
            ?>
<br/>
          <?php 
            _e('Date', 'cart66');
            ?>
コード例 #2
0
 public function emailShortcodes($attrs)
 {
     $output = '';
     if ($attrs['source'] == 'receipt' || $attrs['source'] == 'fulfillment' || $attrs['source'] == 'status' || $attrs['source'] == 'followup') {
         $order = new Cart66Order($attrs['id']);
         $data = array('bill_first_name', 'bill_last_name', 'bill_address', 'bill_address2', 'bill_city', 'bill_state', 'bill_country', 'bill_zip', 'ship_first_name', 'ship_last_name', 'ship_address', 'ship_address2', 'ship_city', 'ship_state', 'ship_country', 'ship_zip', 'phone', 'email', 'coupon', 'discount_amount', 'trans_id', 'shipping', 'subtotal', 'tax', 'total', 'non_subscription_total', 'custom_field', 'ordered_on', 'status', 'ip', 'products', 'fulfillment_products', 'receipt', 'receipt_link', 'ouid', 'shipping_method', 'account_id', 'tracking_number', 'feature_level', 'subscription_plan_name', 'active_until', 'billing_interval', 'username');
         if (in_array($attrs['att'], $data)) {
             switch ($attrs['att']) {
                 case 'bill_first_name':
                     // Intentional falling through
                 // Intentional falling through
                 case 'bill_last_name':
                 case 'ship_first_name':
                 case 'ship_last_name':
                     $output = ucfirst(strtolower($order->{$attrs}['att']));
                     break;
                 case 'bill_address':
                     if ($order->bill_address2 != '') {
                         $output = $order->{$attrs}['att'] . '<br />' . $order->bill_address2;
                     } else {
                         $output = $order->{$attrs}['att'];
                     }
                     break;
                 case 'ship_address':
                     if ($order->ship_address2 != '') {
                         $output = $order->{$attrs}['att'] . '<br />' . $order->ship_address2;
                     } else {
                         $output = $order->{$attrs}['att'];
                     }
                     break;
                 case 'products':
                     $output = Cart66Common::getView('/pro/views/emails/email-products.php', array('order' => $order, 'type' => $attrs['type'], 'code' => 'products'));
                     break;
                 case 'fulfillment_products':
                     $output = Cart66Common::getView('/pro/views/emails/email-products.php', array('order' => $order, 'type' => $attrs['type'], 'code' => 'fulfillment_products', 'variable' => $attrs['variable']));
                     break;
                 case 'receipt':
                     $output = Cart66Common::getView('/pro/views/emails/email-receipt.php', array('order' => $order, 'type' => $attrs['type']));
                     break;
                 case 'phone':
                     $output = Cart66Common::formatPhone($order->{$attrs}['att']);
                     break;
                 case 'total':
                     $output = Cart66Common::currency($order->{$attrs}['att'], false);
                     break;
                 case 'tax':
                     $output = Cart66Common::currency($order->{$attrs}['att'], false);
                     break;
                 case 'receipt_link':
                     $receiptPage = get_page_by_path('store/receipt');
                     $link = get_permalink($receiptPage->ID);
                     if (strstr($link, "?")) {
                         $link .= '&ouid=';
                     } else {
                         $link .= '?ouid=';
                     }
                     $output = $link . $order->ouid;
                     break;
                 case 'feature_level':
                     // Intentionally falling through
                 // Intentionally falling through
                 case 'active_until':
                 case 'subscription_plan_name':
                 case 'active_until':
                 case 'active_until':
                 case 'billing_interval':
                     if ($order->account_id) {
                         $sub = new Cart66AccountSubscription($order->account_id);
                         $output = $sub->{$attrs}['att'];
                     } else {
                         $output = "None";
                     }
                     break;
                 case 'username':
                     if ($order->account_id) {
                         $sub = new Cart66AccountSubscription($order->account_id);
                         $account = new Cart66Account();
                         $account->load($sub->account_id);
                         //Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Loaded account: " . print_r($account, true) );
                         $output = $account->{$attrs}['att'];
                     } else {
                         $output = "None";
                     }
                     break;
                 default:
                     $output = $order->{$attrs}['att'];
             }
         } elseif (substr($attrs['att'], 0, 8) == 'tracking') {
             $output = Cart66AdvancedNotifications::updateTracking($order, $attrs);
         } elseif (substr($attrs['att'], 0, 5) == 'date:') {
             $output = Cart66AdvancedNotifications::updateDate($attrs);
         } elseif (substr($attrs['att'], 0, 12) == 'date_ordered') {
             $output = Cart66AdvancedNotifications::updateDateOrdered($order, $attrs);
         }
         $shipping_options = array('ship_first_name', 'ship_last_name', 'ship_address', 'ship_address2', 'ship_city', 'ship_state', 'ship_country', 'ship_zip');
         if (in_array($attrs['att'], $shipping_options) && $order->shipping_method == 'None') {
             $output = '';
         }
     } elseif ($attrs['source'] == 'reminder') {
         $sub = new Cart66AccountSubscription($attrs['id']);
         $account = new Cart66Account();
         $account->load($sub->account_id);
         $data = array('billing_first_name', 'billing_last_name', 'feature_level', 'subscription_plan_name', 'active_until', 'billing_interval', 'username', 'opt_out_link');
         if (in_array($attrs['att'], $data)) {
             switch ($attrs['att']) {
                 case 'billing_first_name':
                     // Intentional falling through
                 // Intentional falling through
                 case 'billing_last_name':
                     $output = ucfirst(strtolower($sub->{$attrs}['att']));
                     break;
                 case 'active_until':
                     $output = date(get_option('date_format'), strtotime($sub->{$attrs}['att']));
                     break;
                 case 'username':
                     $output = $account->{$attrs}['att'];
                     break;
                 case 'opt_out_link':
                     $output = Cart66ProCommon::generateUnsubscribeLink($account->id);
                     break;
                 default:
                     $output = $sub->{$attrs}['att'];
             }
         }
     }
     Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] output: {$output}");
     return $output;
 }
コード例 #3
0
 public function defaultPlainEmailMessage($order)
 {
     $msg = __("ORDER NUMBER", "cart66") . ": " . $order->trans_id . "\n\n";
     $hasDigital = false;
     $product = new Cart66Product();
     foreach ($order->getItems() as $item) {
         $product->load($item->product_id);
         if ($hasDigital == false) {
             $hasDigital = $product->isDigital();
         }
         $price = $item->product_price * $item->quantity;
         // $msg .= "Item: " . $item->item_number . ' ' . $item->description . "\n";
         $msg .= __("Item", "cart66") . ": " . $item->description . "\n";
         if ($hasDigital) {
             $receiptPage = get_page_by_path('store/receipt');
             $receiptPageLink = get_permalink($receiptPage);
             $receiptPageLink .= strstr($receiptPageLink, '?') ? '&duid=' . $item->duid : '?duid=' . $item->duid;
             $msg .= "\n" . $receiptPageLink . "\n";
         }
         if ($item->quantity > 1) {
             $msg .= __("Quantity", "cart66") . ": " . $item->quantity . "\n";
         }
         $msg .= __("Item Price", "cart66") . ": " . Cart66Common::currency($item->product_price, false) . "\n";
         $msg .= __("Item Total", "cart66") . ": " . Cart66Common::currency($item->product_price * $item->quantity, false) . "\n\n";
         if ($product->isGravityProduct()) {
             $msg .= Cart66GravityReader::displayGravityForm($item->form_entry_ids, true);
         }
     }
     if ($order->shipping_method != 'None' && $order->shipping_method != 'Download') {
         $msg .= __("Shipping", "cart66") . ": " . Cart66Common::currency($order->shipping, false) . "\n";
     }
     if (!empty($order->coupon) && $order->coupon != 'none') {
         $msg .= __("Coupon", "cart66") . ": " . $order->coupon . "\n";
     }
     if ($order->tax > 0) {
         $msg .= __("Tax", "cart66") . ": " . Cart66Common::currency($order->tax, false) . "\n";
     }
     $msg .= "\n" . __("TOTAL", "cart66") . ": " . Cart66Common::currency($order->total, false) . "\n";
     if ($order->shipping_method != 'None' && $order->shipping_method != 'Download') {
         $msg .= "\n\n" . __("SHIPPING INFORMATION", "cart66") . "\n\n";
         $msg .= $order->ship_first_name . ' ' . $order->ship_last_name . "\n";
         $msg .= $order->ship_address . "\n";
         if (!empty($order->ship_address2)) {
             $msg .= $order->ship_address2 . "\n";
         }
         $msg .= $order->ship_city . ' ' . $order->ship_state . ' ' . $order->ship_zip . "\n" . $order->ship_country . "\n";
         if (is_array($additional_fields = maybe_unserialize($order->additional_fields)) && isset($additional_fields['shipping'])) {
             foreach ($additional_fields['shipping'] as $af) {
                 $msg .= html_entity_decode($af['label']) . ': ' . $af['value'] . "\n";
             }
         }
         $msg .= "\n" . __("Delivery via", "cart66") . ": " . $order->shipping_method . "\n";
     }
     $msg .= "\n\n" . __("BILLING INFORMATION", "cart66") . "\n\n";
     $msg .= $order->bill_first_name . ' ' . $order->bill_last_name . "\n";
     $msg .= $order->bill_address . "\n";
     if (!empty($order->bill_address2)) {
         $msg .= $order->bill_address2 . "\n";
     }
     $msg .= $order->bill_city . ' ' . $order->bill_state;
     $msg .= $order->bill_zip != null ? ', ' : ' ';
     $msg .= $order->bill_zip . "\n" . $order->bill_country . "\n";
     if (is_array($additional_fields = maybe_unserialize($order->additional_fields)) && isset($additional_fields['billing'])) {
         foreach ($additional_fields['billing'] as $af) {
             $msg .= html_entity_decode($af['label']) . ': ' . $af['value'] . "\n";
         }
     }
     if (!empty($order->phone)) {
         $phone = Cart66Common::formatPhone($order->phone);
         $msg .= "\n" . __("Phone", "cart66") . ": {$phone}\n";
     }
     if (!empty($order->email)) {
         $msg .= __("Email", "cart66") . ': ' . $order->email . "\n";
     }
     if (is_array($additional_fields = maybe_unserialize($order->additional_fields)) && isset($additional_fields['payment'])) {
         foreach ($additional_fields['payment'] as $af) {
             $msg .= html_entity_decode($af['label']) . ': ' . $af['value'] . "\n";
         }
     }
     if (isset($order->custom_field) && $order->custom_field != '') {
         if (Cart66Setting::getValue('checkout_custom_field_label')) {
             $msg .= "\n" . Cart66Setting::getValue('checkout_custom_field_label');
         } else {
             $msg .= "\n" . __('Enter any special instructions you have for this order:', 'cart66');
         }
         $msg .= "\n" . $order->custom_field . "\n";
     }
     $receiptPage = get_page_by_path('store/receipt');
     $link = get_permalink($receiptPage->ID);
     if (strstr($link, "?")) {
         $link .= '&ouid=' . $order->ouid;
     } else {
         $link .= '?ouid=' . $order->ouid;
     }
     if ($hasDigital) {
         $msg .= "\n" . __('DOWNLOAD LINK', 'cart66') . "\n" . __('Click the link below to download your order.', 'cart66') . "\n{$link}";
     } else {
         $msg .= "\n" . __('VIEW RECEIPT ONLINE', 'cart66') . "\n" . __('Click the link below to view your receipt online.', 'cart66') . "\n{$link}";
     }
     $msgIntro = Cart66Setting::getValue('receipt_intro') && !Cart66Setting::getValue('enable_advanced_notifications') ? Cart66Setting::getValue('receipt_intro') : '';
     $msgIntro .= Cart66Setting::getValue('receipt_message_intro') && Cart66Setting::getValue('enable_advanced_notifications') ? Cart66Setting::getValue('receipt_plain_email') : '';
     $msg = $msgIntro . " \n----------------------------------\n\n" . $msg;
     return $msg;
 }