• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Cart66Setting类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Cart66Setting的典型用法代码示例。如果您正苦于以下问题:PHP Cart66Setting类的具体用法?PHP Cart66Setting怎么用?PHP Cart66Setting使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Cart66Setting类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: dailySubscriptionEmailReminderCheck

 public static function dailySubscriptionEmailReminderCheck()
 {
     Cart66Setting::setValue('daily_subscription_reminders_last_checked', Cart66Common::localTs());
     // Function that fires daily to send out subscription reminder emails.  This will be triggered once a day at 3 AM.
     // If this function fires emails will be sent.
     $dayStart = date('Y-m-d 00:00:00', Cart66Common::localTs());
     $dayEnd = date('Y-m-d 00:00:00', strtotime('+ 1 day', Cart66Common::localTs()));
     $reminder = new Cart66MembershipReminders();
     $reminders = $reminder->getModels();
     foreach ($reminders as $r) {
         if ($r->enable == 1) {
             $interval = explode(',', $r->interval);
             foreach ($interval as $i) {
                 $new_interval = trim($i) . ' ' . $r->interval_unit;
                 $product = new Cart66Product($r->subscription_plan_id);
                 $start = date('Y-m-d H:i:s', strtotime('+ ' . $new_interval, strtotime($dayStart)));
                 $end = date('Y-m-d H:i:s', strtotime('+ ' . $new_interval, strtotime($dayEnd)));
                 $sub = new Cart66AccountSubscription();
                 $subs = $sub->getModels("where active_until >= '{$start}' AND active_until < '{$end}' AND lifetime != '1' AND product_id = '{$product->id}'");
                 $log = array();
                 foreach ($subs as $s) {
                     if ($r->validateReminderEmails($s->id)) {
                         $r->sendReminderEmails($s->id);
                         $log[] = $s->id . ' :: ' . $s->billing_first_name . ' ' . $s->billing_last_name;
                     }
                 }
                 Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Start: {$start} :: End: {$end}");
                 Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] subscription ids that meet the criteria: " . print_r($log, true));
             }
         }
     }
 }
开发者ID:rbredow,项目名称:allyzabbacart,代码行数:32,代码来源:Cart66MembershipReminders.php


示例2: initCheckout

 public function initCheckout($total)
 {
     $p = $this->getPayment();
     $b = $this->getBilling();
     Cart66Common::log("Payment info for checkout: " . print_r($p, true));
     $expDate = $p['cardExpirationMonth'] . substr($p['cardExpirationYear'], 2);
     $this->addField('Description', 'Your shopping cart');
     $this->addField('method', 'processCard');
     $this->addField('transactionAmount', number_format($total, 2, '.', ''));
     $this->addField('transactionCurrency', Cart66Setting::getValue('mwarrior_currency'));
     $this->addField('transactionProduct', '12345');
     $this->addField('merchantUUID', $this->_apiData['MERCHANTUUID']);
     $this->addField('apiKey', $this->_apiData['APIKEY']);
     $this->addField('customerName', $b['firstName'] . ' ' . $b['lastName']);
     $this->addField('customerCountry', $b['country']);
     $this->addField('customerAddress', $b['address']);
     $this->addField('customerCity', $b['city']);
     $this->addField('customerState', $b['state']);
     $this->addField('customerPostCode', $b['zip']);
     $this->addField('customerPhone', $p['phone']);
     $this->addField('customerEmail', $p['email']);
     $this->addField('paymentCardNumber', $p['cardNumber']);
     $this->addField('paymentCardExpiry', $expDate);
     $this->addField('paymentCardCSC', $p['securityId']);
     $this->addField('paymentCardName', $b['firstName'] . ' ' . $b['lastName']);
     $this->addField('customerIP', self::getRemoteIP());
     $this->addField('hash', self::calculateHash($this->fields));
 }
