本文整理汇总了PHP中Cart66Common::getView方法的典型用法代码示例。如果您正苦于以下问题:PHP Cart66Common::getView方法的具体用法?PHP Cart66Common::getView怎么用?PHP Cart66Common::getView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cart66Common
的用法示例。
在下文中一共展示了Cart66Common::getView方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getEmailReceiptMessage
public function getEmailReceiptMessage($order, $html = null, $test = null)
{
if (CART66_PRO) {
$msg = Cart66Common::getView('pro/views/emails/default-email-receipt.php', array($order, $html, $test));
} else {
$msg = $this->defaultPlainEmailMessage($order);
}
return $msg;
}
示例2: ajaxReceipt
public static function ajaxReceipt()
{
if (isset($_GET['order_id'])) {
$orderReceipt = new Cart66Order($_GET['order_id']);
$printView = Cart66Common::getView('views/receipt_print_version.php', array('order' => $orderReceipt));
$printView = str_replace("\n", '', $printView);
$printView = str_replace("'", '"', $printView);
echo $printView;
die;
}
}
示例3: getCartButton
/**
* Return the HTML for rendering the add to cart buton for the given product id
*/
public static function getCartButton(Cart66Product $product, $attrs)
{
$view = "<p>" . __("Could not load product information", "cart66") . "</p>";
if ($product->id > 0) {
// Set CSS style if available
$style = isset($attrs['style']) ? 'style="' . $attrs['style'] . '"' : '';
$price = '';
$quantity = isset($attrs['quantity']) ? $attrs['quantity'] : 1;
$ajax = isset($attrs['ajax']) ? $attrs['ajax'] : 'no';
$buttonText = isset($attrs['text']) ? $attrs['text'] : __('Add to Cart', 'cart66');
$showName = isset($attrs['show_name']) ? strtolower($attrs['show_name']) : '';
$showPrice = isset($attrs['showprice']) ? strtolower($attrs['showprice']) : 'yes';
$subscription = 0;
if ($showPrice == 'yes' || $showPrice == 'only') {
$price = $product->price;
// Check for subscription pricing
if ($product->isSubscription()) {
if ($product->isPayPalSubscription()) {
$subscription = 1;
Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Rendering button for PayPal subscription");
$sub = new Cart66PayPalSubscription($product->id);
$price = $sub->getPriceDescription($sub->offerTrial > 0, '(trial)');
} else {
$subscription = 2;
if ($product->price > 0) {
$price .= ' + ' . $product->getRecurringPriceSummary();
} else {
$price = $product->getRecurringPriceSummary();
}
}
} else {
$price = $product->getPriceDescription();
}
}
if ($product->isSubscription()) {
if ($product->isPayPalSubscription()) {
$subscription = 1;
} else {
$subscription = 2;
}
}
$gravity_form_id = isset($product->gravity_form_id) ? $product->gravity_form_id : false;
$data = array('price' => $price, 'is_user_price' => $product->is_user_price, 'min_price' => $product->min_price, 'max_price' => $product->max_price, 'quantity' => $quantity, 'ajax' => $ajax, 'showPrice' => $showPrice, 'showName' => $showName, 'style' => $style, 'buttonText' => $buttonText, 'subscription' => $subscription, 'addToCartPath' => self::getAddToCartImagePath($attrs), 'product' => $product, 'productOptions' => $product->getOptions(), 'gravity_form_id' => $gravity_form_id);
$view = Cart66Common::getView('views/cart-button.php', $data, true, true);
}
return $view;
}
示例4: _buildCheckoutView
protected function _buildCheckoutView($gateway)
{
$ssl = Cart66Setting::getValue('auth_force_ssl');
if ($ssl) {
if (!Cart66Common::isHttps()) {
$sslUrl = "https://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
wp_redirect($sslUrl);
exit;
}
}
// use manual gateway form to gather user information
require_once CART66_PATH . "/gateways/Cart66ManualGateway.php";
$gateway = new Cart66_paymill_for_wordpress();
if (!Cart66Session::get('Cart66Cart')) {
Cart66Session::set('Cart66Cart', new Cart66Cart());
}
if (!$GLOBALS['paymill_active']) {
paymill_load_frontend_scripts();
// load frontend scripts
// settings
$GLOBALS['paymill_active'] = true;
$cart_total = intval(Cart66Session::get('Cart66Cart')->getGrandTotal(false) * 100);
$currency = CURRENCY_CODE;
$no_logos = false;
ob_start();
// form ids
echo '<script>
paymill_form_checkout_id = "#Cart66_paymill_for_wordpress_form";
paymill_form_checkout_submit_id = "#Cart66CheckoutButton";
paymill_shop_name = "cart66";
paymill_pcidss3 = ' . (empty($GLOBALS['paymill_settings']->paymill_general_settings['pci_dss_3']) || $GLOBALS['paymill_settings']->paymill_general_settings['pci_dss_3'] != '1' ? 1 : 0) . ';
paymill_pcidss3_lang = "' . substr(apply_filters('plugin_locale', get_locale(), $domain), 0, 2) . '";
</script>
';
require_once PAYMILL_DIR . 'lib/tpl/checkout_form.php';
$view .= '<h2>' . __('Payment Information', 'paymill') . '</h2>';
$view .= ob_get_clean();
$checkout = Cart66Common::getView('views/checkout.php', array('gateway' => $gateway), true, true);
$view .= str_replace(array('Cart66ManualGateway', 'Payment Information'), array('Cart66_paymill_for_wordpress', 'Contact Information'), $checkout);
} else {
$view = '<div class="paymill_notification paymill_notification_once_only"><strong>Error:</strong> Paymill can be loaded once only on the same page.</div>';
}
return $view;
}
示例5: widget
public function widget($args, $instance)
{
extract($args);
$data['title'] = $instance['title'];
$data['shipping'] = isset($instance['shipping']) ? $instance['shipping'] : false;
if (!Cart66Session::get('Cart66Cart')) {
Cart66Session::set('Cart66Cart', new Cart66Cart());
}
$this->_items = Cart66Session::get('Cart66Cart')->getItems();
$data['items'] = $this->_items;
$data['cartPage'] = get_page_by_path('store/cart');
$data['checkoutPage'] = get_page_by_path('store/checkout');
$data['numItems'] = $this->countItems();
$data['cartWidget'] = $this;
$data['beforeWidget'] = $before_widget;
$data['afterWidget'] = $after_widget;
$data['beforeTitle'] = $before_title;
$data['afterTitle'] = $after_title;
if (isset($instance['standard_advanced']) && $instance['standard_advanced'] == 'advanced') {
echo Cart66Common::getView('views/cart-sidebar-advanced.php', $data);
} else {
echo Cart66Common::getView('views/cart-sidebar.php', $data);
}
}
示例6: array
echo '</ul>';
?>
</li>
<?php
}
?>
</ul>
<?php
if (!Cart66Common::isLoggedIn()) {
?>
<?php
if (Cart66Session::get('Cart66Cart')->hasSubscriptionProducts() || Cart66Session::get('Cart66Cart')->hasMembershipProducts()) {
?>
<?php
echo Cart66Common::getView('pro/views/account-form.php', array('account' => $account, 'embed' => false));
?>
<?php
}
?>
<?php
}
?>
<div id="Cart66CheckoutButtonDiv">
<label for="Cart66CheckoutButton" class="Cart66Hidden"><?php
_e('Checkout', 'cart66');
?>
</label>
<?php
$cartImgPath = Cart66Setting::getValue('cart_images_url');
示例7: section_debug_settings
public function section_debug_settings()
{
$tab = 'debug-error_logging';
if (isset($_GET['cart66_curl_test']) && $_GET['cart66_curl_test'] == 'run' || isset($_POST['cart66-action']) && $_POST['cart66-action'] == 'clear log file') {
$tab = 'debug-debug_data';
} elseif (isset($_POST['cart66-action']) && $_POST['cart66-action'] == 'check subscription reminders') {
Cart66MembershipReminders::dailySubscriptionEmailReminderCheck();
$tab = 'debug-debug_data';
} elseif (isset($_POST['cart66-action']) && $_POST['cart66-action'] == 'check followup emails') {
Cart66AdvancedNotifications::dailyFollowupEmailCheck();
$tab = 'debug-debug_data';
} elseif (isset($_POST['cart66-action']) && $_POST['cart66-action'] == 'prune pending orders') {
$order = new Cart66Order();
$order->dailyPrunePendingPayPalOrders();
$tab = 'debug-debug_data';
} elseif (isset($_GET['sessions']) && $_GET['sessions'] == 'repair') {
$tab = 'debug-session_settings';
}
$data = array('tab' => $tab);
echo Cart66Common::getView('admin/settings/debug.php', $data, false);
}
示例8: emailOptOut
public function emailOptOut()
{
if (isset($_GET['cart66-task']) && $_GET['cart66-task'] == 'opt_out') {
if (isset($_GET['e']) && isset($_GET['t'])) {
$email = base64_decode(urldecode($_GET['e']));
$verify = Cart66ProCommon::verifyEmailToken($_GET['t'], $email);
if ($verify == 1) {
$data = array('form' => 'form', 'email' => $email, 'token' => $_GET['t']);
echo Cart66Common::getView('pro/views/unsubscribe.php', $data);
} else {
if ($verify == -1) {
$message = __('This email has already been unsubscribed', 'cart66');
}
if ($verify == -2) {
$message = __('This email does not exist in our system', 'cart66');
}
$data = array('form' => 'error', 'message' => $message);
echo Cart66Common::getView('pro/views/unsubscribe.php', $data);
}
}
} elseif (isset($_GET['cart66-action']) && $_GET['cart66-action'] == 'opt_out') {
Cart66ProCommon::unsubscribeEmailToken($_POST['token'], $_POST['email']);
$data = array('form' => 'opt_out', 'email' => $_POST['email']);
echo Cart66Common::getView('pro/views/unsubscribe.php', $data);
} elseif (isset($_GET['cart66-action']) && $_GET['cart66-action'] == 'cancel_opt_out') {
$data = array('form' => 'cancel');
echo Cart66Common::getView('pro/views/unsubscribe.php', $data);
}
}
示例9: _e
_e('None', 'cart66');
?>
</option>
<?php
try {
$gr = new Cart66GravityReader($product->gravityFormId);
$fields = $gr->getStandardFields();
foreach ($fields as $id => $label) {
$id = str_replace("'", "", $id);
Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Gravity Form Fields :: {$id} => {$label}");
$selected = $product->gravityFormQtyId == $id ? 'selected="selected"' : '';
echo "<option value='{$id}' {$selected}>{$label}</option>\n";
}
} catch (Cart66Exception $e) {
$exception = Cart66Exception::exceptionMessages($e->getCode(), $e->getMessage());
$gravityError = Cart66Common::getView('views/error-messages.php', $exception);
}
?>
</select>
<?php
echo isset($gravityError) ? $gravityError : '';
?>
<span class="label_desc"><?php
_e('Use one of the Gravity Form fields as the quantity for your product.', 'cart66');
?>
</span>
</li>
<?php
}
?>
示例10: _e
?>
<?php
} else {
?>
<p><?php
_e('Receipt not available', 'cart66');
?>
</p>
<?php
}
?>
<?php
if ($order !== false) {
$printView = Cart66Common::getView('views/receipt_print_version.php', array('order' => $order));
$printView = str_replace("\n", '', $printView);
$printView = str_replace("'", '"', $printView);
?>
<script type="text/javascript">
/* <![CDATA[ */
(function($){
$(document).ready(function(){
$('#print_version').click(function() {
myWindow = window.open('','Your_Receipt','resizable=yes,scrollbars=yes,width=550,height=700');
myWindow.document.open("text/html","replace");
myWindow.document.write(decodeURIComponent('<?php
echo rawurlencode($printView);
?>
' + ''));
myWindow.document.close();
示例11: accountsPage
//.........这里部分代码省略.........
$account = new Cart66Account($_REQUEST['accountId']);
$account->deleteMe();
$account->clear();
}
} elseif (isset($_REQUEST['accountId']) && is_numeric($_REQUEST['accountId'])) {
if (isset($_REQUEST['opt_out'])) {
$account = new Cart66Account();
$account->load($_REQUEST['accountId']);
$data = array('opt_out' => $_REQUEST['opt_out']);
$account->setData($data);
$account->save();
$account->clear();
}
// Look in query string for account id
$account = new Cart66Account();
$account->load($_REQUEST['accountId']);
$id = $account->getCurrentAccountSubscriptionId(true);
$data['plan'] = new Cart66AccountSubscription($id);
// Return even if plan is expired
if (date('Y', strtotime($data['plan']->activeUntil)) <= 1970) {
$data['activeUntil'] = '';
} else {
$data['activeUntil'] = date('m/d/Y', strtotime($data['plan']->activeUntil));
}
}
if ($_SERVER['REQUEST_METHOD'] == 'POST' && Cart66Common::postVal('cart66-action') == 'save account') {
$acctData = $_POST['account'];
// Format or unset password
if (empty($acctData['password'])) {
unset($acctData['password']);
} else {
$acctData['password'] = md5($acctData['password']);
}
// Strip HTML tags on notes field
$acctData['notes'] = strip_tags($acctData['notes'], '<a><strong><em>');
$planData = $_POST['plan'];
$planData['active_until'] = date('Y-m-d 00:00:00', strtotime($planData['active_until']));
// Updating an existing account
if ($acctData['id'] > 0) {
$account = new Cart66Account($acctData['id']);
$account->setData($acctData);
$account_errors = $account->validate();
$sub = new Cart66AccountSubscription($planData['id']);
if ($planData['product_id'] != 'spreedly_subscription') {
$sub->setData($planData);
$subscription_product = new Cart66Product($sub->product_id);
$sub->subscription_plan_name = $subscription_product->name;
$sub->feature_level = $subscription_product->feature_level;
$sub->subscriber_token = '';
} else {
unset($planData['product_id']);
$sub->setData($planData);
}
$subscription_errors = $sub->validate();
$errors = array_merge($account_errors, $subscription_errors);
if (count($errors) == 0) {
$account->save();
$sub->save();
$account->clear();
$sub->clear();
} else {
$data['errors'] = $errors;
$data['plan'] = $sub;
$data['activeUntil'] = date('m/d/Y', strtotime($sub->activeUntil));
}
} else {
// Creating a new account
$account = new Cart66Account();
$account->setData($acctData);
$account_errors = $account->validate();
if (count($account_errors) == 0) {
$sub = new Cart66AccountSubscription();
$sub->setData($planData);
$subscription_errors = $sub->validate();
if (count($subscription_errors) == 0) {
$account->save();
$sub->billingFirstName = $account->firstName;
$sub->billingLastName = $account->lastName;
$sub->billingInterval = 'Manual';
$sub->account_id = $account->id;
$subscription_product = new Cart66Product($sub->product_id);
$sub->subscription_plan_name = $subscription_product->name;
$sub->feature_level = $subscription_product->feature_level;
$sub->save();
$account->clear();
$data['just_saved'] = true;
} else {
$data['errors'] = $subscription_errors;
}
} else {
$data['errors'] = $account_errors;
}
}
}
$data['url'] = Cart66Common::replaceQueryString('page=cart66-accounts');
$data['account'] = $account;
}
$view = Cart66Common::getView('admin/accounts.php', $data);
echo $view;
}
示例12: strtoupper
$pp->setEcUrls($ecUrls);
$response = $pp->SetExpressCheckout();
$ack = strtoupper($response['ACK']);
if ('SUCCESS' == $ack || 'SUCCESSWITHWARNING' == $ack) {
Cart66Session::set('PayPalProToken', $response['TOKEN']);
$expressCheckoutUrl = $pp->getExpressCheckoutUrl($response['TOKEN']);
wp_redirect($expressCheckoutUrl);
exit;
} elseif (empty($ack)) {
echo '<pre>Failed to connect via curl to PayPal. The most likely cause is that your PHP installation failed to verify that the CA cert is OK</pre>';
} else {
try {
throw new Cart66Exception(ucwords($response['L_SHORTMESSAGE0']), 66503);
} catch (Cart66Exception $e) {
$exception = Cart66Exception::exceptionMessages($e->getCode(), $e->getMessage(), array('Error Number: ' . $response['L_ERRORCODE0'], $response['L_LONGMESSAGE0']));
echo Cart66Common::getView('views/error-messages.php', $exception);
}
}
}
?>
<?php
if ($settingsOk) {
?>
<form action="" method='post' id="paypalexpresscheckout">
<input type='hidden' name='cart66-action' value='paypalexpresscheckout'>
<?php
$paypalImageUrl = 'https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif';
if (CART66_PRO && Cart66Setting::getValue('custom_paypal_express_image')) {
$paypalImageUrl = Cart66Setting::getValue('custom_paypal_express_image');
}
示例13: getAdvancedEmailMessageContent
public function getAdvancedEmailMessageContent($setting, $order, $html = null, $test = null, $emailVariable = null)
{
$setting_array = array('receipt', 'reminder', 'fulfillment', 'followup');
if (!in_array($setting, $setting_array)) {
$emailVariable = $setting;
$setting = 'status';
}
switch ($setting) {
case 'receipt':
$msg = $this->getEmailReceiptMessage($order, $html, $test);
break;
default:
$msg = Cart66Common::getView('pro/views/emails/default-email-' . $setting . '.php', array($order, $html, $test, $emailVariable));
break;
}
return $msg;
}
示例14: drawFeatureLevelMetaBox
public function drawFeatureLevelMetaBox($post)
{
if (CART66_PRO) {
$plans = array();
$featureLevels = array();
$data = array();
// Load feature levels defined in Spreedly if available
if (class_exists('SpreedlySubscription')) {
$sub = new SpreedlySubscription();
$subs = $sub->getSubscriptions();
foreach ($subs as $s) {
// $plans[] = array('feature_level' => (string)$s->featureLevel, 'name' => (string)$s->name);
$plans[(string) $s->name] = (string) $s->featureLevel;
$featureLevels[] = (string) $s->featureLevel;
}
}
// Load feature levels defined in PayPal subscriptions
$sub = new Cart66PayPalSubscription();
$subs = $sub->getSubscriptionPlans();
foreach ($subs as $s) {
$plans[$s->name] = $s->featureLevel;
$featureLevels[] = $s->featureLevel;
}
// Load feature levels defined in Membership products
foreach (Cart66Product::getMembershipProducts() as $membership) {
$plans[$membership->name] = $membership->featureLevel;
$featureLevels[] = $membership->featureLevel;
}
// Put unique feature levels in alphabetical order
if (count($featureLevels)) {
$featureLevels = array_unique($featureLevels);
sort($featureLevels);
$savedPlanCsv = get_post_meta($post->ID, '_cart66_subscription', true);
$savedFeatureLevels = empty($savedPlanCsv) ? array() : explode(',', $savedPlanCsv);
Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Cart66 Saved Plans: {$savedPlanCsv} -- " . print_r($savedFeatureLevels, true));
$data = array('featureLevels' => $featureLevels, 'plans' => $plans, 'saved_feature_levels' => $savedFeatureLevels);
}
$box = Cart66Common::getView('pro/views/feature-level-meta-box.php', $data);
echo $box;
}
}
示例15: initCheckout
public function initCheckout($amount)
{
$cart = Cart66Session::get('Cart66Cart');
$tax = $this->getTaxAmount();
$order = array('return_url' => Cart66Common::appendWurlQueryString('task=mijireh_notification'), 'tax' => $tax, 'shipping' => $cart->getShippingCost(), 'discount' => $cart->getDiscountAmount(), 'subtotal' => $cart->getSubTotal(), 'total' => number_format($cart->getGrandTotal() + $tax, 2, '.', ''), 'items' => array());
// Prepare the shipping address if it is available
if (strlen($this->_shipping['address']) > 3) {
$order['shipping_address'] = array('first_name' => $this->_shipping['firstName'], 'last_name' => $this->_shipping['lastName'], 'street' => $this->_shipping['address'], 'apt_suite' => $this->_shipping['address2'], 'city' => $this->_shipping['city'], 'state_province' => $this->_shipping['state'], 'zip_code' => $this->_shipping['zip'], 'country' => $this->_shipping['country'], 'phone' => $this->_payment['phone']);
}
// Add shipping method and promotion code as meta_data
$order['meta_data'] = array('shipping_method' => Cart66Session::get('Cart66Cart')->getShippingMethodName(), 'coupon' => Cart66Common::getPromoMessage(), 'custom-field' => $this->_payment['custom-field']);
// Add logged in users id to the meta_data for membership product upgrades/extensions
$account_id = Cart66Common::isLoggedIn();
if ($account_id) {
$order['meta_data']['account_id'] = $account_id;
}
// Add coupon code as meta_data
foreach ($cart->getItems() as $key => $item) {
$sku = $item->getItemNumber();
$order_item_data = array('sku' => $sku, 'name' => $item->getFullDisplayName(), 'price' => $item->getProductPrice(), 'quantity' => $item->getQuantity());
if ($custom_desc = $item->getCustomFieldDesc()) {
$order_item_data['name'] .= "\n" . $custom_desc;
}
if ($custom_info = $item->getCustomFieldInfo()) {
$order_item_data['name'] .= "\n" . $custom_info;
}
$order['items'][$key] = $order_item_data;
$option_info = trim($item->getOptionInfo());
if (!empty($option_info)) {
$order['meta_data']['options_' . $sku] = $option_info;
}
if ($item->hasAttachedForms()) {
$form_ids = $item->getFormEntryIds();
if (is_array($form_ids) && count($form_ids)) {
$form_ids = implode(',', $form_ids);
$order['meta_data'][$key]['gforms_' . $sku] = $form_ids;
}
}
}
// DBG
/*
echo "<pre>";
print_r($order);
echo "</pre>";
die();
*/
try {
//Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Sending Order To Mijireh" . print_r($order, true));
$access_key = Cart66Setting::getValue('mijireh_access_key');
$rest = new PestJSON(MIJIREH_CHECKOUT);
$rest->setupAuth($access_key, '');
Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Sending Order To Mijireh: " . print_r($order, true));
$result = $rest->post('/api/1/orders', $order);
wp_redirect($result['checkout_url']);
//wp_redirect(MIJIREH_CHECKOUT . '/checkout/' . $result['order_number']);
exit;
} catch (Pest_Unauthorized $e) {
Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] REST Request Failed because it was unauthorized: " . $e->getMessage());
$this->response['error_message'] = __("Your Mijireh Access key is invalid, please check your access settings and try again", "cart66");
$this->response['error_code'] = 1;
if (strlen($this->_shipping['address']) < 3) {
$gatewayResponse = $this->getTransactionResponseDescription();
$exception = Cart66Exception::exceptionMessages(66500, __('Your order could not be processed for the following reasons:', 'cart66'), array('error_code' => 'Error: ' . $gatewayResponse['errorcode'], strtolower($gatewayResponse['errormessage'])));
echo Cart66Common::getView('views/error-messages.php', $exception);
}
} catch (Exception $e) {
Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] REST Request Failed: " . $e->getMessage());
}
}