当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Sales_Model_Order::getCustomerDob方法代码示例

本文整理汇总了PHP中Mage_Sales_Model_Order::getCustomerDob方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Order::getCustomerDob方法的具体用法?PHP Mage_Sales_Model_Order::getCustomerDob怎么用?PHP Mage_Sales_Model_Order::getCustomerDob使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Sales_Model_Order的用法示例。


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

示例1: getNameData

 /**
  * Retrieve name data
  *
  * @param Mage_Sales_Model_Order $order
  * @return array
  */
 public function getNameData(Mage_Sales_Model_Order $order)
 {
     $dob = '';
     if (!is_null($order->getCustomerDob())) {
         $dob = new Zend_Date($order->getCustomerDob());
         $dob = $dob->toString("yyyy-MM-dd");
     }
     $data = array('first_name' => $order->getBillingAddress()->getFirstname(), 'last_name' => $order->getBillingAddress()->getLastname(), 'sex' => $this->getGender($order), 'dob' => $dob, 'company' => $order->getBillingAddress()->getCompany(), 'salutation' => $this->getPrefix($order));
     return $data;
 }
开发者ID:Aya-Mousa,项目名称:HyperpayMagentoo,代码行数:16,代码来源:Data.php

示例2: _prepareCustomerData

 /**
  * @return array
  */
 protected function _prepareCustomerData()
 {
     $customer_id = null;
     $customer = null;
     $customer_log = null;
     $billing_address = $this->_order->getBillingAddress();
     $customer_verified = false;
     $customer_orders_count = 0;
     $gender = $this->_order->getCustomerGender();
     if (!$this->_order->getCustomerIsGuest()) {
         $customer_id = $this->_order->getCustomerId();
         if ($customer_id) {
             /** @var Mage_Customer_Model_Customer $customer */
             $customer = Mage::getModel("customer/customer");
             $customer->load($customer_id);
             /** @var Mage_Log_Model_Customer $customer_log */
             $customer_log = Mage::getModel('log/customer')->load($customer_id);
         }
         $customer_verified = $this->getCustomerIsConfirmedStatus($customer);
         $orders = Mage::getModel('sales/order')->getCollection()->addFieldToFilter('customer_id', $customer_id);
         /** @noinspection PhpUndefinedMethodInspection */
         $customer_orders_count = $orders->count();
     }
     $data = array_filter(array('customer_id' => $customer_id, 'customer_is_guest' => $this->_order->getCustomerIsGuest(), 'verified' => $customer_verified, 'language_code' => $this->_language_code, 'last_login_on' => $customer_log ? $customer_log->getLoginAt() : null, 'created_on' => $customer ? $customer->getData('created_at') : null, 'updated_on' => $customer ? $customer->getData('updated_at') : null, 'birthdate' => $this->_order->getCustomerDob(), 'email' => $this->_order->getCustomerEmail(), 'title' => '', 'prefix' => $this->_order->getCustomerPrefix(), 'suffix' => $this->_order->getCustomerSuffix(), 'first_name' => $this->_order->getCustomerFirstname(), 'middle_name' => $this->_order->getCustomerMiddlename(), 'last_name' => $this->_order->getCustomerLastname(), 'company_name' => $billing_address ? $billing_address->getCompany() : null, 'gender' => $gender == 1 ? 'male' : ($gender == 2 ? 'female' : null), 'telephone1' => $billing_address ? $billing_address->getTelephone() : null, 'telephone2' => '', 'telephone3' => '', 'fax' => $billing_address ? $billing_address->getFax() : null, 'vat_number' => $this->_order->getCustomerTaxvat(), 'reg_ip_address' => '', 'customer_orders_count' => $customer_orders_count));
     return $data;
 }
开发者ID:payin7-payments,项目名称:payin7-magento,代码行数:29,代码来源:Submit.php

示例3: getDob

 /**
  * Gets the Day of Birth from the Quote or Order if guest, else from the customer
  *
  * @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order $quote
  * @return String
  */
 public function getDob($quote)
 {
     return $quote->getCustomerDob();
 }
开发者ID:ratepay,项目名称:magento-module,代码行数:10,代码来源:Data.php

