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


PHP Mage_Customer_Model_Customer::getDefaultBilling方法代码示例

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


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

示例1: paytraceCustomer

 /**
  * EITHER CREATE OR UPDATE THE CUSTOMER
  * 
  * TO CREATE
  * http://help.paytrace.com/api-create-customer-profile
  * 
  * TO UPDATE
  * http://help.paytrace.com/api-update-customer-profile
  * 
  * TO DELETE
  * if $card is empty then we delete the card from paytrace
  * 
  * @param Mage_Customer_Model_Customer $customer
  */
 public function paytraceCustomer(Mage_Customer_Model_Customer $customer, Widgetized_Level3_Model_Card $card = null)
 {
     $defaults = array('UN' => $this->getConfigData('login'), 'PSWD' => $this->getConfigData('trans_key'), 'TERMS' => 'Y', 'METHOD' => 'CreateCustomer', 'CUSTID' => $customer->getId(), 'BNAME' => $customer->getFirstname() . ' ' . $customer->getLastname(), 'CC' => '', 'EXPMNTH' => '', 'EXPYR' => '');
     $addressId = $customer->getDefaultBilling();
     $billing = Mage::getModel('sales/order_address')->load($addressId);
     if ($billing) {
         $defaults['BADDRESS'] = $billing->getPostcode();
         $defaults['BCITY'] = $billing->getCity();
         $defaults['BSTATE'] = $billing->getRegion();
         $defaults['BZIP'] = $billing->getPostcode();
         $defaults['BCOUNTRY'] = $billing->getCountryId();
     }
     if ($card) {
         $defaults['CC'] = $card->getNumber();
         $defaults['EXPMNTH'] = $card->getMonth();
         $defaults['EXPYR'] = $card->getYear();
     }
     try {
         $result = $this->call(array_keys($defaults), $defaults);
     } catch (Exception $ex) {
         $message = $this->__($ex->getMessage());
         if ($card) {
             $card->setToken($message);
             $card->save();
         }
     }
 }
开发者ID:Jonathonbyrd,项目名称:Optimized-Magento-1.9.x,代码行数:41,代码来源:Paytrace.php

示例2: _getAddresses

 /**
  * @param Mage_Customer_Model_Customer $customer
  * @return array|null
  */
 protected function _getAddresses(Mage_Customer_Model_Customer $customer)
 {
     $addrData = array();
     $addresses = $customer->getAddresses();
     if (!empty($addresses)) {
         foreach ($addresses as $address) {
             $tags = null;
             if ($customer->getDefaultBilling() == $address->getEntityId()) {
                 $tags = array(Xcom_Chronicle_Helper_Data::ADDRESS_TAG_BILLING);
             }
             $addrData[] = Mage::helper('xcom_chronicle')->createAddress($address, $tags);
         }
     }
     return $addrData;
 }
开发者ID:ridhoq,项目名称:mxpi-twitter,代码行数:19,代码来源:Customer.php

示例3: _getVatRequiredCustomerAddress

 /**
  * Retrieve customer address (default billing or default shipping) ID on which tax calculation must be based
  *
  * @param Mage_Customer_Model_Customer $customer
  * @param Mage_Core_Model_Store|string|int|null $store
  * @return int|string
  */
 protected function _getVatRequiredCustomerAddress(Mage_Customer_Model_Customer $customer, $store = null)
 {
     $configAddressType = Mage::helper('customer/address')->getTaxCalculationAddressType($store);
     $requiredAddress = null;
     switch ($configAddressType) {
         case Mage_Customer_Model_Address_Abstract::TYPE_SHIPPING:
             $requiredAddress = $customer->getDefaultShipping();
             break;
         default:
             $requiredAddress = $customer->getDefaultBilling();
     }
     return $requiredAddress;
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:20,代码来源:Observer.php

示例4: _prepareCustomerBilling

 /**
  * Set up the billing address for the quote and on the customer, and set the customer's
  * default billing address.
  *
  * @param $customer Mage_Customer_Model_Customer
  *
  * @return Mage_Sales_Model_Quote_Address $billingAddress | null
  */
 protected function _prepareCustomerBilling(Mage_Customer_Model_Customer $customer)
 {
     $billing = $this->_quote->getBillingAddress();
     if (!$billing->getCustomerId() || $billing->getSaveInAddressBook()) {
         $customerBilling = $billing->exportCustomerAddress();
         $customer->addAddress($customerBilling);
         $billing->setCustomerAddress($customerBilling);
         if (!$customer->getDefaultBilling()) {
             $customerBilling->setIsDefaultBilling(true);
         }
         return $customerBilling;
     }
     return null;
 }
开发者ID:adderall,项目名称:magento-retail-order-management,代码行数:22,代码来源:Checkout.php

示例5: getAddressItems

 /**
  * Retrieve customer addresses list
  *
  * @param Mage_Customer_Model_Customer $customer
  *
  * @return array
  */
 protected function getAddressItems($customer)
 {
     $result = array();
     foreach ($customer->getAddresses() as $address) {
         $data = $address->toArray();
         $row = array();
         foreach ($this->_mapAddressAttributes as $attributeAlias => $attributeCode) {
             $row[$attributeAlias] = isset($data[$attributeCode]) ? $data[$attributeCode] : null;
         }
         foreach ($this->getAllowedAttributes($address) as $attributeCode => $attribute) {
             if (isset($data[$attributeCode])) {
                 $row[$attributeCode] = $data[$attributeCode];
             }
         }
         $row['is_default_billing'] = $customer->getDefaultBilling() == $address->getId();
         $row['is_default_shipping'] = $customer->getDefaultShipping() == $address->getId();
         $result[] = $row;
     }
     return $result;
 }
开发者ID:brentwpeterson,项目名称:magento-orocrm-bridge,代码行数:27,代码来源:Api.php


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