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


PHP Mage_Sales_Model_Quote_Address::getDataUsingMethod方法代码示例

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


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

示例1: _setExportedAddressData

 /**
  * Sets address data from exported address
  *
  * @param Mage_Sales_Model_Quote_Address $address
  * @param array $exportedAddress
  */
 protected function _setExportedAddressData($address, $exportedAddress)
 {
     foreach ($exportedAddress->getExportedKeys() as $key) {
         $oldData = $address->getDataUsingMethod($key);
         $isEmpty = null;
         if (is_array($oldData)) {
             foreach ($oldData as $val) {
                 if (!empty($val)) {
                     $isEmpty = false;
                     break;
                 }
                 $isEmpty = true;
             }
         }
         if (empty($oldData) || $isEmpty === true) {
             $address->setDataUsingMethod($key, $exportedAddress->getData($key));
         }
     }
 }
开发者ID:ksaltik,项目名称:tooldexlive,代码行数:25,代码来源:Checkout.php

示例2: _checkUseForShipping

 /**
  * Checks the shipping address is equal with billing address
  *
  * ATTENTION!!!
  * It should be removed when mobile app will send just the 'use_for_shipping' flag
  * instead of send shipping address same as a billing address
  *
  * @todo Remove when mobile app will send just the 'use_for_shipping' flag
  * @param array $data
  * @param Mage_Sales_Model_Quote_Address $billingAddress
  * @param integer $shippingAddressId
  * @return bool
  */
 protected function _checkUseForShipping(array $data, $billingAddress, $shippingAddressId)
 {
     $useForShipping = !$shippingAddressId || $billingAddress->getId() == $shippingAddressId;
     if ($useForShipping) {
         foreach ($data as $key => $value) {
             if ($key == 'save_in_address_book') {
                 continue;
             }
             $billingData = $billingAddress->getDataUsingMethod($key);
             if (is_array($value) && is_array($billingData)) {
                 foreach ($value as $k => $v) {
                     if (!isset($billingData[$k]) || $billingData[$k] != trim($v)) {
                         $useForShipping = false;
                         break;
                     }
                 }
             } else {
                 if (is_string($value) && $billingData != trim($value)) {
                     $useForShipping = false;
                     break;
                 } else {
                     $useForShipping = false;
                     break;
                 }
             }
         }
     }
     return $useForShipping;
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:42,代码来源:CheckoutController.php

示例3: _setExportedAddressData

 /**
  * Sets address data from exported address
  *
  * @param Mage_Sales_Model_Quote_Address $address
  * @param array $exportedAddress
  */
 protected function _setExportedAddressData($address, $exportedAddress)
 {
     // Exported data is more priority if we came from Express Checkout button
     $isButton = (bool) $this->_quote->getPayment()->getAdditionalInformation(self::PAYMENT_INFO_BUTTON);
     if (!$isButton) {
         foreach ($exportedAddress->getExportedKeys() as $key) {
             $oldData = $address->getDataUsingMethod($key);
             $isEmpty = null;
             if (is_array($oldData)) {
                 foreach ($oldData as $val) {
                     if (!empty($val)) {
                         $isEmpty = false;
                         break;
                     }
                     $isEmpty = true;
                 }
             }
             if (empty($oldData) || $isEmpty === true) {
                 $address->setDataUsingMethod($key, $exportedAddress->getData($key));
             }
         }
     } else {
         foreach ($exportedAddress->getExportedKeys() as $key) {
             $data = $exportedAddress->getData($key);
             if (!empty($data)) {
                 $address->setDataUsingMethod($key, $data);
             }
         }
     }
 }
开发者ID:xiaoguizhidao,项目名称:blingjewelry-prod,代码行数:36,代码来源:Checkout.php


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