本文整理汇总了PHP中Mage_Sales_Model_Order::getShippingAddress方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Order::getShippingAddress方法的具体用法?PHP Mage_Sales_Model_Order::getShippingAddress怎么用?PHP Mage_Sales_Model_Order::getShippingAddress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Sales_Model_Order
的用法示例。
在下文中一共展示了Mage_Sales_Model_Order::getShippingAddress方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getOrderItemValue
/**
* Retrieve order item value by key
*
* @param Mage_Sales_Model_Order $order
* @param string $key
* @return string
*/
public function getOrderItemValue(Mage_Sales_Model_Order $order, $key)
{
$escape = true;
switch ($key) {
case 'order_increment_id':
$value = $order->getIncrementId();
break;
case 'created_at':
$value = $this->helper('core')->formatDate($order->getCreatedAt(), 'short', true);
break;
case 'shipping_address':
$value = $order->getShippingAddress() ? $this->htmlEscape($order->getShippingAddress()->getName()) : $this->__('N/A');
break;
case 'order_total':
$value = $order->formatPrice($order->getGrandTotal());
$escape = false;
break;
case 'status_label':
$value = $order->getStatusLabel();
break;
case 'view_url':
$value = $this->getUrl('*/order/view', array('order_id' => $order->getId()));
break;
default:
$value = $order->getData($key) ? $order->getData($key) : $this->__('N/A');
}
return $escape ? $this->escapeHtml($value) : $value;
}
示例2: _createCustomer
protected function _createCustomer(Mage_Sales_Model_Order $order)
{
$addresses = array();
$primaryPhone = null;
$company = null;
if ($order->getBillingAddress()) {
$addresses[] = Mage::helper('xcom_chronicle')->createAddress($order->getBillingAddress(), array(Xcom_Chronicle_Helper_Data::ADDRESS_TAG_BILLING));
$company = $order->getBillingAddress()->getCompany();
$primaryPhone = $order->getBillingAddress()->getTelephone();
}
if ($order->getShippingAddress()) {
$addresses[] = Mage::helper('xcom_chronicle')->createAddress($order->getShippingAddress(), array(Xcom_Chronicle_Helper_Data::ADDRESS_TAG_SHIPPING));
}
$data = array('id' => Mage::helper('xcom_chronicle')->createEntityId('guest' . $order->getRealOrderId()), 'fullName' => $this->_createCustomerName($order), 'addresses' => $addresses, 'primaryPhone' => array('number' => $primaryPhone, 'type' => 'UNKNOWN'), 'email' => array('emailAddress' => $order->getCustomerEmail(), 'extension' => null), 'gender' => null, 'dateOfBirth' => null, 'company' => $company, 'dateCreated' => date('c', strtotime($order->getCreatedAt())), 'lastModified' => date('c', strtotime($order->getUpdatedAt())), 'sourceIds' => null, 'emailOptOut' => null, 'doNotCall' => null);
return $data;
}
示例3: redirectAction
public function redirectAction()
{
// Retrieve order
$order = new Mage_Sales_Model_Order();
$ccavenue['order_id'] = Mage::getSingleton('checkout/session')->getLastRealOrderId();
$order->loadByIncrementId($ccavenue['order_id']);
// Get CCAvenue Parameters
$ccavenue['action'] = Mage::getStoreConfig('payment/ccavenue/submit_url');
$ccavenue['merchant_id'] = Mage::getStoreConfig('payment/ccavenue/merchant_id');
$ccavenue['amount'] = round($order->base_grand_total, 2);
$ccavenue['redirect_url'] = Mage::getBaseUrl() . 'ccavenue/payment/response';
$ccavenue['working_key'] = Mage::getStoreConfig('payment/ccavenue/working_key');
$ccavenue['checksum'] = $this->getCheckSum($ccavenue['merchant_id'], $ccavenue['amount'], $ccavenue['order_id'], $ccavenue['redirect_url'], $ccavenue['working_key']);
// Retrieve order details
$billingAddress = $order->getBillingAddress();
$billingData = $billingAddress->getData();
$shippingAddress = $order->getShippingAddress();
if ($shippingAddress) {
$shippingData = $shippingAddress->getData();
}
$ccavenue['billing_cust_name'] = $billingData['firstname'] . ' ' . $billingData['lastname'];
$ccavenue['billing_cust_address'] = $billingAddress->street;
$ccavenue['billing_cust_state'] = $billingAddress->region;
$ccavenue['billing_cust_country'] = Mage::getModel('directory/country')->load($billingAddress->country_id)->getName();
$ccavenue['billing_cust_tel'] = $billingAddress->telephone;
$ccavenue['billing_cust_email'] = $order->customer_email;
if ($shippingAddress) {
$ccavenue['delivery_cust_name'] = $shippingData['firstname'] . ' ' . $shippingData['lastname'];
$ccavenue['delivery_cust_address'] = $shippingAddress->street;
$ccavenue['delivery_cust_state'] = $shippingAddress->region;
$ccavenue['delivery_cust_country'] = Mage::getModel('directory/country')->load($shippingAddress->country_id)->getName();
$ccavenue['delivery_cust_tel'] = $shippingAddress->telephone;
$ccavenue['delivery_city'] = $shippingAddress->city;
$ccavenue['delivery_zip'] = $shippingAddress->postcode;
} else {
$ccavenue['delivery_cust_name'] = '';
$ccavenue['delivery_cust_address'] = '';
$ccavenue['delivery_cust_state'] = '';
$ccavenue['delivery_cust_country'] = '';
$ccavenue['delivery_cust_tel'] = '';
$ccavenue['delivery_city'] = '';
$ccavenue['delivery_zip'] = '';
}
$ccavenue['merchant_param'] = '';
$ccavenue['billing_city'] = $billingAddress->city;
$ccavenue['billing_zip'] = $billingAddress->postcode;
$ccavenue['billing_cust_notes'] = '';
// Insert into CCAvenue Response Log Table
$now = Mage::getModel('core/date')->timestamp(time());
Mage::getModel('ccavenue/ccavenueredirect')->setMerchantId($ccavenue['merchant_id'])->setAmount($ccavenue['amount'])->setOrderId($ccavenue['order_id'])->setRedirectUrl($ccavenue['redirect_url'])->setChecksum($ccavenue['checksum'])->setBillingCustName(addslashes($ccavenue['billing_cust_name']))->setBillingCustAddress(addslashes($ccavenue['billing_cust_address']))->setBillingCustCountry(addslashes($ccavenue['billing_cust_country']))->setBillingCustState(addslashes($ccavenue['billing_cust_state']))->setBillingZip($ccavenue['billing_zip'])->setBillingCustTel($ccavenue['billing_cust_tel'])->setBillingCustEmail($ccavenue['billing_cust_email'])->setDeliveryCustName(addslashes($ccavenue['delivery_cust_name']))->setDeliveryCustAddress(addslashes($ccavenue['delivery_cust_address']))->setDeliveryCustCountry(addslashes($ccavenue['delivery_cust_country']))->setDeliveryCustState(addslashes($ccavenue['delivery_cust_state']))->setDeliveryCustTel($ccavenue['delivery_cust_tel'])->setBillingCustNotes($ccavenue['billing_cust_notes'])->setMerchantParam($ccavenue['merchant_param'])->setBillingCustCity(addslashes($ccavenue['billing_city']))->setBillingZipCode($ccavenue['billing_zip'])->setDeliveryCustCity(addslashes($ccavenue['delivery_city']))->setDeliveryZipCode($ccavenue['delivery_zip'])->setCcavenueRedirectIp($this->get_uer_ip())->setCcavenueRedirectDtime(date('Y-m-d H:i:s', $now))->save();
// Add data to registry so it's accessible in the view file
Mage::register('ccavenue', $ccavenue);
// Render layout
$this->loadLayout();
$block = $this->getLayout()->createBlock('Mage_Core_Block_Template', 'ccavenue', array('template' => 'ccavenue/redirect.phtml'));
$this->getLayout()->getBlock('content')->append($block);
$this->renderLayout();
}
示例4: testInitFromOrderShippingAddressSameAsBillingWhenDifferent
/**
* @magentoDataFixture Mage/Downloadable/_files/product.php
* @magentoDataFixture Mage/Downloadable/_files/order_with_downloadable_product.php
* @magentoDataFixture Mage/Adminhtml/_files/order_shipping_address_different_to_billing.php
*/
public function testInitFromOrderShippingAddressSameAsBillingWhenDifferent()
{
$order = new Mage_Sales_Model_Order();
$order->loadByIncrementId('100000001');
$this->assertNull($order->getShippingAddress()->getSameAsBilling());
Mage::unregister('rule_data');
$this->_model->initFromOrder($order);
$this->assertFalse($order->getShippingAddress()->getSameAsBilling());
}
示例5: getCheckoutOptionsHtml
/**
* Collect options selected at checkout and calculate type consignment
*
* @return string
*/
public function getCheckoutOptionsHtml()
{
$html = false;
$pgAddress = $this->_helper->getPgAddress($this->_order);
/** @var object $data Data from checkout */
$data = $this->_order->getMyparcelData() !== null ? json_decode($this->_order->getMyparcelData(), true) : false;
$shippingMethod = $this->_order->getShippingMethod();
if ($pgAddress && $this->_helper->shippingMethodIsPakjegemak($shippingMethod)) {
if (is_array($data) && key_exists('location', $data)) {
$dateTime = date('d-m-Y H:i', strtotime($data['date'] . ' ' . $data['start_time']));
$html .= $this->__('PostNL location:') . ' ' . $dateTime;
if ($data['price_comment'] != 'retail') {
$html .= ', ' . $this->__('TYPE_' . $data['price_comment']);
}
$html .= ', ' . $data['location'] . ', ' . $data['city'] . ' (' . $data['postal_code'] . ')';
} else {
/** Old data from orders before version 1.6.0 */
$html .= $this->__('PostNL location:') . ' ' . $pgAddress->getCompany() . ' ' . $pgAddress->getCity();
}
} else {
// Get package type
$totalWeight = $this->_helper->getTotalWeight($this->_order->getAllVisibleItems());
if ($totalWeight !== false) {
$html .= $this->_helper->getPackageType($totalWeight, $this->_order->getShippingAddress()->getCountryId(), true) . ' ';
if (is_array($data) && key_exists('date', $data)) {
$dateTime = date('d-m-Y H:i', strtotime($data['date'] . ' ' . $data['time'][0]['start']));
$html .= $this->__('deliver:') . ' ' . $dateTime;
if ($data['time'][0]['price_comment'] != 'standard') {
$html .= ', ' . $this->__('TYPE_' . $data['time'][0]['price_comment']);
}
if (key_exists('home_address_only', $data) && $data['home_address_only']) {
$html .= ', ' . strtolower($this->__('Home address only'));
}
if (key_exists('signed', $data) && $data['signed']) {
$html .= ', ' . strtolower($this->__('Signature on receipt'));
}
}
}
}
if (is_array($data) && key_exists('browser', $data)) {
$html = ' <span title="' . $data['browser'] . '"">' . $html . '</span>';
}
return $html !== false ? '<br>' . $html : '';
}
示例6: preset
/**
* Saves billing section to order
* @param Mage_Sales_Model_Order $Order
* @return
*/
public function preset(Mage_Sales_Model_Order $order, $data)
{
$ba = $order->getShippingAddress();
foreach ($data as $k => $v) {
$ba->setData($k, $v);
}
$ba->implodeStreetAddress();
$ba->save();
return $order;
}
示例7: _render
/**
* (re)Render all items and totals
*/
protected function _render()
{
if (!$this->_shouldRender) {
return;
}
// regular items from the sales entity
$this->_items = array();
foreach ($this->_salesEntity->getAllItems() as $item) {
if (!$item->getParentItem()) {
$this->_addRegularItem($item);
}
}
end($this->_items);
$lastRegularItemKey = key($this->_items);
// regular totals
$shippingDescription = '';
if ($this->_salesEntity instanceof Mage_Sales_Model_Order) {
$shippingDescription = $this->_salesEntity->getShippingDescription();
$this->_totals = array(self::TOTAL_SUBTOTAL => $this->_salesEntity->getBaseSubtotal(), self::TOTAL_TAX => $this->_salesEntity->getBaseTaxAmount(), self::TOTAL_SHIPPING => $this->_salesEntity->getBaseShippingAmount(), self::TOTAL_DISCOUNT => abs($this->_salesEntity->getBaseDiscountAmount()));
$this->_applyHiddenTaxWorkaround($this->_salesEntity);
} else {
$address = $this->_salesEntity->getIsVirtual() ? $this->_salesEntity->getBillingAddress() : $this->_salesEntity->getShippingAddress();
$shippingDescription = $address->getShippingDescription();
$this->_totals = array(self::TOTAL_SUBTOTAL => $this->_salesEntity->getBaseSubtotal(), self::TOTAL_TAX => $address->getBaseTaxAmount(), self::TOTAL_SHIPPING => $address->getBaseShippingAmount(), self::TOTAL_DISCOUNT => abs($address->getBaseDiscountAmount()));
$this->_applyHiddenTaxWorkaround($address);
}
$originalDiscount = $this->_totals[self::TOTAL_DISCOUNT];
// arbitrary items, total modifications
Mage::dispatchEvent('paypal_prepare_line_items', array('paypal_cart' => $this));
// distinguish original discount among the others
if ($originalDiscount > 0.0001 && isset($this->_totalLineItemDescriptions[self::TOTAL_DISCOUNT])) {
$this->_totalLineItemDescriptions[self::TOTAL_DISCOUNT][] = Mage::helper('sales')->__('Discount (%s)', Mage::app()->getStore()->convertPrice($originalDiscount, true, false));
}
// discount, shipping as items
if ($this->_isDiscountAsItem && $this->_totals[self::TOTAL_DISCOUNT]) {
$this->addItem(Mage::helper('paypal')->__('Discount'), 1, -1.0 * $this->_totals[self::TOTAL_DISCOUNT], $this->_renderTotalLineItemDescriptions(self::TOTAL_DISCOUNT));
}
$shippingItemId = $this->_renderTotalLineItemDescriptions(self::TOTAL_SHIPPING, $shippingDescription);
if ($this->_isShippingAsItem && (double) $this->_totals[self::TOTAL_SHIPPING]) {
$this->addItem(Mage::helper('paypal')->__('Shipping'), 1, (double) $this->_totals[self::TOTAL_SHIPPING], $shippingItemId);
}
// compound non-regular items into subtotal
foreach ($this->_items as $key => $item) {
if ($key > $lastRegularItemKey && $item->getAmount() != 0) {
$this->_totals[self::TOTAL_SUBTOTAL] += $item->getAmount();
}
}
$this->_validate();
// if cart items are invalid, prepare cart for transfer without line items
if (!$this->_areItemsValid) {
$this->removeItem($shippingItemId);
}
$this->_shouldRender = false;
}
示例8: dispatchBeforeOrderSubmit
/**
* Dispatch events for before the order has been submitted.
*
* @param Mage_Sales_Model_Quote
* @param Mage_Sales_Model_Order
* @return self
*/
public function dispatchBeforeOrderSubmit(Mage_Sales_Model_Quote $quote, Mage_Sales_Model_Order $order)
{
// Dispatch the multishipping single order create event. This event
// doesn't exactly mean the same in ROM Multishipping checkout but
// is still used to preserve compatibility with extensions that expect
// the event. Provide the primary shipping address as the address in
// the event as this would be closes to the one address included
// in base Magento. Existing observers in Magento don't appear to need
// it but keeping it in case any 3rd party extensions do expect it.
Mage::dispatchEvent('checkout_type_multishipping_create_orders_single', ['order' => $order, 'address' => $order->getShippingAddress()]);
return $this;
}
示例9: redirectAction
public function redirectAction()
{
// Retrieve order
$order = new Mage_Sales_Model_Order();
$customcard['order_id'] = Mage::getSingleton('checkout/session')->getLastRealOrderId();
$order->loadByIncrementId($customcard['order_id']);
// Get Custom card method Parameters
$customcard['action'] = Mage::getStoreConfig('payment/paymentmodulepackbankin_checkout/submit_url');
$customcard['merchant_id'] = Mage::getStoreConfig('payment/paymentmodulepackbankin_checkout/merchant_id');
$customcard['amount'] = round($order->base_grand_total, 2);
$customcard['redirect_url'] = Mage::getBaseUrl() . 'paymentmodulepackbankin_checkout/payment/response';
// Retrieve order details
$billingAddress = $order->getBillingAddress();
$billingData = $billingAddress->getData();
$shippingAddress = $order->getShippingAddress();
if ($shippingAddress) {
$shippingData = $shippingAddress->getData();
}
$customcard['billing_cust_name'] = $billingData['firstname'] . ' ' . $billingData['lastname'];
$customcard['billing_cust_address'] = $billingAddress->street;
$customcard['billing_cust_state'] = $billingAddress->region;
$customcard['billing_cust_country'] = Mage::getModel('directory/country')->load($billingAddress->country_id)->getName();
$customcard['billing_cust_tel'] = $billingAddress->telephone;
$customcard['billing_cust_email'] = $order->customer_email;
if ($shippingAddress) {
$customcard['delivery_cust_name'] = $shippingData['firstname'] . ' ' . $shippingData['lastname'];
$customcard['delivery_cust_address'] = $shippingAddress->street;
$customcard['delivery_cust_state'] = $shippingAddress->region;
$customcard['delivery_cust_country'] = Mage::getModel('directory/country')->load($shippingAddress->country_id)->getName();
$customcard['delivery_cust_tel'] = $shippingAddress->telephone;
$customcard['delivery_city'] = $shippingAddress->city;
$customcard['delivery_zip'] = $shippingAddress->postcode;
} else {
$customcard['delivery_cust_name'] = '';
$customcard['delivery_cust_address'] = '';
$customcard['delivery_cust_state'] = '';
$customcard['delivery_cust_country'] = '';
$customcard['delivery_cust_tel'] = '';
$customcard['delivery_city'] = '';
$customcard['delivery_zip'] = '';
}
$customcard['merchant_param'] = '';
$customcard['billing_city'] = $billingAddress->city;
$customcard['billing_zip'] = $billingAddress->postcode;
$customcard['billing_cust_notes'] = '';
// Add data to registry so it's accessible in the view file
Mage::register('customcard', $customcard);
// Render layout
$this->loadLayout();
$block = $this->getLayout()->createBlock('Mage_Core_Block_Template', 'customcard', array('template' => 'paymentmodulepackbankin/redirect.phtml'));
$this->getLayout()->getBlock('content')->append($block);
$this->renderLayout();
}
示例10: _encodeOrder
/**
* Encodes a single Magento Order.
*
* @param Mage_Sales_Model_Order $order
*
* @return RTDOrder
*/
protected function _encodeOrder(Mage_Sales_Model_Order $order)
{
$encodedOrder = new RTDOrder();
$customMapping = Mage::getConfig()->getNode('rtd_mappings/order');
foreach ($customMapping->asArray() as $magentoKey => $rtdKey) {
$encodedOrder->setParam($rtdKey, $order->{'get' . $magentoKey}());
}
$this->_encodeShippingAddress($encodedOrder, $order->getShippingAddress());
$this->_encodeBillingAddress($encodedOrder, $order->getBillingAddress());
$this->_encodeOrderLines($encodedOrder, $order);
$this->_encodeShipment($encodedOrder, $order);
return $encodedOrder;
}
示例11: _getShippingObject
/**
* Generate and return the Wirecard shipping Object if shipping is necessary
*
* @return WirecardCEE_Client_QPay_Request_Initiation_ConsumerData_Address
*/
protected function _getShippingObject()
{
$shipping = $this->_order->getShippingAddress();
$shippingAddressObj = new WirecardCEE_Client_QPay_Request_Initiation_ConsumerData_Address(WirecardCEE_Client_QPay_Request_Initiation_ConsumerData_Address::TYPE_SHIPPING);
$shippingAddressObj->setFirstname($shipping->getFirstname());
$shippingAddressObj->setLastname($shipping->getLastname());
$shippingAddressObj->setAddress1($shipping->getStreet1());
$shippingAddressObj->setAddress2($shipping->getStreet2());
$shippingAddressObj->setCity($shipping->getCity());
$shippingAddressObj->setCountry($shipping->getCountry());
$shippingAddressObj->setState($shipping->getRegionCode());
$shippingAddressObj->setZipCode($shipping->getPostcode());
$shippingAddressObj->setFax($shipping->getFax());
$shippingAddressObj->setPhone($shipping->getTelephone());
return $shippingAddressObj;
}
示例12: _createCustomer
/**
* @param Mage_Sales_Model_Order $order
* @return int
*/
protected function _createCustomer(Mage_Sales_Model_Order $order)
{
/** @var $customer Mage_Customer_Model_Customer */
$customer = Mage::getModel('customer/customer')->setWebsiteId($order->getStore()->getWebsiteId())->loadByEmail($order->getCustomerEmail());
$customerGroupId = 1;
// @todo load general customer group ID?
if (!$customer->getId()) {
$customer->addData(array('prefix' => $order->getCustomerPrefix(), 'firstname' => $order->getCustomerFirstname(), 'middlename' => $order->getCustomerMiddlename(), 'lastname' => $order->getCustomerLastname(), 'suffix' => $order->getCustomerSuffix(), 'email' => $order->getCustomerEmail(), 'group_id' => $customerGroupId, 'taxvat' => $order->getCustomerTaxvat(), 'website_id' => $order->getStore()->getWebsiteId(), 'default_billing' => '_item1', 'default_shipping' => '_item2'));
// Billing Address
/** @var $billingAddress Mage_Sales_Model_Order_Address */
$billingAddress = $order->getBillingAddress();
/** @var $customerBillingAddress Mage_Customer_Model_Address */
$customerBillingAddress = Mage::getModel('customer/address');
$billingAddressArray = $billingAddress->toArray();
unset($billingAddressArray['entity_id']);
unset($billingAddressArray['parent_id']);
unset($billingAddressArray['customer_id']);
unset($billingAddressArray['customer_address_id']);
unset($billingAddressArray['quote_address_id']);
$customerBillingAddress->addData($billingAddressArray);
$customerBillingAddress->setPostIndex('_item1');
$customer->addAddress($customerBillingAddress);
// Shipping Address
/** @var $shippingAddress Mage_Sales_Model_Order_Address */
$shippingAddress = $order->getShippingAddress();
/** @var $customerShippingAddress Mage_Customer_Model_Address */
$customerShippingAddress = Mage::getModel('customer/address');
$shippingAddressArray = $shippingAddress->toArray();
unset($shippingAddressArray['entity_id']);
unset($shippingAddressArray['parent_id']);
unset($shippingAddressArray['customer_id']);
unset($shippingAddressArray['customer_address_id']);
unset($shippingAddressArray['quote_address_id']);
$customerShippingAddress->addData($shippingAddressArray);
$customerShippingAddress->setPostIndex('_item2');
$customer->addAddress($customerShippingAddress);
// Save the customer
$customer->setPassword($customer->generatePassword());
$customer->save();
}
// Link customer to order
$order->setCustomerId($customer->getId());
$order->setCustomerIsGuest(0);
$order->setCustomerGroupId($customerGroupId);
$order->save();
return $customer->getId();
}
示例13: _addressesesAreDifferent
/**
* @param Mage_Sales_Model_Order $order
* @return boolean $isDifferent
*/
protected function _addressesesAreDifferent($order)
{
$isDifferent = 0;
if ($order->getIsVirtual()) {
return $isDifferent;
}
$billingAddress = $order->getBillingAddress();
$shippingAddress = $order->getShippingAddress();
$methods = array('getStreetFull', 'getCity', 'getCountryId', 'getPostcode', 'getRegionId');
foreach ($methods as $method_name) {
$billingValue = call_user_func(array($billingAddress, $method_name));
$shippingValue = call_user_func(array($shippingAddress, $method_name));
if ($billingValue != $shippingValue) {
$isDifferent = 1;
break;
}
}
return $isDifferent;
}
示例14: createFromOrder
public static function createFromOrder(Mage_Sales_Model_Order $order)
{
$address = $order->getShippingAddress();
$shippingInfo = new self();
$shippingInfo->first_name = $address->getFirstname();
$shippingInfo->last_name = $address->getLastname();
$shippingInfo->street = $address->getStreet(1);
$shippingInfo->city = $address->getCity();
$shippingInfo->state = $address->getRegion();
$shippingInfo->country = $address->getCountryModel()->getIso2Code();
$shippingInfo->postcode = $address->getPostcode();
$shippingInfo->name = $order->getShippingMethod();
$shippingInfo->price = Aplazame_Sdk_Serializer_Decimal::fromFloat($order->getShippingAmount());
$shippingInfo->phone = $address->getTelephone();
$shippingInfo->alt_phone = $address->getAltTelephone();
$shippingInfo->address_addition = $address->getStreet(2);
if ($order->getShippingAmount() > 0) {
$shippingInfo->tax_rate = Aplazame_Sdk_Serializer_Decimal::fromFloat(100 * $order->getShippingTaxAmount() / $order->getShippingAmount());
}
$shippingInfo->discount = Aplazame_Sdk_Serializer_Decimal::fromFloat($order->getShippingDiscountAmount());
return $shippingInfo;
}
示例15: _initShippingAddressFromOrder
protected function _initShippingAddressFromOrder(Mage_Sales_Model_Order $order)
{
$this->getQuote()->getShippingAddress()->setCustomerAddressId('');
Mage::helper('core')->copyFieldset('sales_copy_order_shipping_address', 'to_order', $order->getShippingAddress(), $this->getQuote()->getShippingAddress());
}