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


PHP Mage_Sales_Model_Order::getShippingMethod方法代码示例

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


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

示例1: getShippingMethod

 /**
  * Returns the shipping method of the given order.
  *
  * @param Mage_Sales_Model_Order $order The order to return info from
  * @return String The name of the shipping method
  */
 protected function getShippingMethod($order)
 {
     if (!$order->getIsVirtual() && $order->getShippingMethod()) {
         return $order->getShippingMethod();
     }
     return '';
 }
开发者ID:rob3000,项目名称:fontis_australia,代码行数:13,代码来源:Abstract.php

示例2: getShippingMethod

/**
 * Returns the shipping method of the given order.
 *
 * @param Mage_Sales_Model_Order $order The order to return info from
 * @return String The name of the shipping method
 */
function getShippingMethod($order)
{
    if (!$order->getIsVirtual() && $order->getShippingDescription()) {
        return $order->getShippingDescription();
    } else {
        if (!$order->getIsVirtual() && $order->getShippingMethod()) {
            return $order->getShippingMethod();
        }
    }
    return '';
}
开发者ID:Itipart,项目名称:Synchro,代码行数:17,代码来源:Abstract.php

示例3: _toHtml

 /**
  * Do a few checks to see if the template should be rendered before actually rendering it.
  *
  * @return string
  *
  * @see Mage_Adminhtml_Block_Abstract::_toHtml()
  */
 protected function _toHtml()
 {
     $shippingMethod = $this->_order->getShippingMethod();
     if (!$this->_helper->isEnabled() || !$this->_order || !$this->_helper->shippingMethodIsMyParcel($shippingMethod)) {
         return '';
     }
     return parent::_toHtml();
 }
开发者ID:myparcelnl,项目名称:magento1,代码行数:15,代码来源:ShippingInfo.php

示例4: sendEmailNotification

 /**
  * Sends notification mail for selected shipping rate
  *
  * The code for this functionality is based on Mage_Sales_Model_Order::sendNewOrderEmail()
  *
  * @param Mage_Sales_Model_Order $order
  * @return boolean
  * @throws Exception
  * @see Mage_Sales_Model_Order
  */
 public function sendEmailNotification($order)
 {
     if (strncmp($order->getShippingMethod(), 'shippingrates_', 14) != 0) {
         return false;
     }
     $notificationMail = $order->getShippingCarrier()->getNotificationMail($order->getShippingMethod());
     if (!strlen(trim($notificationMail))) {
         return false;
     }
     $storeId = $order->getStore()->getId();
     // Start store emulation process
     $appEmulation = Mage::getSingleton('core/app_emulation');
     $initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation($storeId);
     try {
         // Retrieve specified view block from appropriate design package (depends on emulated store)
         $paymentBlock = Mage::helper('payment')->getInfoBlock($order->getPayment())->setIsSecureMode(true);
         $paymentBlock->getMethod()->setStore($storeId);
         $paymentBlockHtml = $paymentBlock->toHtml();
     } catch (Exception $exception) {
         // Stop store emulation process
         $appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo);
         throw $exception;
     }
     // Stop store emulation process
     $appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo);
     // Retrieve corresponding email template id and customer name
     if ($order->getCustomerIsGuest()) {
         $templateId = Mage::getStoreConfig(Mage_Sales_Model_Order::XML_PATH_EMAIL_GUEST_TEMPLATE, $storeId);
         $customerName = $order->getBillingAddress()->getName();
     } else {
         $templateId = Mage::getStoreConfig(Mage_Sales_Model_Order::XML_PATH_EMAIL_TEMPLATE, $storeId);
         $customerName = $order->getCustomerName();
     }
     $mailer = Mage::getModel('core/email_template_mailer');
     $emailInfo = Mage::getModel('core/email_info');
     $emailInfo->addTo($notificationMail);
     $mailer->addEmailInfo($emailInfo);
     // Set all required params and send emails
     $mailer->setSender(Mage::getStoreConfig(Mage_Sales_Model_Order::XML_PATH_EMAIL_IDENTITY, $storeId));
     $mailer->setStoreId($storeId);
     $mailer->setTemplateId($templateId);
     $mailer->setTemplateParams(array('order' => $order, 'billing' => $order->getBillingAddress(), 'payment_html' => $paymentBlockHtml));
     $mailer->send();
     return true;
 }
开发者ID:commercekitchen,项目名称:dualeyewear-magento,代码行数:55,代码来源:Email.php

