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


PHP Address::getData方法代碼示例

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


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

示例1: renderAddress

 /**
  * Get HTML output for specified address
  *
  * @param \Magento\Quote\Model\Quote\Address $address
  * @return string
  */
 public function renderAddress($address)
 {
     /** @var \Magento\Customer\Block\Address\Renderer\RendererInterface $renderer */
     $renderer = $this->_addressConfig->getFormatByCode('html')->getRenderer();
     $addressData = \Magento\Framework\Convert\ConvertArray::toFlatArray($address->getData());
     return $renderer->renderArray($addressData);
 }
開發者ID:whoople,項目名稱:magento2-testing,代碼行數:13,代碼來源:Review.php

示例2: verifyTotals

 /**
  * Verify that correct fields of address has been set
  *
  * @param \PHPUnit_Framework_MockObject_MockObject|\Magento\Quote\Model\Quote\Address $address
  * @param array $addressData
  */
 public function verifyTotals($address, $addressData)
 {
     foreach ($addressData as $key => $value) {
         if ($key != self::KEY_WEEE_TOTALS && $key != self::KEY_WEEE_BASE_TOTALS) {
             // just check the output values
             $this->assertEquals($value, $address->getData($key), 'address ' . $key . ' is incorrect');
         }
     }
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:15,代碼來源:WeeeTaxTest.php

示例3: getAddressId

 /**
  * @param Address $address
  * @return string
  */
 protected function getAddressId(Address $address)
 {
     if ($address == null) {
         return '';
     }
     if (!$address->hasData('address_sales_rule_id')) {
         if ($address->hasData('address_id')) {
             $address->setData('address_sales_rule_id', $address->getData('address_id'));
         } else {
             $type = $address->getAddressType();
             $tempId = $type . $this->counter++;
             $address->setData('address_sales_rule_id', $tempId);
         }
     }
     return $address->getData('address_sales_rule_id');
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:20,代碼來源:Validator.php

示例4: verifyQuoteAddress

 /**
  * Verify fields in quote address
  *
  * @param \Magento\Quote\Model\Quote\Address $quoteAddress
  * @param array $expectedAddressData
  * @return $this
  */
 protected function verifyQuoteAddress($quoteAddress, $expectedAddressData)
 {
     foreach ($expectedAddressData as $key => $value) {
         if ($key == 'applied_taxes') {
             $this->verifyAppliedTaxes($quoteAddress->getAppliedTaxes(), $value);
         } else {
             $this->assertEquals($value, $quoteAddress->getData($key), 'Quote address ' . $key . ' is incorrect');
         }
     }
     return $this;
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:18,代碼來源:TaxTest.php

示例5: verifyAddress

 /**
  * Verify that correct fields of address has been set
  *
  * @param \PHPUnit_Framework_MockObject_MockObject|\Magento\Quote\Model\Quote\Address $address
  * @param $addressData
  */
 public function verifyAddress(\Magento\Quote\Model\Quote\Address $address, $addressData)
 {
     foreach ($addressData as $key => $value) {
         $this->assertEquals($value, $address->getData($key), 'address ' . $key . ' is incorrect');
     }
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:12,代碼來源:WeeeTest.php

示例6: compareQuoteAddresses

 /**
  * Compare quote address and ensure fields match / don't match
  *
  * @param \Magento\Quote\Model\Quote\Address $nativeQuoteAddress
  * @param \Magento\Quote\Model\Quote\Address $avaTaxQuoteAddress
  * @return $this
  */
 protected function compareQuoteAddresses($nativeQuoteAddress, $avaTaxQuoteAddress)
 {
     foreach ($this->quoteAddressFieldsEnsureMatch as $value) {
         $this->assertEquals($nativeQuoteAddress->getData($value), $avaTaxQuoteAddress->getData($value), 'native/AvaTax calculation does not match for quote address field: ' . $value);
     }
     foreach ($this->quoteAddressFieldsEnsureDiff as $value) {
         $this->assertNotEquals($nativeQuoteAddress->getData($value), $avaTaxQuoteAddress->getData($value), 'native/AvaTax calculation matches (but shouldn\'t be) for quote address field: ' . $value);
     }
     return $this;
 }
開發者ID:classyllama,項目名稱:ClassyLlama_AvaTax,代碼行數:17,代碼來源:TaxTest.php


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