开发者ID:rbredow,项目名称:allyzabbacart,代码行数:28,代码来源:Cart66MWarrior.php


示例3: login

 public static function login(Cart66Account $account)
 {
     $name = $account->firstName . ' ' . $account->lastName;
     $email = $account->email;
     $externalId = $account->id;
     $organization = Cart66Setting::getValue('zendesk_organization');
     $key = Cart66Setting::getValue('zendesk_token');
     $prefix = Cart66Setting::getValue('zendesk_prefix');
     if (Cart66Setting::getValue('zendesk_jwt')) {
         $now = time();
         $token = array("jti" => md5($now . rand()), "iat" => $now, "name" => $name, "email" => $email);
         include_once CART66_PATH . "/pro/models/JWT.php";
         $jwt = JWT::encode($token, $key);
         // Redirect
         header("Location: https://" . $prefix . ".zendesk.com/access/jwt?jwt=" . $jwt);
         exit;
     } else {
         /* Build the message */
         $ts = isset($_GET['timestamp']) ? $_GET['timestamp'] : time();
         $message = $name . '|' . $email . '|' . $externalId . '|' . $organization . '|||' . $key . '|' . $ts;
         $hash = MD5($message);
         $remoteAuthUrl = 'http://' . $prefix . '.zendesk.com/access/remoteauth/';
         $arguments = array('name' => $name, 'email' => $email, 'external_id' => $externalId, 'organization' => $organization, 'timestamp' => $ts, 'hash' => $hash);
         $url = add_query_arg($arguments, $remoteAuthUrl);
         header("Location: " . $url);
         exit;
     }
 }
开发者ID:rbredow,项目名称:allyzabbacart,代码行数:28,代码来源:ZendeskRemoteAuth.php


示例4: resendEmailFromLog

 public static function resendEmailFromLog($id)
 {
     $resendEmail = false;
     global $wpdb;
     $tableName = Cart66Common::getTableName('email_log');
     $sql = "SELECT * from {$tableName} where id = {$id}";
     $results = $wpdb->get_results($sql);
     if ($results) {
         foreach ($results as $r) {
             $resendEmail = Cart66Notifications::mail($r->to_email, $r->subject, $r->body, $r->headers);
             $email = new Cart66EmailLog();
             $email_data = array('from_email' => $r->from_email, 'from_name' => $r->from_name, 'to_email' => $r->to_email, 'to_name' => $r->to_name, 'head' => array('headers' => $r->headers), 'subject' => $r->subject, 'msg' => $r->body, 'attachments' => $r->attachments, 'order_id' => $r->order_id);
             if (!$resendEmail) {
                 if (Cart66Setting::getValue('log_resent_emails')) {
                     $email->saveEmailLog($email_data, $r->email_type, $r->copy, 'RESEND FAILED');
                 }
             } else {
                 if (Cart66Setting::getValue('log_resent_emails')) {
                     $email->saveEmailLog($email_data, $r->email_type, $r->copy, 'RESEND SUCCESSFUL');
                 }
             }
         }
     }
     return $resendEmail;
 }
开发者ID:rbredow,项目名称:allyzabbacart,代码行数:25,代码来源:Cart66EmailLog.php


示例5: __construct

 public function __construct()
 {
     $setting = new Cart66Setting();
     $this->username = Cart66Setting::getValue('capost_username');
     $this->password = Cart66Setting::getValue('capost_password');
     $this->customer_number = Cart66Setting::getValue('capost_customer_number');
     $this->fromZip = Cart66Setting::getValue('capost_ship_from_zip');
     $this->credentials = 1;
 }
开发者ID:rbredow,项目名称:allyzabbacart,代码行数:9,代码来源:Cart66CaPost.php


