本文整理匯總了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);
}
示例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');
}
}
}
示例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');
}
示例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;
}
示例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');
}
}
示例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;
}