示例4: CreateMagentoShopRequestOrder

 function CreateMagentoShopRequestOrder(Mage_Sales_Model_Order $order, $paymentmethod)
 {
     $request = new Byjuno_Cdp_Helper_Api_Classes_ByjunoRequest();
     $request->setClientId(Mage::getStoreConfig('payment/cdp/clientid', Mage::app()->getStore()));
     $request->setUserID(Mage::getStoreConfig('payment/cdp/userid', Mage::app()->getStore()));
     $request->setPassword(Mage::getStoreConfig('payment/cdp/password', Mage::app()->getStore()));
     $request->setVersion("1.00");
     try {
         $request->setRequestEmail(Mage::getStoreConfig('payment/cdp/mail', Mage::app()->getStore()));
     } catch (Exception $e) {
     }
     $b = $order->getCustomerDob();
     if (!empty($b)) {
         $request->setDateOfBirth(Mage::getModel('core/date')->date('Y-m-d', strtotime($b)));
     }
     $g = $order->getCustomerGender();
     if (!empty($g)) {
         if ($g == '1') {
             $request->setGender('1');
         } else {
             if ($g == '2') {
                 $request->setGender('2');
             }
         }
     }
     $requestId = uniqid((string) $order->getBillingAddress()->getId() . "_");
     $request->setRequestId($requestId);
     $reference = $order->getCustomerId();
     if (empty($reference)) {
         $request->setCustomerReference("guest_" . $order->getBillingAddress()->getId());
     } else {
         $request->setCustomerReference($order->getCustomerId());
     }
     $request->setFirstName((string) $order->getBillingAddress()->getFirstname());
     $request->setLastName((string) $order->getBillingAddress()->getLastname());
     $request->setFirstLine(trim((string) $order->getBillingAddress()->getStreetFull()));
     $request->setCountryCode(strtoupper((string) $order->getBillingAddress()->getCountry()));
     $request->setPostCode((string) $order->getBillingAddress()->getPostcode());
     $request->setTown((string) $order->getBillingAddress()->getCity());
     $request->setFax((string) trim($order->getBillingAddress()->getFax(), '-'));
     $request->setLanguage((string) substr(Mage::app()->getLocale()->getLocaleCode(), 0, 2));
     if ($order->getBillingAddress()->getCompany()) {
         $request->setCompanyName1($order->getBillingAddress()->getCompany());
     }
     $request->setTelephonePrivate((string) trim($order->getBillingAddress()->getTelephone(), '-'));
     $request->setEmail((string) $order->getBillingAddress()->getEmail());
     $extraInfo["Name"] = 'ORDERCLOSED';
     $extraInfo["Value"] = 'NO';
     $request->setExtraInfo($extraInfo);
     $extraInfo["Name"] = 'ORDERAMOUNT';
     $extraInfo["Value"] = number_format($order->getGrandTotal(), 2, '.', '');
     $request->setExtraInfo($extraInfo);
     $extraInfo["Name"] = 'ORDERCURRENCY';
     $extraInfo["Value"] = $order->getBaseCurrencyCode();
     $request->setExtraInfo($extraInfo);
     /* shipping information */
     if ($order->canShip()) {
         $extraInfo["Name"] = 'DELIVERY_FIRSTNAME';
         $extraInfo["Value"] = $order->getShippingAddress()->getFirstname();
         $request->setExtraInfo($extraInfo);
         $extraInfo["Name"] = 'DELIVERY_LASTNAME';
         $extraInfo["Value"] = $order->getShippingAddress()->getLastname();
         $request->setExtraInfo($extraInfo);
         $extraInfo["Name"] = 'DELIVERY_FIRSTLINE';
         $extraInfo["Value"] = trim($order->getShippingAddress()->getStreetFull());
         $request->setExtraInfo($extraInfo);
         $extraInfo["Name"] = 'DELIVERY_HOUSENUMBER';
         $extraInfo["Value"] = '';
         $request->setExtraInfo($extraInfo);
         $extraInfo["Name"] = 'DELIVERY_COUNTRYCODE';
         $extraInfo["Value"] = strtoupper($order->getShippingAddress()->getCountry());
         $request->setExtraInfo($extraInfo);
         $extraInfo["Name"] = 'DELIVERY_POSTCODE';
         $extraInfo["Value"] = $order->getShippingAddress()->getPostcode();
         $request->setExtraInfo($extraInfo);
         $extraInfo["Name"] = 'DELIVERY_TOWN';
         $extraInfo["Value"] = $order->getShippingAddress()->getCity();
         $request->setExtraInfo($extraInfo);
         if ($order->getShippingAddress()->getCompany() != '' && Mage::getStoreConfig('payment/api/businesstobusiness', Mage::app()->getStore()) == 'enable') {
             $extraInfo["Name"] = 'DELIVERY_COMPANYNAME';
             $extraInfo["Value"] = $order->getShippingAddress()->getCompany();
             $request->setExtraInfo($extraInfo);
         }
     }
     $extraInfo["Name"] = 'PP_TRANSACTION_NUMBER';
     $extraInfo["Value"] = $requestId;
     $request->setExtraInfo($extraInfo);
     $extraInfo["Name"] = 'ORDERID';
     $extraInfo["Value"] = $order->getIncrementId();
     $request->setExtraInfo($extraInfo);
     $extraInfo["Name"] = 'PAYMENTMETHOD';
     $extraInfo["Value"] = 'BYJUNO-INVOICE';
     $request->setExtraInfo($extraInfo);
     $extraInfo["Name"] = 'CONNECTIVTY_MODULE';
     $extraInfo["Value"] = 'Byjuno Magento module 1.0.0';
     $request->setExtraInfo($extraInfo);
     return $request;
 }