示例6: setPayment

 public function setPayment($p)
 {
     $this->_payment = $p;
     $skip = array('email', 'phone', 'custom-field');
     $custom_payment_fields = apply_filters('cart66_after_payment_form', '');
     if (is_array($custom_payment_fields)) {
         foreach ($custom_payment_fields as $key => $payment_field) {
             if (!$payment_field['required']) {
                 $skip[] = $payment_field['slug'];
             }
             if (isset($payment_field['validator']) && $payment_field['validator'] != '') {
                 if (function_exists($payment_field['validator'])) {
                     $skip[] = $payment_field['slug'];
                     $data_to_validate = isset($p[$payment_field['slug']]) ? $p[$payment_field['slug']] : '';
                     $validated = call_user_func($payment_field['validator'], $data_to_validate);
                     if (!$validated['valid']) {
                         foreach ($validated['errors'] as $key => $error) {
                             $this->_errors['Payment ' . $payment_field['slug'] . $key] = $error;
                             $this->_jqErrors[] = 'payment-' . $payment_field['slug'];
                         }
                     }
                 }
             }
         }
     }
     foreach ($p as $key => $value) {
         if (!in_array($key, $skip)) {
             $value = trim($value);
             if ($value == '') {
                 $keyName = ucwords(preg_replace('/([A-Z])/', " \$1", $key));
                 $this->_errors['Payment ' . $keyName] = __('Payment ', 'cart66') . $keyName . __(' required', 'cart66');
                 $this->_jqErrors[] = "payment-{$key}";
             }
         }
     }
     if ($p['email'] == '') {
         $this->_errors['Email address'] = __('Email address is required', 'cart66');
         $this->_jqErrors[] = "payment-email";
     }
     if ($p['phone'] == '') {
         $this->_errors['Phone'] = __('Phone number is required', 'cart66');
         $this->_jqErrors[] = "payment-phone";
     }
     if (!Cart66Common::isValidEmail($p['email'])) {
         $this->_errors['Email'] = __("Email address is not valid", "cart66");
         $this->_jqErrors[] = 'payment-email';
     }
     if (Cart66Setting::getValue('checkout_custom_field_display') == 'required' && $p['custom-field'] == '') {
         $this->_errors['Custom Field'] = Cart66Setting::getValue('checkout_custom_field_error_label') ? Cart66Setting::getValue('checkout_custom_field_error_label') : __('The Special Instructions Field is required', 'cart66');
         $this->_jqErrors[] = 'checkout-custom-field-multi';
         $this->_jqErrors[] = 'checkout-custom-field-single';
     }
 }
开发者ID:rbredow,项目名称:allyzabbacart,代码行数:53,代码来源:Cart66ManualGateway.php


示例7: initCheckout

 public function initCheckout($total)
 {
     $p = $this->getPayment();
     $b = $this->getBilling();
     Cart66Common::log("Payment info for checkout: " . print_r($p, true));
     // Load gateway url from Cart66 settings
     $gatewayUrl = Cart66Setting::getValue('auth_url');
     $this->gateway_url = $gatewayUrl;
     $b['address2'] = $b['address2'] == "" ? null : $b['address2'];
     $cardData = array('number' => $p['cardNumber'], 'exp_month' => $p['cardExpirationMonth'], 'exp_year' => $p['cardExpirationYear'], 'cvc' => $p['securityId'], 'name' => $b['firstName'] . ' ' . $b['lastName'], 'address_line1' => $b['address'], 'address_line2' => $b['address2'], 'address_zip' => $b['zip'], 'address_state' => $b['state'], 'address_country' => $b['country']);
     $this->params = array('card' => $cardData, 'amount' => number_format($total, 2, '', ''), 'currency' => Cart66Setting::getValue('stripe_currency_code') ? Cart66Setting::getValue('stripe_currency_code') : strtolower(Cart66Setting::getValue('currency_code')), 'description' => '');
 }
开发者ID:rbredow,项目名称:allyzabbacart,代码行数:12,代码来源:Cart66Stripe.php


