當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ShopFunctions::getStateIDByName方法代碼示例

本文整理匯總了PHP中ShopFunctions::getStateIDByName方法的典型用法代碼示例。如果您正苦於以下問題:PHP ShopFunctions::getStateIDByName方法的具體用法?PHP ShopFunctions::getStateIDByName怎麽用?PHP ShopFunctions::getStateIDByName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ShopFunctions的用法示例。


在下文中一共展示了ShopFunctions::getStateIDByName方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: storeAddresses

 function storeAddresses()
 {
     $this->cart = VirtueMartCart::getCart();
     $addressST = $addressBT = array();
     if ($this->response['SHIPTONAME'] == $this->response['FIRSTNAME'] . ' ' . $this->response['LASTNAME']) {
         $firstName = $this->response['FIRSTNAME'];
         $lastName = $this->response['LASTNAME'];
     } else {
         $shipToName = explode(' ', $this->response['SHIPTONAME']);
         $firstName = $shipToName[0];
         $lastName = '';
         if (count($shipToName) > 1) {
             $lastName = str_replace($firstName . ' ', '', $this->response['SHIPTONAME']);
         }
     }
     $usersModel = VmModel::getModel('user');
     $validateUserData = $usersModel->validateUserData($this->cart->BT, 'BT');
     if ($validateUserData !== true) {
         $addressBT['email'] = $this->response['EMAIL'];
         $addressBT['first_name'] = $firstName;
         $addressBT['last_name'] = $lastName;
         $addressBT['address_1'] = $this->response['SHIPTOSTREET'];
         $addressBT['city'] = $this->response['SHIPTOCITY'];
         $addressBT['zip'] = $this->response['SHIPTOZIP'];
         $addressBT['virtuemart_state_id'] = ShopFunctions::getStateIDByName($this->response['SHIPTOSTATE']);
         $addressBT['virtuemart_country_id'] = ShopFunctions::getCountryIDByName($this->response['SHIPTOCOUNTRYCODE']);
         $this->cart->saveAddressInCart($addressBT, 'BT', true);
     }
     $addressST['shipto_address_type_name'] = 'PayPal Account';
     $addressST['shipto_first_name'] = $firstName;
     $addressST['shipto_last_name'] = $lastName;
     $addressST['shipto_address_1'] = $this->response['SHIPTOSTREET'];
     $addressST['shipto_city'] = $this->response['SHIPTOCITY'];
     $addressST['shipto_zip'] = $this->response['SHIPTOZIP'];
     $addressST['shipto_virtuemart_state_id'] = ShopFunctions::getStateIDByName($this->response['SHIPTOSTATE']);
     $addressST['shipto_virtuemart_country_id'] = ShopFunctions::getCountryIDByName($this->response['SHIPTOCOUNTRYCODE']);
     $this->cart->STsameAsBT = 0;
     $this->cart->setCartIntoSession();
     $this->cart->saveAddressInCart($addressST, 'ST', true);
 }
開發者ID:spiridonov-oa,項目名稱:SheinCandles,代碼行數:40,代碼來源:paypalexp.php

示例2: display


//.........這裏部分代碼省略.........
                 $adminIdUser = JFactory::getUser($this->adminID);
                 if ($adminIdUser->authorise('core.admin', 'com_virtuemart') or $adminIdUser->authorise('vm.user', 'com_virtuemart')) {
                     $this->allowChangeShopper = true;
                 }
             }
         }
     }
     if ($this->allowChangeShopper) {
         $this->userList = $this->getUserList();
     }
     $task = $input->getString("vmtask");
     if (file_exists(dirname(__FILE__) . "/" . $task . ".php")) {
         require_once dirname(__FILE__) . "/" . $task . ".php";
     }
     if ($task == "completecheckout") {
         require_once dirname(__FILE__) . "/updatecartaddress.php";
         $checkout = $cart->checkoutData(false);
         $app = JFactory::getApplication();
         $messageQueue = $app->getMessageQueue();
         $return_error = "";
         if (count($messageQueue) > 0) {
             foreach ($messageQueue as $message) {
                 $return_error .= $message['message'];
             }
         }
         $returnarray = array();
         if ($checkout) {
             $returnarray["success"] = 1;
         } else {
             $returnarray["success"] = 0;
         }
         $returnarray['message'] = $return_error;
         echo json_encode($returnarray);
         exit;
     }
     if ($task == "ajaxshipment") {
         $this->lSelectShipment();
         echo json_encode($this->shipments_shipment_rates);
         exit;
     }
     if ($task == "ajaxpayment") {
         $this->lSelectPayment();
         echo json_encode($this->paymentplugins_payments);
         exit;
     }
     if ($task == "setsession") {
         $payid = JRequest::getVar("payid", 0);
         if ($payid > 0) {
             $cart->setPaymentMethod(false, false, $payid);
             $cart->setCartIntoSession();
         }
         echo "success";
         exit;
     }
     if ($task == "klarnaupdate") {
         $post = JRequest::get("post");
         $address = array();
         $address['shipto_address_type_name'] = 'ST';
         if (!empty($post['given_name'])) {
             $address['shipto_first_name'] = $post['given_name'];
         }
         if (!empty($post['family_name'])) {
             $address['shipto_last_name'] = $post['family_name'];
         }
         if (!empty($post['street_address'])) {
             $address['shipto_address_1'] = $post['street_address'];
         }
         if (!empty($post['street_address2'])) {
             $address['shipto_address_2'] = $post['street_address2'];
         }
         if (!empty($post['postal_code'])) {
             $address['shipto_zip'] = $post['postal_code'];
         }
         if (!empty($post['city'])) {
             $address['shipto_city'] = $post['city'];
         }
         if (!empty($post['country'])) {
             $address['shipto_virtuemart_country_id'] = ShopFunctions::getCountryIDByName($post['country']);
         } else {
             if (!empty($cart->BT['virtuemart_country_id'])) {
                 $address['shipto_virtuemart_country_id'] = $cart->BT['virtuemart_country_id'];
             }
         }
         if (!empty($post['region'])) {
             $address['shipto_virtuemart_state_id'] = ShopFunctions::getStateIDByName($post['region']);
         }
         if (!empty($post['phone'])) {
             $address['shipto_phone_1'] = $post['phone'];
         }
         $address['tos'] = 1;
         $cart->saveAddressInCart($address, 'ST', true, 'shipto_');
         $cart->setCartIntoSession(false, true);
         $return = array();
         $return['response'] = "success";
         echo json_encode($return);
         exit;
     }
     $cart->setCartIntoSession();
     parent::display($tpl);
 }
開發者ID:spk063,項目名稱:vmonepage,代碼行數:101,代碼來源:view.html.php


注:本文中的ShopFunctions::getStateIDByName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。