开发者ID:istgin,项目名称:Byjuno,代码行数:98,代码来源:Data.php

示例5: getRequestCustomer

 /**
  * Gets all needed Informations for customer Block of the Request
  *
  * @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order $quoteOrOrder
  * @return array
  */
 public function getRequestCustomer($quoteOrOrder)
 {
     $customer = array();
     $contacts = array();
     $billing = array();
     $shipping = array();
     $dob = new Zend_Date($quoteOrOrder->getCustomerDob());
     $customer['dob'] = $dob->toString("yyyy-MM-dd");
     $customer['gender'] = $this->getHelper()->getGenderCode($quoteOrOrder);
     $customer['firstName'] = $quoteOrOrder->getBillingAddress()->getFirstname();
     $customer['lastName'] = $quoteOrOrder->getBillingAddress()->getLastname();
     $customer['ip'] = Mage::helper('core/http')->getRemoteAddr(false);
     $customer['nationality'] = $quoteOrOrder->getBillingAddress()->getCountryId();
     $customer['company'] = $quoteOrOrder->getBillingAddress()->getCompany();
     $customer['vatId'] = $quoteOrOrder->getCustomerTaxvat();
     $contacts['email'] = $quoteOrOrder->getCustomerEmail();
     $contacts['phone'] = $quoteOrOrder->getBillingAddress()->getTelephone();
     if ($quoteOrOrder->getBillingAddress()->getFax() != '') {
         $contacts['fax'] = $quoteOrOrder->getBillingAddress()->getFax();
     }
     // Different handling of street fields in case of NL orders
     $billingStreetFull = $quoteOrOrder->getBillingAddress()->getStreetFull();
     $billingStreet1 = $quoteOrOrder->getBillingAddress()->getStreet1();
     $billingStreet2 = $quoteOrOrder->getBillingAddress()->getStreet2();
     if ($quoteOrOrder->getBillingAddress()->getCountryId() == "NL" && !empty($billingStreet2)) {
         $billing['street'] = $billingStreet1;
         $billing['streetAdditional'] = $billingStreet2;
     } else {
         $billing['street'] = preg_replace('~[\\r\\n]+~', ' ', $billingStreetFull);
     }
     $billing['zipCode'] = $quoteOrOrder->getBillingAddress()->getPostcode();
     $billing['city'] = $quoteOrOrder->getBillingAddress()->getCity();
     $billing['countryId'] = $quoteOrOrder->getBillingAddress()->getCountryId();
     $shipping['firstName'] = $quoteOrOrder->getShippingAddress()->getFirstname();
     $shipping['lastName'] = $quoteOrOrder->getShippingAddress()->getLastname();
     // Different handling of street fields in case of NL orders
     $shippingStreetFull = $quoteOrOrder->getShippingAddress()->getStreetFull();
     $shippingStreet1 = $quoteOrOrder->getShippingAddress()->getStreet1();
     $shippingStreet2 = $quoteOrOrder->getShippingAddress()->getStreet2();
     if ($quoteOrOrder->getShippingAddress()->getCountryId() == "NL" && !empty($shippingStreet2)) {
         $shipping['street'] = $shippingStreet1;
         $shipping['streetAdditional'] = $shippingStreet2;
     } else {
         $shipping['street'] = preg_replace('~[\\r\\n]+~', ' ', $shippingStreetFull);
     }
     $shipping['zipCode'] = $quoteOrOrder->getShippingAddress()->getPostcode();
     $shipping['city'] = $quoteOrOrder->getShippingAddress()->getCity();
     $shipping['countryId'] = $quoteOrOrder->getShippingAddress()->getCountryId();
     if ($quoteOrOrder->getShippingAddress()->getCompany()) {
         $shipping['company'] = $quoteOrOrder->getShippingAddress()->getCompany();
     }
     $customer['contacts'] = $contacts;
     $customer['billing'] = $billing;
     $customer['shipping'] = $shipping;
     return $customer;
 }
开发者ID:ratepay,项目名称:magento-module,代码行数:62,代码来源:Mapping.php


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