示例8: prepareS3Url

 public static function prepareS3Url($bucket, $file, $duration = '5 minutes')
 {
     $awsKeyId = Cart66Setting::getValue('amazons3_id');
     $awsSecretKey = Cart66Setting::getValue('amazons3_key');
     $file = rawurlencode($file);
     $file = str_replace('%2F', '/', $file);
     $path = $bucket . '/' . $file;
     $expires = strtotime("+ {$duration}", current_time('timestamp', 1));
     $stringToSign = self::getStringToSign('GET', $expires, "/{$path}");
     $signature = self::encodeSignature($stringToSign, $awsSecretKey);
     $url = "http://{$bucket}.s3.amazonaws.com/{$file}";
     $url .= '?AWSAccessKeyId=' . $awsKeyId . '&Expires=' . $expires . '&Signature=' . $signature;
     return $url;
 }
开发者ID:rbredow,项目名称:allyzabbacart,代码行数:14,代码来源:Cart66AmazonS3.php


示例9: getAddToCartImagePath

 /**
  * Return the image path for the add to cart button or false if no path is available
  */
 public static function getAddToCartImagePath($attrs)
 {
     $path = false;
     if (isset($attrs['img'])) {
         // Look for custom image for this instance of the button
         $path = $attrs['img'];
     } else {
         // Look for common images
         $cartImgPath = Cart66Setting::getValue('cart_images_url');
         if ($cartImgPath) {
             $cartImgPath = Cart66Common::endSlashPath($cartImgPath);
             $path = $cartImgPath . 'add-to-cart.png';
         }
     }
     return $path;
 }
开发者ID:rbredow,项目名称:allyzabbacart,代码行数:19,代码来源:Cart66ButtonManager.php


示例10: getRemoteRequestParams

 public static function getRemoteRequestParams()
 {
     $params = false;
     $setting = new Cart66Setting();
     $orderNumber = Cart66Setting::getValue('order_number');
     if (!$orderNumber) {
         Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Order number not available");
     }
     $version = Cart66Setting::getValue('version');
     if (!$version) {
         Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Version number not available");
     }
     if ($orderNumber && $version) {
         global $wpdb;
         $versionName = 'pro';
         $params = sprintf("task=getLatestVersion&pn=Cart66&key=%s&v=%s&vnm=%s&wp=%s&php=%s&mysql=%s&ws=%s", urlencode($orderNumber), urlencode($version), urlencode($versionName), urlencode(get_bloginfo("version")), urlencode(phpversion()), urlencode($wpdb->db_version()), urlencode(get_bloginfo("url")));
     }
     return $params;
 }
开发者ID:rbredow,项目名称:allyzabbacart,代码行数:19,代码来源:Cart66Updater.php