示例5: _prepareOrderData

 /**
  * @return array
  */
 protected function _prepareOrderData()
 {
     // magento 1.5 compat
     $shipping_method_c = $this->_order->getShippingMethod(true);
     $shipping_method = $this->_order->getData('shipping_method');
     $shipping_method_code = $shipping_method_c ? $shipping_method_c->getData('carrier_code') : $shipping_method;
     $data = array_filter(array('currency_code' => $this->_order->getOrderCurrencyCode(), 'shipping_method_code' => $shipping_method_code, 'shipping_method_title' => $this->_order->getShippingDescription(), 'created_on' => $this->_order->getCreatedAt(), 'updated_on' => $this->_order->getUpdatedAt(), 'state' => $this->_order->getState(), 'status' => $this->_order->getStatus(), 'is_gift' => $this->_order->getGiftMessageId() != null, 'ref_quote_id' => $this->_order->getQuoteId(), 'order_subtotal_with_tax' => $this->_order->getSubtotalInclTax(), 'order_subtotal' => $this->_order->getSubtotal(), 'order_tax' => $this->_order->getTaxAmount(), 'order_hidden_tax' => $this->_order->getHiddenTaxAmount(), 'order_shipping_with_tax' => $this->_order->getShippingInclTax(), 'order_shipping' => $this->_order->getShippingAmount(), 'order_discount' => $this->_order->getDiscountAmount(), 'order_shipping_discount' => $this->_order->getShippingDiscountAmount(), 'order_total' => $this->_order->getGrandTotal(), 'order_total_items' => $this->_order->getTotalItemCount()));
     return $data;
 }
开发者ID:payin7-payments,项目名称:payin7-magento,代码行数:12,代码来源:Submit.php

示例6: 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;
 }
开发者ID:aplazame,项目名称:magento,代码行数:22,代码来源:ShippingInfo.php

示例7: getShippingConfiguration

 /**
  * @param Mage_Sales_Model_Order $order
  * @return array
  */
 private function getShippingConfiguration(Mage_Sales_Model_Order $order)
 {
     return explode('_', $order->getShippingMethod());
 }
开发者ID:rob3000,项目名称:fontis_australia,代码行数:8,代码来源:Clickandsend.php

示例8: _getCarrierCodeFromOrder

 /**
  * Returns carrier code of order
  *
  * @param Mage_Sales_Model_Order $order
  * @return string
  */
 protected function _getCarrierCodeFromOrder(Mage_Sales_Model_Order $order)
 {
     list($carrierCode, $method) = explode('_', $order->getShippingMethod(), 2);
     return $carrierCode;
 }
开发者ID:CE-Webmaster,项目名称:CE-Hub,代码行数:11,代码来源:Shipment.php

