public function getMaxOrderDescription() { // CHANGE AND COMBINE WITH ABOVE $max = $this->maxOrder; if ($max > 0) { $max = Cart66Common::currency($max); } else { $max = __('Apply to All Orders', 'cart66'); } return $max; }
public function getTrialPriceDescription() { $description = 'No trial'; if ($this->offerTrial > 0) { $description = Cart66Common::currency($this->trialPrice) . ' / '; if ($this->trialPeriod > 1) { $description .= $this->trialPeriod . ' '; } $description .= $this->getTrialPeriodUnit(); } return $description; }
public function getPriceDescription() { $product = new Cart66Product(); $spreedlyProduct = $product->getOne("where spreedly_subscription_id = {$this->id}"); if (!empty($spreedlyProduct->priceDescription)) { $out = $spreedlyProduct->priceDescription; } else { $price = $this->price; $out = Cart66Common::currency($price) . ' / ' . $this->terms; if ($this->hasFreeTrial()) { $duration = $this->chargeLaterDurationQuantity . ' ' . $this->chargeLaterDurationUnits; $out .= " <span class='Cart66FreePeriod'>(first {$duration} free)</span>"; } } return $out; }
} $price = $item->product_price * $item->quantity; // echo "Item: " . $item->item_number . ' ' . $item->description . "\n"; echo __("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; echo "\n" . $receiptPageLink . "\n"; } if ($item->quantity > 1) { echo __("Quantity", "cart66") . ": " . $item->quantity . "\n"; } echo __("Item Price", "cart66") . ": " . Cart66Common::currency($item->product_price) . "\n"; echo __("Item Total", "cart66") . ": " . Cart66Common::currency($item->product_price * $item->quantity) . "\n\n"; if ($product->isGravityProduct()) { echo Cart66GravityReader::displayGravityForm($item->form_entry_ids, true); } } if ($order->shipping_method != 'None' && $order->shipping_method != 'Download') { echo __("Shipping", "cart66") . ": " . Cart66Common::currency($order->shipping) . "\n"; } if (!empty($order->coupon) && $order->coupon != 'none') { echo __("Coupon", "cart66") . ": " . $order->coupon . "\n"; } if ($order->tax > 0) { echo __("Tax", "cart66") . ": " . Cart66Common::currency($order->tax, false) . "\n"; } echo "\n" . __("TOTAL", "cart66") . ": " . Cart66Common::currency($order->total, false) . "\n"; } }
</span> <p id="what_is_initial_payment_answer" class="label_desc" style="max-width: 400px; display: none;">F<?php _e('or example, this may be a setup fee. This one time fee will be charged at checkout regardless of when you decide to start collecting the recurring payments.', 'cart66'); ?> </p> </li> <li> <label class="med" for="subscription-price"><?php _e('Recurring Price', 'cart66'); ?> :</label> <?php echo Cart66Common::currencySymbol('before'); ?> <input class="med" style="width: 5em;" type="text" name="subscription[price]" id="subscription-price" value="<?php echo $data['subscription']->id > 0 ? Cart66Common::currency($data['subscription']->price, true, false, false) : ''; ?> " /> <?php echo Cart66Common::currencySymbol('after'); ?> </li> <li> <label class="med" for="subscription-billing_interval"><?php _e('Bill every', 'cart66'); ?> :</label> <input style="width: 50px;" type="text" name="subscription[billing_interval]" id="subscription-billing_interval" value="<?php echo $data['subscription']->billingInterval; ?> " />
public static function paypalSubscriptionsTable() { $columns = array('id', 'item_number', 'name', 'feature_level', 'setup_fee', 'price', 'billing_cycles', 'offer_trial', 'start_recurring_number', 'start_recurring_unit'); $indexColumn = "id"; $tableName = Cart66Common::getTableName('products'); $where = self::dataTablesWhere($columns); $limit = self::dataTablesLimit() == '' ? null : self::dataTablesLimit(); $order = self::dataTablesOrder($columns); if ($where == null) { $where = "WHERE is_paypal_subscription>0"; } else { $where .= " AND is_paypal_subscription>0"; } $iTotal = self::totalRows($indexColumn, $tableName, $where); $iFilteredTotal = self::filteredRows($indexColumn, $tableName, $where); $data = array(); $subscription = new Cart66PayPalSubscription(); $subscriptions = $subscription->getModels($where, $order, $limit); foreach ($subscriptions as $s) { $gfTitles = self::gfData(); if ($s->gravityFormId > 0 && isset($gfTitles) && isset($gfTitles[$s->gravityFormId])) { $gfTitles = '<br/><em>Linked To Gravity Form: ' . $gfTitles[$s->gravityFormId] . '</em>'; } else { $gfTitles = ''; } $data[] = array($s->id, $s->item_number, $s->name . $gfTitles, $s->featureLevel, Cart66Common::currency($s->setupFee), $s->getPriceDescription(false), $s->getBillingCycleDescription(), $s->getTrialPriceDescription(), $s->getStartRecurringDescription()); } Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] " . json_encode($data)); $array = array('sEcho' => $_GET['sEcho'], 'iTotalRecords' => $iTotal[0], 'iTotalDisplayRecords' => $iFilteredTotal[0], 'aaData' => $data); echo json_encode($array); die; }
?> <?php $method = new Cart66ShippingMethod(); $method->load($rule->shipping_method_id); ?> <tr> <td><?php echo Cart66Common::currency($rule->min_amount); ?> </td> <td><?php echo $method->name ? $method->name : "<span style='color:red;'>Please select a method</span>"; ?> </td> <td><?php echo Cart66Common::currency($rule->shipping_cost); ?> </td> <td> <a href='?page=cart66-shipping&task=edit&id=<?php echo $rule->id; ?> '><?php _e('Edit', 'cart66'); ?> </a> | <a class='delete' href='?page=cart66-shipping&task=delete&id=<?php echo $rule->id; ?> '><?php _e('Delete', 'cart66');
</div> </body> </html> <?php } else { $msg = __("This is a test email receipt with test information. Please create a template in your settings to get it to look exactly the way you want.", "cart66") . "\n\n"; $msg .= __("ORDER NUMBER", "cart66") . ": TEST-TRANSACTION-ID\n\n"; $msg .= __("Order Status") . ": " . str_replace('_', ' ', strtoupper($status)) . "\n\n"; $msg .= __("Item", "cart66") . ": Test Product Name\n"; $msg .= __("Quantity", "cart66") . ": 3\n"; $msg .= __("Item Price", "cart66") . ": " . Cart66Common::currency(15.0, false) . "\n"; $msg .= __("Item Total", "cart66") . ": " . Cart66Common::currency(45.0, false) . "\n\n"; $msg .= __("Shipping", "cart66") . ": " . Cart66Common::currency(5.0, false) . "\n"; $msg .= __("Coupon", "cart66") . ": TEST-COUPON -(" . Cart66Common::currency(15.0, false) . ")\n"; $msg .= __("Tax", "cart66") . ": " . Cart66Common::currency(1.87, false) . "\n"; $msg .= "\n" . __("TOTAL", "cart66") . ": " . Cart66Common::currency(36.87, false) . "\n"; $msg .= "\n\n" . __("SHIPPING INFORMATION", "cart66") . "\n\n"; $msg .= "FirstName LastName\n"; $msg .= "1234 My Address\n"; $msg .= "Apt. 1\n"; $msg .= "My City, ST 00000\nUnited States\n"; $msg .= "\n" . __("Delivery via", "cart66") . ": UPS Ground\n"; $msg .= "\n\n" . __("BILLING INFORMATION", "cart66") . "\n\n"; $msg .= "FirstName LastName\n"; $msg .= "1234 My Address\n"; $msg .= "Apt. 1\n"; $msg .= "My City, ST 00000\nUnited States\n"; $msg .= "\n" . __("Phone", "cart66") . ": (000) 000-0000\n"; $msg .= __("Email", "cart66") . ": testemail@aol.com\n"; $msg .= "\n" . __('DOWNLOAD LINK', 'cart66') . "\n" . __('Click the link below to download your order.', 'cart66') . "\nhttp://yoursite.com/store/receipt/?ouid=randomstring\n"; $msg .= "\n" . __('VIEW RECEIPT ONLINE', 'cart66') . "\n" . __('Click the link below to view your receipt online.', 'cart66') . "\nhttp://yoursite.com/store/receipt/?ouid=randomstring\n";
<p style="border: 1px solid #CCC; background-color: #eee; padding: 5px; width: 590px; -moz-border-radius: 5px; -webkit-border-radius: 5px;"> <strong><?php _e('Current Tweak Factor', 'cart66'); ?> :</strong> <?php if (Cart66Setting::getValue('rate_tweak_factor')) { $type = Cart66Setting::getValue('rate_tweak_type'); $factor = Cart66Setting::getValue('rate_tweak_factor'); if ($type == 'percentage') { $direction = $factor > 0 ? 'increased' : 'decreased'; echo "All rates will be {$direction} by " . abs($factor) . '%'; } else { $direction = $factor > 0 ? 'added to' : 'subtracted from'; echo Cart66Common::currency(abs($factor)) . " will be {$direction} all rates"; } } else { echo 'The calculated rates will not be tweaked.'; } ?> </p> <form action="" method="post"> <input type="hidden" name="cart66-action" value="save rate tweak" /> <select name="rate_tweak_type" id="rate_tweak_type"> <option value="percentage"><?php _e('Tweak by percentage', 'cart66'); ?> </option> <option value="fixed"><?php
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; }
?> <?php } ?> <?php if ($tax > 0) { ?> <tr class="tax"> <td colspan="2"><?php _e('Tax', 'cart66'); ?> <span class="Cart66MetaSep">:</span> <span class="Cart66TaxCost"><?php echo Cart66Common::currency($tax); ?> </span></td> </tr> <?php } ?> </table> </form> <div class="Cart66WidgetViewCartCheckoutItems"> <a class="Cart66WidgetViewCart" href='<?php echo get_permalink($data['cartPage']->ID); ?> '><?php
public static function cart66_statistics_widget() { function totalFromRange($start, $end) { global $wpdb; $tableName = Cart66Common::getTableName('orders'); $sql = "SELECT sum(total) as total from {$tableName} where ordered_on > '{$start}' AND ordered_on < '{$end}'"; $result = $wpdb->get_row($sql, ARRAY_A); $output = $result ? (double) $result['total'] : "N/A"; return $output; } // TODAY $yday = date('Y-m-d 00:00:00', strtotime('yesterday')); $dayStart = date('Y-m-d 00:00:00', strtotime('today')); $dayEnd = date('Y-m-d 00:00:00', strtotime('tomorrow')); $mdayStart = date('Y-m-01 00:00:00', strtotime('today')); $mdayEnd = date('Y-m-01 00:00:00', strtotime('next month')); $today_total = totalFromRange($dayStart, $dayEnd); $yesterday_total = totalFromRange($yday, $dayStart); $month_total = totalFromRange($mdayStart, $mdayEnd); $total_product_sales = Cart66DataTables::productsSearch(); $total_sales_amount = Cart66DataTables::totalSalesForMonth($total_product_sales); $daily_avg = ($month_total - $today_total) / date('j', strtotime('yesterday')); //number_format($month_total/date("j"),2); $total_days = date('t', strtotime('now')); $est_month = $total_days * $daily_avg; ?> <div class="cart66Tabbed"> <ul class="tabs"> <li class="t1"><a class="t1 tab" href="javascript:void(0)"><?php _e('Summary', 'cart66'); ?> </a></li> <li class="t2"><a class="t2 tab" href="javascript:void(0)"><?php _e('Today/Yesterday', 'cart66'); ?> </a></li> <li class="t3"><a class="t3 tab" href="javascript:void(0)"><?php echo date("F, Y", strtotime("now")); ?> </a></li> <li class="t4"><a class="t4 tab" href="javascript:void(0)"><?php _e('Daily Average', 'cart66'); ?> </a></li> <li class="t5"><a class="t5 tab" href="javascript:void(0)"><?php _e('Estimate', 'cart66'); ?> </a></li> </ul> <div class="loading"> <h2 class="center"><?php _e('loading...', 'cart66'); ?> </h2> </div> <div class="t1 pane"> <table id="statSummary" cellspacing="0" cellpadding="0"> <tfoot> <tr> <td> <?php _e('Last Updated', 'cart66'); ?> : </td> <td class="right"> <?php echo date(get_option('date_format'), Cart66Common::localTs()); ?> <?php echo date(get_option('time_format'), Cart66Common::localTs()); ?> </td> </tr> </tfoot> <tbody> <tr class="t4 tab summaryDetails"> <td> <?php echo date('F'); _e(' Daily Average', 'cart66'); ?> : </td> <td class="right"> <a class="t4 tab" href="javascript:void(0)"><?php echo Cart66Common::currency($daily_avg); ?> </a> </td> </tr> <tr class="t2 tab summaryDetails"> <td> <?php _e('Today\'s Total', 'cart66'); ?> : </td> <td class="right"> <a class="t2 tab" href="javascript:void(0)"><?php echo Cart66Common::currency($today_total); ?> </a> </td> </tr> <tr class="t2 tab summaryDetails"> <td> <?php _e('Yesterday\'s Total', 'cart66'); ?> : </td> <td class="right"> <a class="t2 tab" href="javascript:void(0)"><?php echo Cart66Common::currency($yesterday_total); ?> </a> </td> </tr> <tr class="t3 tab summaryDetails"> <td> <?php echo date("F", strtotime("now")); ?> <?php _e('Total', 'cart66'); ?> : </td> <td class="right"> <a class="t3 tab" href="javascript:void(0)"><?php echo Cart66Common::currency($month_total); ?> </a> </td> </tr> <tr class="t5 tab summaryDetails"> <td> <?php _e('Estimated', 'cart66'); ?> <?php echo date("F", strtotime('now')); ?> <?php _e('Total', 'cart66'); ?> : </td> <td class="right"> <a class="t5 tab" href="javascript:void(0)"><?php echo Cart66Common::currency($est_month); ?> </a> </td> </tr> </tbody> </table> </div> <div class="t2 pane"> <table id="dayStats" cellpadding="0" cellspacing="0"> <tr class="summaryDetails dayStats"> <td> <?php _e('Today\'s Total', 'cart66'); ?> : <strong><?php echo Cart66Common::currency($today_total); ?> </strong> </td> <td class="right"> <?php _e('Yesterday\'s Total', 'cart66'); ?> : <strong><?php echo Cart66Common::currency($yesterday_total); ?> </strong> </td> </tr> <tr> <td class="wideOrders" colspan="2"> <table width="100%" id="todaysOrders" cellpadding="0" cellspacing="0"> <thead> <tr> <th colspan="2" class="left"><?php _e('Today\'s Order Details', 'cart66'); ?> </th> <th class="right"><?php _e('Order Total', 'cart66'); ?> </th> </tr> </thead> <?php $Orders = new Cart66Order(); $todaysOrders = $Orders->getOrderRows(" WHERE ordered_on > '{$dayStart}' AND ordered_on < '{$dayEnd}' AND id>0", "order by ordered_on DESC"); if ($todaysOrders) { $i = 1; ?> <tbody> <?php foreach ($todaysOrders as $order) { ?> <tr> <td class="rowNumber"> <h2><?php echo $i; ?> </h2> </td> <td class="orderInformation"> <p><?php echo $order->bill_first_name . " " . $order->bill_last_name; ?> <br> <span class='orderDate'><?php echo Cart66Common::getElapsedTime($order->ordered_on); ?> </span> </p> </td> <td class='right'> <?php echo Cart66Common::currency($order->total); ?> </td> <?php $i++; ?> </tr> <?php } ?> </tbody> <?php } else { ?> <tfoot> <tr> <td colspan='3'> <h2 class="noOrders"><?php _e('No orders yet today', 'cart66'); ?> </h2> </td> </tr> </tfoot> <?php } ?> </table> </td> </tr> </table> </div> <div class="t3 pane"> <table id="productTable" cellpadding="0" cellspacing="0"> <tr> <thead> <tr> <th class="left"><?php _e('Product Name', 'cart66'); ?> </th> <th class="center"><?php _e('Sales', 'cart66'); ?> </th> <th class="right"><?php _e('Income', 'cart66'); ?> </th> </tr> </thead> <tfoot> <tr> <th class="left"><strong><?php echo date("F, Y", strtotime('now')); ?> </strong></th> <?php if (isset($total_sales_amount['total_sales'])) { $totalSales = $total_sales_amount['total_sales']['total_quantity']; $totalAmount = $total_sales_amount['total_sales']['total_amount']; } else { $totalSales = '0'; $totalAmount = '0'; } ?> <th class="center"><strong><?php echo $totalSales; ?> </strong></th> <th class="right"><strong><?php echo Cart66Common::currency($totalAmount); ?> </strong></th> </tr> </tfoot> </tr> </table> </div> <div class="t4 pane"> <div> <table id="dailyAverage" cellpadding="0" cellspacing="0"> <?php $column = 0; for ($i = 6; $i > 0; $i--) { $tmonth_start = date('Y-m-01 00:00:00', strtotime("{$i} months ago")); $tmonth_end = date('Y-m-01 00:00:00', strtotime($i - 1 . " months ago")); $tmonth_total = totalFromRange($tmonth_start, $tmonth_end); $tmonth_days = date('t', strtotime("{$i} months ago")); ?> <?php if ($tmonth_total != "") { ?> <thead> <tr> <th class="left" colspan="2"> <?php echo date('F, Y', strtotime("{$i} months ago")); ?> </th> </tr> </thead> <tbody> <tr> <td><?php _e('Total Income', 'cart66'); ?> :</td> <td class="right"><strong><?php echo Cart66Common::currency($tmonth_total); ?> </strong></td> </tr> <tr> <td><?php _e('Daily Average', 'cart66'); ?> :</td> <td class="right"><strong><?php echo Cart66Common::currency($tmonth_total / $tmonth_days); ?> </strong></td> </tr> </tbody> <?php } } $ystart = date("Y-01-01 00:00:00"); $yend = date("Y-01-01 00:00:00", strtotime("next year")); $year_total = totalFromRange($ystart, $yend); $day_of_year = date('z'); ?> <thead> <tr> <th class="left" colspan="2">YTD - <?php echo date('Y'); ?> </th> </tr> </thead> <tbody> <tr> <td><?php _e('Total Income', 'cart66'); ?> :</td> <td class="right"><strong><?php echo Cart66Common::currency($year_total); ?> </strong></td> </tr> <tr> <td><?php _e('Daily Average', 'cart66'); ?> :</td> <td class="right"><strong><?php echo Cart66Common::currency($year_total / $day_of_year); ?> </strong></td> </tr> </tbody> </table> </div> </div> <div class="t5 pane"> <table id="estimatedSummary" cellspacing="0" cellpadding="0"> <tbody> <tr> <td> <?php _e('Today', 'cart66'); ?> : </td> <td class="right"> <?php echo date(get_option('date_format'), strtotime('now')); ?> </td> </tr> <tr> <td> <?php _e('Total Days in', 'cart66'); ?> <?php echo date("F", strtotime('now')); ?> : </td> <td class="right"> <?php echo $total_days; ?> </td> </tr> <tr> <td> <?php _e('Remaining Days in', 'cart66'); ?> <?php echo date("F", strtotime('now')); ?> : </td> <td class="right"> <?php echo $total_days - date('j', strtotime('now')); ?> </td> </tr> <tr> <td> <?php _e('Estimated Remaining Income', 'cart66'); ?> : </td> <td class="right"> <?php echo Cart66Common::currency(($total_days - date('j', strtotime('now'))) * $daily_avg); ?> </td> </tr> </tbody> </table> </div> </div> <script type="text/javascript"> (function($){ $(document).ready(function(){ /* API method to get paging information */ $.fn.dataTableExt.oApi.fnPagingInfo = function ( oSettings ) { return { "iStart": oSettings._iDisplayStart, "iEnd": oSettings.fnDisplayEnd(), "iLength": oSettings._iDisplayLength, "iTotal": oSettings.fnRecordsTotal(), "iFilteredTotal": oSettings.fnRecordsDisplay(), "iPage": Math.ceil( oSettings._iDisplayStart / oSettings._iDisplayLength ), "iTotalPages": Math.ceil( oSettings.fnRecordsDisplay() / oSettings._iDisplayLength ) }; } /* Bootstrap style pagination control */ $.extend( $.fn.dataTableExt.oPagination, { "bootstrap": { "fnInit": function( oSettings, nPaging, fnDraw ) { var oLang = oSettings.oLanguage.oPaginate; var fnClickHandler = function ( e ) { e.preventDefault(); if ( oSettings.oApi._fnPageChange(oSettings, e.data.action) ) { fnDraw( oSettings ); } }; $(nPaging).addClass('pagination').append( '<ul>'+ '<li class="prev disabled"><a href="#">← '+oLang.sPrevious+'</a></li>'+ '<li class="next disabled"><a href="#">'+oLang.sNext+' → </a></li>'+ '</ul>' ); var els = $('a', nPaging); $(els[0]).bind( 'click.DT', { action: "previous" }, fnClickHandler ); $(els[1]).bind( 'click.DT', { action: "next" }, fnClickHandler ); }, "fnUpdate": function ( oSettings, fnDraw ) { var iListLength = 5; var oPaging = oSettings.oInstance.fnPagingInfo(); var an = oSettings.aanFeatures.p; var i, j, sClass, iStart, iEnd, iHalf=Math.floor(iListLength/2); if ( oPaging.iTotalPages < iListLength) { iStart = 1; iEnd = oPaging.iTotalPages; } else if ( oPaging.iPage <= iHalf ) { iStart = 1; iEnd = iListLength; } else if ( oPaging.iPage >= (oPaging.iTotalPages-iHalf) ) { iStart = oPaging.iTotalPages - iListLength + 1; iEnd = oPaging.iTotalPages; } else { iStart = oPaging.iPage - iHalf + 1; iEnd = iStart + iListLength - 1; } for ( i=0, iLen=an.length ; i<iLen ; i++ ) { // Remove the middle elements $('li:gt(0)', an[i]).filter(':not(:last)').remove(); // Add the new list items and their event handlers for ( j=iStart ; j<=iEnd ; j++ ) { sClass = (j==oPaging.iPage+1) ? 'class="active"' : ''; $('<li '+sClass+'><a href="#">'+j+'</a></li>') .insertBefore( $('li:last', an[i])[0] ) .bind('click', function (e) { e.preventDefault(); oSettings._iDisplayStart = (parseInt($('a', this).text(),10)-1) * oPaging.iLength; fnDraw( oSettings ); } ); } // Add / remove disabled classes from the static elements if ( oPaging.iPage === 0 ) { $('li:first', an[i]).addClass('disabled'); } else { $('li:first', an[i]).removeClass('disabled'); } if ( oPaging.iPage === oPaging.iTotalPages-1 || oPaging.iTotalPages === 0 ) { $('li:last', an[i]).addClass('disabled'); } else { $('li:last', an[i]).removeClass('disabled'); } } } } } ); $('#productTable').dataTable({ "bProcessing": true, "bServerSide": true, "bPagination": true, "bLengthChange": false, "iDisplayLength": 6, "sPaginationType": "bootstrap", "sAjaxSource": ajaxurl + "?action=dashboard_products_table", "aoColumns": [ { "sClass": "left" }, { "sClass": "center" }, { "sClass": "right" }, ], "oLanguage": { "sZeroRecords": "<?php _e('No matching Products found', 'cart66'); ?> ", "sSearch": "<?php _e('Search', 'cart66'); ?> :", "sInfo": "<?php _e('Showing', 'cart66'); ?> _START_ <?php _e('to', 'cart66'); ?> _END_ <?php _e('of', 'cart66'); ?> _TOTAL_ <?php _e('entries', 'cart66'); ?> ", "sInfoEmpty": "<?php _e('Showing 0 to 0 of 0 entries', 'cart66'); ?> ", "oPaginate": { "sNext": "<?php _e('Next', 'cart66'); ?> ", "sPrevious": "<?php _e('Previous', 'cart66'); ?> ", "sLast": "<?php _e('Last', 'cart66'); ?> ", "sFirst": "<?php _e('First', 'cart66'); ?> " }, "sInfoFiltered": "(<?php _e('filtered from', 'cart66'); ?> _MAX_ <?php _e('total entries', 'cart66'); ?> )", "sLengthMenu": "<?php _e('Show', 'cart66'); ?> _MENU_ <?php _e('entries', 'cart66'); ?> ", "sLoadingRecords": "<?php _e('Loading', 'cart66'); ?> ...", "sProcessing": "<?php _e('Processing', 'cart66'); ?> ..." } }); }) })(jQuery); </script> <script type="text/javascript"> (function($){ $(document).ready(function() { // setting the tabs in the sidebar hide and show, setting the current tab $('div.pane').hide(); $('div.t1').show(); $('div.loading').hide(); $('div.cart66Tabbed ul.tabs li.t1 a').addClass('tab-current'); // SIDEBAR TABS $('div.cart66Tabbed ul li a, div.t1 a, div.t1 tr.summaryDetails').click(function(){ if($(this).hasClass('tab')) { var thisClass = this.className.slice(0,2); $('div.pane').hide(); $('div.' + thisClass).fadeIn(300); $('div.cart66Tabbed ul.tabs li a').removeClass('tab-current'); $('div.cart66Tabbed ul.tabs li a.' + thisClass).addClass('tab-current'); } }); }); })(jQuery); </script><?php }
/** * Return information about pro-rated credit or false if there is none. * * Returns a standard object: * $data->description = The description of the credit * $data->amount = The monetary amount of the credit * $data->money = The formated monetary amount of the credit * * return object or false */ public function getProRateInfo() { $data = false; $proRateAmount = 0; if ($this->isSpreedlySubscription()) { if (Cart66Common::isLoggedIn() && Cart66Session::get('Cart66Cart')) { if ($subscriptionId = Cart66Session::get('Cart66Cart')->getSpreedlySubscriptionId()) { try { $invoiceData = array('subscription-plan-id' => $subscriptionId, 'subscriber' => array('customer-id' => Cart66Session::get('Cart66AccountId'))); $invoice = new SpreedlyInvoice(); $invoice->createFromArray($invoiceData); $this->_creditAmount = abs((double) $invoice->invoiceData->{'line-items'}->{'line-item'}[1]->amount); $data = new stdClass(); $data->description = $invoice->invoiceData->{'line-items'}->{'line-item'}[1]->description; $data->amount = $this->_creditAmount; $data->money = Cart66Common::currency($this->_creditAmount); if ($data->amount > 0) { $proRateAmount = $data->amount; } Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Spreedly Invoice: " . print_r($invoice->invoiceData, true)); } catch (SpreedlyException $e) { Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Unable to locate spreedly customer: " . Cart66Session::get('Cart66AccountId')); } } } } Cart66Session::set('Cart66ProRateAmount', $proRateAmount, true); return $data; }
public static function add_shortcode_popup() { global $current_screen; //Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Thinking about adding code for shortcode popup: $current_screen->id"); $add_popup = false; if (in_array($current_screen->id, Cart66Dialog::cart66_get_popup_screens())) { $add_popup = true; } if ($add_popup) { Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Adding code for shortcode popup"); } else { return; } ?> <link type="text/css" rel="stylesheet" href="<?php echo CART66_URL; ?> /js/cart66.css" /> <script language="javascript" type="text/javascript"> <?php $prices = array(); $types = array(); $options = ''; $products = Cart66Product::loadProductsOutsideOfClass(); //$products = $product->getModels("where id>0", "order by name"); if (count($products)) { $i = 0; foreach ($products as $p) { $optionClasses = ""; if ($p->item_number == "") { $id = $p->id; $type = 'id'; $description = ""; } else { $id = $p->item_number; $type = 'item'; $description = '(# ' . $p->item_number . ')'; } $types[] = htmlspecialchars($type); if (CART66_PRO && $p->is_paypal_subscription == 1) { $sub = new Cart66PayPalSubscription($p->id); $subPrice = strip_tags($sub->getPriceDescription($sub->offerTrial > 0, '(trial)')); $prices[] = htmlspecialchars($subPrice); $optionClasses .= " subscriptionProduct "; //Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] subscription price in dialog: $subPrice"); } else { $priceDescription = __('Price:', 'cart66') . ' ' . Cart66Common::currency($p->price); if ($p->price_description != null) { $priceDescription = $p->price_description; } $prices[] = htmlspecialchars(strip_tags($priceDescription)); } $options .= '<option value="' . $id . '" class="' . $optionClasses . '">' . $p->name . ' ' . $description . '</option>'; $i++; } } else { $options .= '<option value="">' . __('No Products', 'cart66') . '</option>'; } $prodTypes = implode("\",\"", $types); $prodPrices = implode("\",\"", $prices); ?> var prodtype = new Array("<?php echo $prodTypes; ?> "); var prodprices = new Array("<?php echo $prodPrices; ?> "); function insertProductCode(){ var type = prodtype[jQuery("#productNameSelector option:selected").index()]; var prod = jQuery("#productNameSelector option:selected").val(); if(jQuery("#productStyle").val()!=""){ var style = 'style="'+jQuery("#productStyle").val()+'"'; } else { var style = ''; } if(jQuery("#buttonText").val()!=""){ var text = 'text="'+jQuery("#buttonText").val()+'"'; } else { var text = ''; } var quantity = jQuery("input:radio[name=quantityOptions]:checked").val(); var defaultQuantity = jQuery("#defaultQuantity").val(); if(quantity == 'user') { if(defaultQuantity == ''){ var quantity = 'quantity="user"'; } else { var quantity = 'quantity="user:'******'"'; } } else if(quantity == 'pre'){ var quantity = 'quantity="'+defaultQuantity+'"'; } else { var quantity = ''; } if(jQuery("#productNameSelector option:selected").hasClass('subscriptionProduct')){ var quantity = ''; } var ajax = jQuery("input:radio[name=ajaxOptions]:checked").val(); if(ajax == 'yes') { var ajax = 'ajax="yes"'; } else { var ajax = ''; } var showPrice = jQuery("input:radio[name=showPrice]:checked").val(); if(showPrice == 'no') { var showPrice = 'showprice="no"'; } else if(showPrice == 'only'){ var showPrice = 'showprice="only"'; } else { var showPrice = ''; } var buttonImage = ''; if(jQuery("#buttonImage").val() != "") { var buttonImage = 'img="' + jQuery("#buttonImage").val() + '"'; } window.send_to_editor(' [add_to_cart '+type+'="'+prod+'" '+style+' ' +showPrice+' '+buttonImage+' ' +quantity+' ' +text+ ' ' +ajax+ ' ] '); } function shortcode(code){ window.send_to_editor(' ['+code+'] '); } function shortcode_wrap(open, close){ window.send_to_editor(' ['+open+"] <br/>[/"+close+'] '); } function preview(){ var productIndex = jQuery("#productNameSelector option:selected").index(); var priceDescription = jQuery("<div/>").html(prodprices[productIndex]).text(); var price = "<p id='priceLabel'>" + priceDescription + "</p>"; if(jQuery("input:radio[name=showPrice]:checked").val()=="no"){ price = ""; } var style = ""; if(jQuery("#productStyle").val()!="") { style = jQuery("#productStyle").val(); } var text = ""; if(jQuery("#buttonText").val()!="") { text = jQuery("#buttonText").val(); } else { text = '<?php _e("Add to Cart", "cart66"); ?> '; } <?php $setting = new Cart66Setting(); $cartImgPath = Cart66Setting::getValue('cart_images_url'); if ($cartImgPath) { if (strpos(strrev($cartImgPath), '/') !== 0) { $cartImgPath .= '/'; } $buttonPath = $cartImgPath . 'add-to-cart.png'; } ?> var button = ''; <?php if ($cartImgPath) { ?> var buttonPath = '<?php echo $buttonPath; ?> '; button = "<img src='"+buttonPath+"' title='"+text+"' alt='<?php _e('Cart66 Add To Cart Button', 'cart66'); ?> '>"; <?php } else { ?> button = "<input type='button' class='Cart66ButtonPrimary' value='"+text+"' />"; <?php } ?> if(jQuery("#buttonImage").val()!=""){ button = "<img src='"+jQuery("#buttonImage").val()+"' title='<?php _e('Add to Cart', 'cart66'); ?> ' alt='<?php _e('Cart66 Add To Cart Button', 'cart66'); ?> '>"; } if(jQuery("input:radio[name=showPrice]:checked").val()=="only"){ button= ""; } var prevBox = "<div style='"+style+"'>"+price+button+"</div>"; jQuery("#buttonPreview").html(prevBox).text(); if(jQuery("#productNameSelector option:selected").hasClass('subscriptionProduct')){ jQuery('.quantity').hide(); } else{ jQuery('.quantity').show(); } } </script> <div id="select_cart66_shortcode" style="display:none;"> <div id="cart66-shortcode-window"> <div id="cart66-shortcode-header"> <ul class="tabs" id="sidemenu"> <li class="s1" id="tab-products"><a class="s1 tab" href="javascript:void(0)"><?php _e('Products', 'cart66'); ?> </a></li> <li class="s2" id="tab-shortcodes"><a class="s2 tab" href="javascript:void(0)"><?php _e('Shortcodes', 'cart66'); ?> </a></li> </ul> </div> <div class="loading"> <h2 class="center"><?php _e('loading...', 'cart66'); ?> </h2> </div> <div class="s1 panes"> <h3><?php _e("Insert A Product", "cart66"); ?> </h3> <ul> <li> <label for="productNameSelector"><?php _e('Your products'); ?> :</label> <select id="productNameSelector" name="productName"><?php echo $options; ?> </select> </li> <li class="quantity"> <label for="quantityOptions" ><?php _e('Quantity'); ?> :</label> <input type='radio' id="quantityOptions" name="quantityOptions" value='user' checked> <?php _e('User Defined', 'cart66'); ?> <input type='radio' id="quantityOptions" name="quantityOptions" value='pre'> <?php _e('Predefined', 'cart66'); ?> <input type='radio' id="quantityOptions" name="quantityOptions" value='off'> <?php _e('Off', 'cart66'); ?> <br /> </li> <li id="defaultQuantityGroup" class="quantity"> <label for="defaultQuantity"><?php _e('Default Quantity', 'cart66'); ?> :</label> <input id="defaultQuantity" name="defaultQuantity" size="2" value="1"> </li> <li> <label for="buttonText"><?php _e('Button Text'); ?> :</label> <input id="buttonText" name="buttonText" size="34"> </li> <li> <label for="productStyle"><?php _e('CSS style'); ?> :</label> <input id="productStyle" name="productStyle" size="34"> </li> <li> <label for="ajaxOptions" ><?php _e('Ajax Add To Cart'); ?> :</label> <?php if (Cart66Setting::getValue('enable_ajax_by_default') && Cart66Setting::getValue('enable_ajax_by_default') == 1) { ?> <input type='radio' id="ajaxOptions" name="ajaxOptions" value='yes' checked> <?php _e('Yes', 'cart66'); ?> <input type='radio' id="ajaxOptions" name="ajaxOptions" value='no'> <?php _e('No', 'cart66'); ?> <?php } else { ?> <input type='radio' id="ajaxOptions" name="ajaxOptions" value='yes'> <?php _e('Yes', 'cart66'); ?> <input type='radio' id="ajaxOptions" name="ajaxOptions" value='no' checked> <?php _e('No', 'cart66'); ?> <?php } ?> </li> <li> <label for="showPrice" style="display: inline-block; width: 120px; text-align: right;"><?php _e('Show price'); ?> :</label> <input type='radio' id="showPrice" name="showPrice" value='yes' checked> <?php _e('Yes', 'cart66'); ?> <input type='radio' id="showPrice" name="showPrice" value='no'> <?php _e('No', 'cart66'); ?> <input type='radio' id="showPrice" name="showPrice" value='only'> <?php _e('Price Only', 'cart66'); ?> </li> <li> <label for="buttonImage" ><?php _e('Button path'); ?> :</label> <input id="buttonImage" name="buttonImage" size="34"> </li> <li> <label for="buttonImage" ><?php _e('Preview'); ?> :</label> <div class="" id="buttonPreview"></div> </li> <li> </li> </ul> </div> <?php $shortcodes_system = array('express' => __('Listens for PayPal Express callbacks <br/>Belongs on system page store/express', 'cart66'), 'ipn' => __('PayPal Instant Payment Notification <br/>Belongs on system page store/ipn', 'cart66'), 'receipt' => __('Shows the customer\'s receipt after a successful sale <br/>Belongs on system page store/receipt', 'cart66')); $shortcodes = array('add_to_cart item=""' => __('Create add to cart button', 'cart66'), 'cart' => __('Show the shopping cart', 'cart66'), 'cart mode="read"' => __('Show the shopping cart in read-only mode', 'cart66'), 'checkout_mijireh' => __('Mijireh Checkout Accept Credit Cards - PCI Compliant', 'cart66'), 'checkout_stripe' => __('Stripe Checkout form', 'cart66'), 'checkout_2checkout' => __('2Checkout checkout form', 'cart66'), 'checkout_manual' => __('Checkout form that does not process credit cards', 'cart66'), 'checkout_paypal' => __('PayPal Website Payments Standard checkout button', 'cart66'), 'checkout_paypal_express' => __('PayPal Express checkout button', 'cart66'), 'clear_cart' => __('Clear the contents of the shopping cart', 'cart66'), 'shopping_cart' => __('Show the Cart66 sidebar widget', 'cart66'), 'post_sale' => __('Display content one time immediately after a sale', 'cart66'), 'cart66_affiliate' => __('Add order information to an affiliate URL that can be used inside the post_sale shortcode. The only attribute is "display"', 'cart66')); if (CART66_PRO) { $shortcodes_pro = array('account_info' => __('Show link to manage subscription account information', 'cart66'), 'account_login' => __('Account login form', 'cart66'), 'account_logout' => __('Logs user out of account', 'cart66'), 'account_logout_link' => __('Show link to log out of account', 'cart66'), 'account_expiration' => __('Show a member when their account expires', 'cart66'), 'cancel_paypal_subscription' => __('Link to cancel PayPal subscription', 'cart66'), 'checkout_payleap' => __('PayLeap checkout form', 'cart66'), 'checkout_authorizenet' => __('Authorize.net (or AIM compatible gateway) checkout form', 'cart66'), 'checkout_eway' => __('Eway checkout form', 'cart66'), 'checkout_mwarrior' => __('Merchant Warrior checkout form', 'cart66'), 'checkout_paypal_pro' => __('PayPal Pro checkout form', 'cart66'), 'terms_of_service' => __('Show the terms of service agreement', 'cart66'), 'subscription_feature_level' => __('Show the name of the subscription feature level for the currently logged in user', 'cart66'), 'subscription_name' => __('Show the name of the subscription for the currently logged in user', 'cart66'), 'zendesk_login' => __('Listens for remote login calls from Zendesk', 'cart66'), 'hide_from' => __('Hide content from members without the listed feature levels - opposite of [show_to]', 'cart66'), 'show_to' => __('Show content only to members with the listed feature levels - opposite of [hide_from]', 'cart66'), 'email_opt_out' => __('Allow Cart66 members to opt out of receiving notifications about the status of their account.', 'cart66')); $shortcodes = array_merge($shortcodes, $shortcodes_pro); $shortcodes_system['spreedly_listener'] = __('Listens for spreedly account changes <br/>Belongs on system page store/spreedly', 'cart66'); } ksort($shortcodes); ?> <div class="s2 panes"> <h3><?php _e("Insert A System Shortcode", "cart66"); ?> </h3> <table id="shortCodeList" cellpadding="0"> <tr> <td colspan="2"><strong><?php _e('Shortcode Quick Reference', 'cart66'); ?> </strong></td> </tr> <?php foreach ($shortcodes as $shortcode => $description) { ?> <tr> <td><div class="shortcode" <?php if ($shortcode == 'hide_from' || $shortcode == 'show_to' || $shortcode == 'post_sale') { ?> onclick="shortcode_wrap('<?php echo $shortcode; ?> <?php echo $shortcode == 'show_to' || $shortcode == 'hide_from' ? 'level=""' : ''; ?> ', '<?php echo $shortcode; ?> ');" <?php } else { ?> onclick="shortcode('<?php echo $shortcode; ?> ');" <?php } ?> ><a title="Insert [<?php echo $shortcode; ?> ]">[<?php echo $shortcode == 'show_to' || $shortcode == 'hide_from' ? "{$shortcode} level=""" : "{$shortcode}"; ?> ]</a></div></td> <td><?php echo $description; ?> </td> </tr> <?php } ?> </table> <br/> <table id="systemShortCodeList" cellpadding="0"> <tr> <td colspan="2"><strong><?php _e('System Shortcodes', 'cart66'); ?> </strong></td> </tr> <?php foreach ($shortcodes_system as $shortcode => $description) { ?> <tr> <td><div class="shortcode" <?php if ($shortcode == 'hide_from' || $shortcode == 'show_to' || $shortcode == 'post_sale') { ?> onclick="shortcode_wrap('<?php echo $shortcode; ?> <?php echo $shortcode == 'show_to' || $shortcode == 'hide_from' ? 'level=""' : ''; ?> ', '<?php echo $shortcode; ?> ');" <?php } else { ?> onclick="shortcode('<?php echo $shortcode; ?> ');" <?php } ?> ><a title="Insert [<?php echo $shortcode; ?> ]">[<?php echo $shortcode == 'show_to' || $shortcode == 'hide_from' ? "{$shortcode} level=""" : "{$shortcode}"; ?> ]</a></div></td> <td><?php echo $description; ?> </td> </tr> <?php } ?> </table> </div> <div> <div class="buttons"> <input type="button" class="button-secondary" value="<?php _e("Cancel", "cart66"); ?> " onclick="tb_remove();" /> <input id="insertProductButton" type="button" class="button-primary" value="<?php _e("Insert Shortcode", "cart66"); ?> " onclick="insertProductCode();"/> </div> </div> </div> </div> <script type="text/javascript"> (function($){ function adjustHeights() { hWindow = $('#TB_window').height(); wWindow = $('#TB_window').width(); $('#TB_ajaxContent').height(hWindow - 45); $('#TB_ajaxContent').width(wWindow - 30); } $(window).resize(function() { $('#TB_ajaxContent').css('height','auto'); adjustHeights(); }); $(document).ready(function() { preview(); $("input").change(function(){preview();}); $("input").click(function(){preview();}); $("#productNameSelector").change(function(){ preview(); }) adjustHeights(); $("#Cart66ThickBox").click(function(){ adjustHeights(); }) $("input:radio[name=quantityOptions]").change(function(){ if($("input:radio[name=quantityOptions]:checked").val()=="off"){ $("#defaultQuantityGroup").fadeOut(600); } else{ $("#defaultQuantityGroup").fadeIn(600); } }) // setting the tabs in the sidebar hide and show, setting the current tab $('div.panes').hide(); $('div.s1').show(); $('div.loading').hide(); $('#insertProductButton').show(); $('div#cart66-shortcode-header ul.tabs li.s1 a').addClass('current'); // SIDEBAR TABS $('div#cart66-shortcode-header ul li a').click(function(){ adjustHeights(); var thisClass = this.className.slice(0,2); $('div.panes').hide(); $('div.' + thisClass).fadeIn(300); $('div#cart66-shortcode-header ul.tabs li a').removeClass('current'); $('div#cart66-shortcode-header ul.tabs li a.' + thisClass).addClass('current'); if($('.current').hasClass('s1')){ $('#insertProductButton').fadeIn(300); } else{ $('#insertProductButton').fadeOut(300); } }); }); })(jQuery); </script> <?php }
public function getProductPriceDescription() { if ($this->_productId > 0) { $product = new Cart66Product($this->_productId); if ($product->isPayPalSubscription()) { $product = new Cart66PayPalSubscription($product->id); $priceDescription = $product->getPriceDescription($product->offerTrial > 0, '(trial)'); } elseif ($product->isSpreedlySubscription()) { $product = new Cart66Product($product->id); $priceDescription = $product->getPriceDescription(); } elseif ($product->is_user_price == 1 || $product->gravity_form_pricing) { $session_var_name = "userPrice_{$this->_productId}"; if ($product->gravity_form_pricing) { $session_var_name .= '_' . $this->getFirstFormEntryId(); } if (Cart66Session::get($session_var_name)) { $userPrice = Cart66Session::get($session_var_name); if ($product->min_price > 0 && $userPrice < $product->min_price) { $userPrice = $product->min_price; } if ($product->max_price > 0 && $userPrice > $product->max_price) { $userPrice = $product->max_price; } $priceDescription = Cart66Common::currency($userPrice); } else { $priceDescription = Cart66Common::currency($product->price); } } else { $priceDescription = $product->getPriceDescription($this->_priceDifference); if (is_numeric($priceDescription)) { $priceDescription = Cart66Common::currency($priceDescription); } } } return $priceDescription; }
echo $promo->id > 0 ? Cart66Common::currency($promo->minOrder, true, false, false) : ''; ?> "> <?php echo Cart66Common::currencySymbol('after'); ?> </div> <div class="group"> <label for="promo-max_order"><?php _e('Maximum order amount', 'cart66'); ?> :</label> <?php echo Cart66Common::currencySymbol('before'); ?> <input type="text" id="promo-max_order" name="promo[max_order]" value="<?php echo $promo->id > 0 ? Cart66Common::currency($promo->maxOrder, true, false, false) : ''; ?> "> <?php echo Cart66Common::currencySymbol('after'); ?> </div> <span class="label_desc"><?php _e('Set the minimum and/or maximum amount required for this promotion to apply', 'cart66'); ?> .</span> </div> </li> <li> <div class="desc"><?php _e('Required Quantity', 'cart66'); ?>
} // Save the order if ('FAILURE' != strtoupper($profileResponse['ACK'])) { $token = Cart66Common::postVal('token'); $payerId = Cart66Common::postVal('PayerID'); $opts = Cart66Setting::getValue('status_options'); $status = ''; if (!empty($opts)) { $opts = explode(',', $opts); $status = trim($opts[0]); } $transId = isset($response['TRANSACTIONID']) ? $response['TRANSACTIONID'] : ''; $promo = Cart66Session::get('Cart66PromotionCode'); $promoMsg = "none"; if ($promo) { $promoMsg = $promo . ' (-' . Cart66Common::currency(Cart66Session::get('Cart66Promotion')->getDiscountAmount(Cart66Session::get('Cart66Cart'))) . ')'; } Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Details:\n" . print_r($details, true)); list($shipFirstName, $shipLastName) = explode(' ', $details['SHIPTONAME'], 2); $orderInfo['ship_first_name'] = $shipFirstName; $orderInfo['ship_last_name'] = $shipLastName; $orderInfo['ship_address'] = $details['SHIPTOSTREET']; $orderInfo['ship_address2'] = isset($details['SHIPTOSTREET2']) ? $details['SHIPTOSTREET2'] : ''; $orderInfo['ship_city'] = $details['SHIPTOCITY']; $orderInfo['ship_state'] = $details['SHIPTOSTATE']; $orderInfo['ship_zip'] = $details['SHIPTOZIP']; $orderInfo['ship_country'] = $details['SHIPTOCOUNTRYNAME']; $orderInfo['bill_first_name'] = $details['FIRSTNAME']; $orderInfo['bill_last_name'] = $details['LASTNAME']; $orderInfo['bill_address'] = ''; $orderInfo['bill_address2'] = '';
public static function getPromoMessage() { $promo = Cart66Session::get('Cart66Promotion'); $promoMsg = "none"; if ($promo) { $promoMsg = $promo->getCode() . ' (-' . Cart66Common::currency(Cart66Session::get('Cart66Promotion')->getDiscountAmount(Cart66Session::get('Cart66Cart')), false) . ')'; } return $promoMsg; }
} ?> <table class="Cart66TableMed"> <?php for ($i = 0; $i < count($data['days']); $i++) { ?> <?php if ($i % 7 == 0) { echo '<tr>'; } ?> <td> <span style="color: #999; font-size: 11px;"><?php echo date(get_option('date_format'), strtotime($data['days'][$i], Cart66Common::localTs())); ?> </span><br/> <?php echo Cart66Common::currency($data['totals'][$i]); ?> </td> <?php if ($i % 7 == 6) { echo '</tr>'; } ?> <?php } ?> </table> <?php }
$css = ' Cart66PriceBlock'; } ?> <span class="Cart66Price<?php echo $isNumeric ? $css : ' Cart66PriceDescription'; ?> "> <?php if ($isNumeric) { ?> <span class="Cart66PriceLabel"><?php _e('Price', 'cart66'); ?> : </span> <?php echo Cart66Common::currency($priceString, true, true); ?> <?php } else { ?> <?php echo $priceString; ?> <?php } ?> </span> <?php } ?>
?> <input type="text" style="width: 75px;" id="product-min_price" name='product[min_price]' value='<?php echo $product->id > 0 ? Cart66Common::currency($product->minPrice, true, false, false) : ''; ?> ' /> <?php echo Cart66Common::currencySymbol('after'); ?> <label class="short" for="product-max_price"><?php _e('Max price', 'cart66'); ?> :</label> <?php echo Cart66Common::currencySymbol('before'); ?> <input type="text" style="width: 75px;" id="product-max_price" name='product[max_price]' value='<?php echo $product->id > 0 ? Cart66Common::currency($product->maxPrice, true, false, false) : ''; ?> ' /> <?php echo Cart66Common::currencySymbol('after'); ?> <span class="label_desc" id="is_user_price_description"><?php _e('Set to $0.00 for no limit ', 'cart66'); ?> </span> </li> <li> <label class="long" for="product-taxable"><?php _e('Taxed', 'cart66'); ?> :</label>
} else { ?> <td colspan="2"> </td> <?php } ?> <td class="alignRight strong Cart66CartTotalLabel"><span class="ajax-spin"><img src="<?php echo CART66_URL; ?> /images/ajax-spin.gif" /></span> <?php _e('Total', 'cart66'); ?> :</td> <td class="strong grand-total-amount cart66-align-right"> <?php echo Cart66Common::currency(Cart66Session::get('Cart66Cart')->getGrandTotal() + $tax); ?> </td> </tr> </tbody> </table> </form> <?php if ($fullMode) { ?> <div id="viewCartNav"> <div id="continueShopping"> <?php if ($cartImgPath) {
echo Cart66Common::currency($order->tax); ?> </td> </tr> <?php } ?> <tr class="noBorder"> <td colspan='2' style='text-align: center;'> </td> <td colspan="1" style='text-align: right; font-weight: bold;'><?php _e('Total', 'cart66'); ?> :</td> <td colspan="1" style="text-align: left; font-weight: bold;"><?php echo Cart66Common::currency($order->total); ?> </td> </tr> </table> <!-- Receipt Content Start --> <style> ol li {font-size: 21px; margin-left: 47px; font-weight: 300; font-family: lato;}
public static function ajaxCartElements($args = "") { $items = Cart66Session::get('Cart66Cart')->getItems(); $product = new Cart66Product(); $products = array(); foreach ($items as $itemIndex => $item) { $product->load($item->getProductId()); $products[] = array('productName' => $item->getFullDisplayName(), 'productQuantity' => $item->getQuantity(), 'productPrice' => Cart66Common::currency($item->getProductPrice()), 'productSubtotal' => Cart66Common::currency($item->getProductPrice() * $item->getQuantity())); } $summary = array('items' => ' ' . _n('item', 'items', Cart66CartWidget::countItems(), 'cart66'), 'amount' => Cart66Common::currency(Cart66CartWidget::getSubTotal()), 'count' => Cart66CartWidget::countItems()); $array = array('summary' => $summary, 'products' => $products, 'subtotal' => Cart66Common::currency(Cart66Session::get('Cart66Cart')->getSubTotal()), 'shipping' => Cart66Session::get('Cart66Cart')->requireShipping() ? 1 : 0, 'shippingAmount' => Cart66Common::currency(Cart66Session::get('Cart66Cart')->getShippingCost())); echo json_encode($array); die; }
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; }
> <a id="Cart66WidgetCartLink" href='<?php echo get_permalink($data['cartPage']->ID); ?> '> <span id="Cart66WidgetCartCount"><?php echo $data['numItems']; ?> </span> <span id="Cart66WidgetCartCountText"> <?php echo _n('item', 'items', $data['numItems'], 'cart66'); ?> </span> <span id="Cart66WidgetCartCountDash">–</span> <span id="Cart66WidgetCartPrice"><?php echo Cart66Common::currency($data['cartWidget']->getSubTotal()); ?> </span></a> <a id="Cart66WidgetViewCart" href='<?php echo get_permalink($data['cartPage']->ID); ?> '><?php _e('View Cart', 'cart66'); ?> </a> <span id="Cart66WidgetLinkSeparator"> | </span> <a id="Cart66WidgetCheckout" href='<?php echo get_permalink($data['checkoutPage']->ID); ?> '><?php _e('Check out', 'cart66');