示例11: getRate

 /**
  * Return the monetary value of the shipping rate or false on failure.
  */
 public function getRate($PostalCode, $dest_zip, $dest_country_code, $service, $weight, $length = 0, $width = 0, $height = 0)
 {
     $setting = new Cart66Setting();
     $countryCode = array_shift(explode('~', Cart66Setting::getValue('home_country')));
     $pickupCode = Cart66Setting::getValue('ups_pickup_code') ? Cart66Setting::getValue('ups_pickup_code') : "03";
     $ResidentialAddressIndicator = Cart66Setting::getValue('ups_only_ship_commercial') ? "" : "\n    <ResidentialAddressIndicator/>";
     if ($this->credentials != 1) {
         print 'Please set your credentials with the setCredentials function';
         die;
     }
     $data = "<?xml version=\"1.0\"?>  \n      <AccessRequest xml:lang=\"en-US\">  \n        <AccessLicenseNumber>" . urlencode(trim($this->AccessLicenseNumber)) . "</AccessLicenseNumber>  \n        <UserId>" . urlencode($this->UserID) . "</UserId>  \n        <Password>" . urlencode($this->Password) . "</Password>  \n      </AccessRequest>  \n      <?xml version=\"1.0\"?>  \n      <RatingServiceSelectionRequest xml:lang=\"en-US\">  \n        <Request>  \n          <TransactionReference>  \n            <CustomerContext>Rating and Service</CustomerContext>  \n            <XpciVersion>1.0001</XpciVersion>  \n          </TransactionReference>  \n          <RequestAction>Rate</RequestAction>  \n          <RequestOption>Rate</RequestOption>  \n        </Request>  \n        <PickupType>  \n          <Code>{$pickupCode}</Code>  \n        </PickupType>  \n        <Shipment>  \n          <Shipper>  \n            <Address>  \n            <PostalCode>{$PostalCode}</PostalCode>  \n            <CountryCode>{$countryCode}</CountryCode>  \n            </Address>  \n            <ShipperNumber>{$this->shipperNumber}</ShipperNumber>  \n          </Shipper>  \n          <ShipTo>  \n            <Address>  \n            <PostalCode>{$dest_zip}</PostalCode>  \n            <CountryCode>{$dest_country_code}</CountryCode>{$ResidentialAddressIndicator}  \n            </Address>  \n          </ShipTo>  \n          <ShipFrom>  \n            <Address>  \n            <PostalCode>{$PostalCode}</PostalCode>  \n            <CountryCode>{$countryCode}</CountryCode>  \n            </Address>  \n          </ShipFrom>  \n          <Service>  \n            <Code>{$service}</Code>  \n          </Service>  \n          <Package>  \n            <PackagingType>  \n            <Code>02</Code>  \n            </PackagingType>  \n            <Dimensions>  \n              <UnitOfMeasurement>  \n                <Code>{$this->dimensionsUnits}</Code>  \n              </UnitOfMeasurement>  \n              <Length>{$length}</Length>  \n              <Width>{$width}</Width>  \n              <Height>{$height}</Height>  \n            </Dimensions>  \n            <PackageWeight>  \n              <UnitOfMeasurement>  \n                <Code>{$this->weightUnits}</Code>  \n              </UnitOfMeasurement>  \n              <Weight>{$weight}</Weight>  \n            </PackageWeight>  \n          </Package>  \n      </Shipment>  \n      </RatingServiceSelectionRequest>";
     $ch = curl_init("https://onlinetools.ups.com/ups.app/xml/Rate");
     curl_setopt($ch, CURLOPT_HEADER, 1);
     curl_setopt($ch, CURLOPT_POST, 1);
     curl_setopt($ch, CURLOPT_TIMEOUT, 60);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
     curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
     curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
     $result = curl_exec($ch);
     $xml = substr($result, strpos($result, '<RatingServiceSelectionResponse'));
     Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] UPS XML REQUEST: \n{$data}");
     Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] UPS XML RESULT: \n{$xml}");
     try {
         $xml = new SimpleXmlElement($xml);
     } catch (Exception $e) {
         Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Cart66 Exception caught when trying to get UPS XML Response: " . $e->getMessage() . " \n");
         $rate = false;
     }
     $responseDescription = $xml->Response->ResponseStatusDescription;
     $errorDescription = $xml->Response->Error->ErrorDescription;
     // Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Response Description: (Service: $service) $responseDescription $errorDescription");
     if ($responseDescription == "Failure") {
         $rate = false;
     } else {
         //$rate = $xml->RatedShipment->RatedPackage->TotalCharges->MonetaryValue;
         $rate = $xml->RatedShipment->TotalCharges->MonetaryValue;
     }
     Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] RATE ===> {$rate}");
     return $rate;
 }
开发者ID:rbredow,项目名称:allyzabbacart,代码行数:44,代码来源:Cart66Ups.php