示例9: toQuoteShippingAddress

 /**
  * Convert order to shipping address
  *
  * @param   Mage_Sales_Model_Order $order
  * @return  Mage_Sales_Model_Quote_Address
  */
 public function toQuoteShippingAddress(Mage_Sales_Model_Order $order)
 {
     $address = $this->addressToQuoteAddress($order->getShippingAddress());
     $address->setWeight($order->getWeight())->setShippingMethod($order->getShippingMethod())->setShippingDescription($order->getShippingDescription())->setShippingRate($order->getShippingRate())->setSubtotal($order->getSubtotal())->setTaxAmount($order->getTaxAmount())->setDiscountAmount($order->getDiscountAmount())->setShippingAmount($order->getShippingAmount())->setGiftcertAmount($order->getGiftcertAmount())->setCustbalanceAmount($order->getCustbalanceAmount())->setGrandTotal($order->getGrandTotal())->setBaseSubtotal($order->getBaseSubtotal())->setBaseTaxAmount($order->getBaseTaxAmount())->setBaseDiscountAmount($order->getBaseDiscountAmount())->setBaseShippingAmount($order->getBaseShippingAmount())->setBaseGiftcertAmount($order->getBaseGiftcertAmount())->setBaseCustbalanceAmount($order->getBaseCustbalanceAmount())->setBaseGrandTotal($order->getBaseGrandTotal());
     return $address;
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:12,代码来源:Order.php

示例10: createHashForOrder

 /**
  * Build a hash over some unmodifiable(!) order properties.
  *
  * @param Mage_Sales_Model_Order $order
  * @return string
  */
 public function createHashForOrder(Mage_Sales_Model_Order $order)
 {
     $orderHash = $order->getId();
     $orderHash .= $order->getIncrementId();
     $orderHash .= $order->getQuoteId();
     $orderHash .= $order->getCustomerEmail();
     $orderHash .= $order->getCustomerFirstname();
     $orderHash .= $order->getCustomerLastname();
     $orderHash .= $order->getShippingMethod();
     $orderHash .= $order->getStoreName();
     $orderHash .= $order->getGrandTotal();
     return hash("sha512", $orderHash);
 }
开发者ID:ausger,项目名称:Dhl_Intraship,代码行数:19,代码来源:Validate.php

示例11: createFromOrder

 /**
  * Enter description here...
  *
  * @param Mage_Sales_Model_Order $order
  * @return Mage_Sales_Model_Quote
  */
 public function createFromOrder(Mage_Sales_Model_Order $order)
 {
     $this->setStoreId($order->getStoreId());
     $this->setBillingAddress(Mage::getModel('sales/quote_address')->importOrderAddress($order->getBillingAddress()));
     $this->setShippingAddress(Mage::getModel('sales/quote_address')->importOrderAddress($order->getShippingAddress()));
     foreach ($order->getItemsCollection() as $item) {
         if ($item->getQtyToShip() > 0) {
             $this->addItem(Mage::getModel('sales/quote_item')->importOrderItem($item));
         }
     }
     $this->getShippingAddress()->setCollectShippingRates(true);
     $this->getShippingAddress()->setShippingMethod($order->getShippingMethod());
     $this->getPayment()->importOrderPayment($order->getPayment());
     $this->setCouponCode($order->getCouponeCode());
     return $this;
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:22,代码来源:Quote.php

示例12: _getShippingType

 /**
  * Return shipping code based on PagSeguro Documentation
  * 1 – PAC, 2 – SEDEX, 3 - Desconhecido
  * @param Mage_Sales_Model_Order $order
  *
  * @return string
  */
 private function _getShippingType(Mage_Sales_Model_Order $order)
 {
     $method = strtolower($order->getShippingMethod());
     if (strstr($method, 'pac') !== false) {
         return '1';
     } else {
         if (strstr($method, 'sedex') !== false) {
             return '2';
         }
     }
     return '3';
 }
开发者ID:brunoalbim,项目名称:PagSeguro-Magento-Transparente,代码行数:19,代码来源:Params.php

示例13: getShippingCost

 /**
  *
  * @param Mage_Sales_Model_Order $order
  * @param string                 $city
  * @param string                 $postcode
  * @param array                  $weightsPackages
  * @param string                 $errorStr
  *
  * @return double
  */
 public function getShippingCost(Mage_Sales_Model_Order $order, $city, $postcode, $weightsPackages, &$errorStr)
 {
     $shippingAddress = $order->getShippingAddress();
     $city = $city ? $city : $shippingAddress->getCity();
     $postcode = $postcode ? $postcode : $shippingAddress->getPostcode();
     $serviceCode = $this->_getHelper()->getDPDServiceCode($order->getShippingMethod());
     $street = is_array($shippingAddress->getStreetFull()) ? implode("\n", $shippingAddress->getStreetFull()) : $shippingAddress->getStreetFull();
     $apiParams = $this->_getWsHelper()->getShipmentParams($order->getStore());
     $apiParams['method'] = Zitec_Dpd_Api_Configs::METHOD_SHIPMENT_CALCULATE_PRICE;
     try {
         $dpdApi = new Zitec_Dpd_Api($apiParams);
         $calculatePrice = $dpdApi->getApiMethodObject();
         $calculatePrice->setReceiverAddress($street, $city, $postcode, $shippingAddress->getCountryId())->setShipmentServiceCode($serviceCode);
         foreach ($weightsPackages as $parcelWeight) {
             $calculatePrice->addParcel($parcelWeight);
         }
         $insurance = Mage::helper('zitec_dpd')->extractInsuranceValuesByOrder($order);
         $calculatePrice = $calculatePrice->setAdditionalHighInsurance($insurance['goodsValue'], $insurance['currency'], $insurance['content']);
         $calculatePrice->execute();
     } catch (Exception $e) {
         $errorStr = $this->_getHelper()->__("Error obtaining shipping price: %s", $e->getMessage());
         $this->_getHelper()->log("An error occurred whilst calculating the DPD price for the shipment {$e->getMessage()}");
         return 0;
     }
     $response = $calculatePrice->getCalculatePriceResponse();
     if ($response->hasError()) {
         $errorStr = $this->_getHelper()->__("DPD error: %s", $response->getErrorText());
         $this->_getHelper()->log("DPD returned the following error whilst attempting to calculate the price of a shipment: {$response->getErrorText()}");
         return 0;
     }
     if ($order->getBaseCurrencyCode() == $response->getCurrency()) {
         return $response->getAmount();
     } else {
         if ($order->getBaseCurrencyCode() == $response->getCurrencyLocal()) {
             return $response->getAmountLocal();
         } else {
             $errorStr = $this->_getHelper()->__("Shipping price not available in order currency");
             $this->_getHelper()->log("An error occurred whilst calculating the price of a shipment. The base currency of the shipment ({$order->getBaseCurrencyCode()}) does not correspond to the currency ({$response->getCurrency()}) or the local currency ({$response->getCurrencyLocal()})  used by DPD.");
             return 0;
         }
     }
 }
开发者ID:GabrielCC,项目名称:zitec-dpd-master,代码行数:52,代码来源:Dpd.php


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