示例12: getCreditCardTypes

 /**
  * Return an array of accepted credit card types where the keys are the diplay values and the values are the gateway values
  * 
  * @return array
  */
 public function getCreditCardTypes()
 {
     $cardTypes = array();
     $setting = new Cart66Setting();
     $cards = Cart66Setting::getValue('auth_card_types');
     if ($cards) {
         $cards = explode('~', $cards);
         if (in_array('mastercard', $cards)) {
             $cardTypes['MasterCard'] = 'mastercard';
         }
         if (in_array('visa', $cards)) {
             $cardTypes['Visa'] = 'visa';
         }
         if (in_array('amex', $cards)) {
             $cardTypes['American Express'] = 'amex';
         }
         if (in_array('discover', $cards)) {
             $cardTypes['Discover'] = 'discover';
         }
     }
     return $cardTypes;
 }
开发者ID:rbredow,项目名称:allyzabbacart,代码行数:27,代码来源:Cart66PayLeap.php


示例13: SetExpressCheckout

 public function SetExpressCheckout()
 {
     $this->_requestFields = array('METHOD' => 'SetExpressCheckout', 'PAYMENTACTION' => 'Sale');
     if (!Cart66Setting::getValue('disable_landing_page')) {
         $this->_requestFields['LANDINGPAGE'] = 'Billing';
     }
     if (Cart66Setting::getValue('express_force_paypal')) {
         $this->_requestFields['SOLUTIONTYPE'] = 'Sole';
     }
     $nvp = $this->_buildNvpStr();
     Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Set Express Checkout Request NVP: " . str_replace('&', "\n", $nvp));
     $result = $this->_decodeNvp($this->_sendRequest($this->_apiEndPoint, $nvp));
     Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] SetExpressCheckout result: " . print_r($result, true));
     return $result;
 }
开发者ID:rbredow,项目名称:allyzabbacart,代码行数:15,代码来源:Cart66PayPalExpressCheckout.php


示例14: trim

<?php

$url = trim($url);
$saleAmt = $order->subtotal - $order->discount_amount;
$saleAmt = number_format($saleAmt, 2, '.', '');
$url = str_replace('idev_saleamt=XXX', 'idev_saleamt=' . $saleAmt, $url);
$url = str_replace('idev_ordernum=XXX', 'idev_ordernum=' . $order->trans_id, $url);
$ip = $_SERVER['REMOTE_ADDR'];
if ($order->ip != '') {
    $ip = $order->ip;
}
Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] order ip: {$ip}");
$url .= '&ip_address=' . $ip;
$promotionCode = Cart66Session::get('Cart66PromotionCode');
if (Cart66Setting::getValue('idev_coupon_codes') && $promotionCode) {
    $url .= '&coupon_code=' . $promotionCode;
}
Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Commission notification sent to: {$url}");
Cart66Common::curl($url);
开发者ID:rbredow,项目名称:allyzabbacart,代码行数:19,代码来源:idevaffiliate-award.php


示例15: getUpsServices

 public static function getUpsServices()
 {
     $usaServices = array('UPS Next Day Air' => '01', 'UPS Second Day Air' => '02', 'UPS Ground' => '03', 'UPS Worldwide Express' => '07', 'UPS Worldwide Expedited' => '08', 'UPS Standard' => '11', 'UPS Three-Day Select' => '12', 'UPS Next Day Air Early A.M.' => '14', 'UPS Worldwide Express Plus' => '54', 'UPS Second Day Air A.M.' => '59', 'UPS Saver' => '65');
     $internationalServices = array('UPS Express' => '01', 'UPS Expedited' => '02', 'UPS Worldwide Express' => '07', 'UPS Worldwide Expedited' => '08', 'UPS Standard' => '11', 'UPS Three-Day Select' => '12', 'UPS Saver' => '13', 'UPS Express Early A.M.' => '14', 'UPS Worldwide Express Plus' => '54', 'UPS Saver' => '65');
     $homeCountryCode = 'US';
     $setting = new Cart66Setting();
     $home = Cart66Setting::getValue('home_country');
     if ($home) {
         list($homeCountryCode, $name) = explode('~', $home);
     }
     $services = $homeCountryCode == 'US' ? $usaServices : $internationalServices;
     return $services;
 }
开发者ID:rbredow,项目名称:allyzabbacart,代码行数:13,代码来源:Cart66ProCommon.php


示例16: toggleLifeTime

      $('#product-lifetime_membership').click(function() {
        toggleLifeTime();
      });

      $('#viewLocalDeliverInfo').click(function() {
        $('#localDeliveryInfo').toggle();
        return false;
      });

      $('#amazons3ForceDownload').click(function() {
        $('#amazons3ForceDownloadAnswer').toggle();
        return false;
      });

      <?php 
if (Cart66Setting::getValue('amazons3_id')) {
    ?>
      validateS3BucketName();  
      <?php 
}
?>
      $("#product-s3_bucket, #product-s3_file").blur(function(){
         validateS3BucketName();        
      })
    })
    $(document).on('click', '.delete', function(e) {
      return confirm('Are you sure you want to delete this item?');
    });
    function toggleLifeTime() {
      if($('#product-lifetime_membership').is(':checked')) {
        $('#product-billing_interval').val('');
开发者ID:arraysoftlab,项目名称:tracy-thedarkroom.com,代码行数:31,代码来源:products.php


示例17: dailyPrunePendingPayPalOrders

 public function dailyPrunePendingPayPalOrders()
 {
     Cart66Setting::setValue('daily_prune_pending_orders_last_checked', Cart66Common::localTs());
     $o = new Cart66Order();
     $dayStart = date('Y-m-d 00:00:00', strtotime('48 hours ago', Cart66Common::localTs()));
     $dayEnd = date('Y-m-d 00:00:00', strtotime('24 hours ago', Cart66Common::localTs()));
     $orders = $o->getOrderRows("WHERE status in ('paypal_pending','checkout_pending') AND ordered_on >= '{$dayStart}' AND ordered_on < '{$dayEnd}'");
     foreach ($orders as $order) {
         Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] yes, i am to delete an order or more: " . $order->id);
         $o->load($order->id);
         $o->deleteMe(true, true);
     }
 }
开发者ID:rbredow,项目名称:allyzabbacart,代码行数:13,代码来源:Cart66Order.php


示例18: explode

    }
}
if (isset($_REQUEST['newsletter'])) {
    if ($_REQUEST['newsletter'] == 1) {
        ?>
  <form action="" method='post' id="newsletter_form" class="phorm2">
    <?php 
        if ($lists) {
            ?>
      <ul id="<?php 
            echo $service_name;
            ?>
">
        <li>
          <?php 
            if (!($optInMessage = Cart66Setting::getValue($service_name . '_opt_in_message'))) {
                $optInMessage = 'Yes, I would like to subscribe to:';
            }
            echo "<p>{$optInMessage}</p>";
            $lists = explode('~', $lists);
            echo '<ul class="Cart66NewsletterList">';
            foreach ($lists as $list) {
                list($id, $name) = explode('::', $list);
                echo "<li><input class=\"Cart66CheckboxList\" type=\"checkbox\" name=\"" . $service_name . "_subscribe_ids[]\" value=\"{$id}\" /> {$name}</li>";
            }
            echo '</ul>';
            ?>
        </li>
      </ul>
    <?php 
        }
开发者ID:rbredow,项目名称:allyzabbacart,代码行数:31,代码来源:newsletter-signup.php


示例19: define

<?php

global $wpdb;
if (!defined('ABSPATH') && !defined('WP_UNINSTALL_PLUGIN')) {
    exit;
}
define("CART66_PATH", plugin_dir_path(__FILE__));
// e.g. /var/www/example.com/wordpress/wp-content/plugins/cart66
require_once CART66_PATH . "/models/Cart66Common.php";
require_once CART66_PATH . "/models/Cart66Setting.php";
if (Cart66Setting::getValue('uninstall_db')) {
    global $wpdb;
    $prefix = $wpdb->prefix . "cart66_";
    $sqlFile = dirname(__FILE__) . "/sql/uninstall.sql";
    $sql = str_replace('[prefix]', $prefix, file_get_contents($sqlFile));
    $queries = explode(";\n", $sql);
    foreach ($queries as $sql) {
        if (strlen($sql) > 5) {
            $wpdb->query($sql);
        }
    }
}
开发者ID:rbredow,项目名称:allyzabbacart,代码行数:22,代码来源:uninstall.php


示例20: initCheckout

 public function initCheckout($total)
 {
     Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] PayPal Pro Checkout init total: {$total}");
     $this->setCreditCardData();
     $this->setPayerInfo();
     $this->setPayerName();
     $this->setAddress();
     $this->setShipToAddress();
     // Calculate tax
     $tax = $this->getTaxAmount();
     // Calculate total cost of all items in cart, not including tax and shipping
     $itemSubTotal = Cart66Session::get('Cart66Cart')->getSubTotal() - Cart66Session::get('Cart66Cart')->getDiscountAmount() - Cart66Session::get('Cart66Cart')->getSubscriptionAmount();
     $itemTotal = number_format($itemSubTotal, 2, '.', '');
     $itemTotal = $itemTotal < 0 ? 0 : $itemTotal;
     // Calculate shipping costs
     $shipping = Cart66Session::get('Cart66Cart')->getShippingCost();
     // Set payment information
     // 'NOTIFYURL' => $ipnUrl
     $currencyCode = Cart66Setting::getValue('currency_code');
     if ($currencyCode == false) {
         $currencyCode = 'USD';
     }
     $payment = array('AMT' => $total, 'ITEMAMT' => $itemTotal, 'SHIPPINGAMT' => $shipping, 'TAXAMT' => $tax, 'CURRENCYCODE' => $currencyCode, 'BUTTONSOURCE' => 'Reality66_SP');
     // Add cart items to PayPal
     $items = Cart66Session::get('Cart66Cart')->getItems();
     // An array of Cart66CartItem objects
     foreach ($items as $i) {
         if ($i->isSpreedlySubscription()) {
             $amount = $i->getBaseProductPrice();
         } else {
             $amount = $i->getProductPrice();
         }
         $itemData = array('NAME' => $i->getFullDisplayName(), 'AMT' => $amount, 'NUMBER' => $i->getItemNumber(), 'QTY' => $i->getQuantity());
         $this->addItem($itemData);
     }
     // Add a coupon discount if needed
     $discount = Cart66Session::get('Cart66Cart')->getDiscountAmount();
     if ($discount > 0) {
         $negDiscount = 0 - $discount;
         $itemData = array('NAME' => 'Discount', 'AMT' => $negDiscount, 'NUMBER' => 'DSC', 'QTY' => 1);
         $this->addItem($itemData);
     }
     // Store the shipping price as an "item" if the item total is $0.00. Otherwise paypal will not accept the transaction.
     if ($payment['ITEMAMT'] == 0 && $payment['SHIPPINGAMT'] > 0) {
         $payment['ITEMAMT'] = $payment['SHIPPINGAMT'] + ($itemSubTotal < 0 ? $itemSubTotal : 0);
         $itemData = array('NAME' => 'Shipping', 'AMT' => $payment['SHIPPINGAMT'], 'NUMBER' => 'SHIPPING', 'QTY' => 1);
         $this->addItem($itemData);
         $payment['SHIPPINGAMT'] = 0;
     }
     $this->setPaymentDetails($payment);
 }
开发者ID:rbredow,项目名称:allyzabbacart,代码行数:51,代码来源:Cart66PayPalPro.php



注:本文中的Cart66Setting类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CartRule类代码示例发布时间:2022-05-20
下一篇:
PHP Cart66Common类代码示例发布时间:2022-05-20
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap