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


PHP Mage_Sales_Model_Order_Shipment::getIncrementId方法代码示例

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


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

示例1: buildMap

 /**
  * @param Mage_Sales_Model_Order_Shipment $shipment
  * @return array
  */
 public function buildMap(Mage_Sales_Model_Order_Shipment $shipment)
 {
     $map = array('packingslip_id_label' => $this->getSalesHelper()->__('Packingslip # '), 'order_id_label' => $this->getSalesHelper()->__('Order # '), 'order_date_label' => $this->getSalesHelper()->__('Order Date: '), 'billing_address_label' => $this->getSalesHelper()->__('Sold to:'), 'shipping_address_label' => $this->getSalesHelper()->__('Ship to:'), 'payment_method_label' => $this->getSalesHelper()->__('Payment Method:'), 'shipping_method_label' => $this->getSalesHelper()->__('Shipping Method:'), 'products_qty_label' => $this->getSalesHelper()->__('Qty'), 'products_label' => $this->getSalesHelper()->__('Products'), 'products_sku_label' => $this->getSalesHelper()->__('SKU'));
     $order = $shipment->getOrder();
     $billingAddress = $order->getBillingAddress();
     $map['packingslip_id'] = $shipment->getIncrementId();
     $map['order_id'] = Mage::getStoreConfigFlag(Mage_Sales_Model_Order_Pdf_Shipment::XML_PATH_SALES_PDF_SHIPMENT_PUT_ORDER_ID, $order->getStoreId()) ? $order->getRealOrderId() : 'N/A';
     $map['order_date'] = $this->getCoreHelper()->formatDate($order->getCreatedAtStoreDate(), 'medium', false);
     $map['billing_name'] = $billingAddress->getFirstname() . ' ' . $billingAddress->getLastname();
     $map['billing_street'] = $billingAddress->getStreetFull();
     $map['billing_city'] = $billingAddress->getCity();
     $map['billing_zip'] = $billingAddress->getPostcode();
     $map['billing_country'] = $billingAddress->getCountryModel()->getIso2Code();
     $map['billing_phone'] = $billingAddress->getTelephone();
     $shippingAddress = $order->getShippingAddress();
     $map['shipping_name'] = $shippingAddress->getFirstname() . ' ' . $shippingAddress->getLastname();
     $map['shipping_street'] = $shippingAddress->getStreetFull();
     $map['shipping_city'] = $shippingAddress->getCity();
     $map['shipping_zip'] = $shippingAddress->getPostcode();
     $map['shipping_country'] = $shippingAddress->getCountry();
     $map['shipping_phone'] = $shippingAddress->getTelephone();
     $map['payment_method'] = $paymentInfo = $this->getPaymentHelper()->getInfoBlock($order->getPayment())->setIsSecureMode(true)->toHtml();
     $map['shipping_method'] = $order->getShippingDescription();
     $map['shipping_charges'] = '(' . $this->getSalesHelper()->__('Total Shipping Charges') . ' ' . $order->formatPriceTxt($order->getShippingAmount()) . ')';
     $map['products_data'] = '';
     foreach ($shipment->getAllItems() as $item) {
         if ($item->getOrderItem()->getParentItem()) {
             continue;
         }
         $map['products_data'] .= $this->drawItem($item, $order);
     }
     return $map;
 }
开发者ID:swisspost-yellowcube,项目名称:magento-yellowcube,代码行数:37,代码来源:Shipment.php

示例2: sendVendorComment

 /**
  * Send vendor comment to store owner
  *
  * @param Mage_Sales_Model_Order_Shipment $shipment
  * @param string $comment
  */
 public function sendVendorComment($shipment, $comment)
 {
     $order = $shipment->getOrder();
     $store = $order->getStore();
     $to = $store->getConfig('udropship/admin/vendor_comments_receiver');
     $subject = $store->getConfig('udropship/admin/vendor_comments_subject');
     $template = $store->getConfig('udropship/admin/vendor_comments_template');
     $vendor = $this->getVendor($shipment->getUdropshipVendor());
     $ahlp = Mage::getModel('adminhtml/url');
     if ($subject && $template && $vendor->getId()) {
         $toEmail = $store->getConfig('trans_email/ident_' . $to . '/email');
         $toName = $store->getConfig('trans_email/ident_' . $to . '/name');
         $data = array('vendor_name' => $vendor->getVendorName(), 'order_id' => $order->getIncrementId(), 'shipment_id' => $shipment->getIncrementId(), 'vendor_url' => $ahlp->getUrl('udropship/adminhtml_vendor/edit', array('id' => $vendor->getId())), 'order_url' => $ahlp->getUrl('adminhtml/sales_order/view', array('order_id' => $order->getId())), 'shipment_url' => $ahlp->getUrl('adminhtml/sales_order_shipment/view', array('shipment_id' => $shipment->getId(), 'order_id' => $order->getId())), 'comment' => $comment);
         if ($this->isUdpoActive() && ($po = Mage::helper('udpo')->getShipmentPo($shipment))) {
             $data['po_id'] = $po->getIncrementId();
             $data['po_url'] = $ahlp->getUrl('udpoadmin/order_po/view', array('udpo_id' => $po->getId(), 'order_id' => $order->getId()));
             $template = preg_replace('/{{isPoAvailable}}(.*?){{\\/isPoAvailable}}/s', '\\1', $template);
         } else {
             $template = preg_replace('/{{isPoAvailable}}.*?{{\\/isPoAvailable}}/s', '', $template);
         }
         foreach ($data as $k => $v) {
             $subject = str_replace('{{' . $k . '}}', $v, $subject);
             $template = str_replace('{{' . $k . '}}', $v, $template);
         }
         $mail = Mage::getModel('core/email')->setFromEmail($vendor->getEmail())->setFromName($vendor->getVendorName())->setToEmail($toEmail)->setToName($toName)->setSubject($subject)->setBody($template)->send();
         //mail('"'.$toName.'" <'.$toEmail.'>', $subject, $template, 'From: "'.$vendor->getVendorName().'" <'.$vendor->getEmail().'>');
     }
     Mage::helper('udropship')->addShipmentComment($shipment, $this->__($vendor->getVendorName() . ': ' . $comment));
     $shipment->getCommentsCollection()->save();
     return $this;
 }
开发者ID:evinw,项目名称:project_bloom_magento,代码行数:37,代码来源:Data.php

示例3: _createShipmentInfo

 protected function _createShipmentInfo(Mage_Sales_Model_Order_Shipment $shipment)
 {
     $result = array('shipmentId' => $shipment->getIncrementId(), 'shippingFees' => array('amount' => '0', 'code' => Mage::app()->getStore()->getBaseCurrencyCode()), 'discountAmount' => null, 'discounts' => null, 'additionalCost' => null, 'packagingHandlingCost' => null, 'surcharge' => null, 'trackingDetails' => $this->_createTrackingInfo($shipment->getAllTracks()), 'shippingMethod' => $shipment->getOrder()->getShippingDescription(), 'deliveryWindow' => null, 'shippingWindow' => null, 'shippingMessage' => null);
     return $result;
 }
开发者ID:ridhoq,项目名称:mxpi-twitter,代码行数:5,代码来源:Marketplaceshipment.php

示例4: generateDocuments

 public static function generateDocuments(Mage_Sales_Model_Order_Shipment $shipment)
 {
     $result = array();
     if ($shipment->getDcOrderId() && Mage::getStoreConfig('dc_charge_extension/dccharge/create-documents')) {
         $helper = Mage::helper('dccharge');
         $params = array();
         $params['calculation_id'] = $shipment->getDcOrderId();
         $params['output_currency'] = $shipment->getOrder()->getOrderCurrencyCode();
         $params['seller_first_name'] = Mage::getStoreConfig('dc_charge_extension/dccharge/seller-first-name');
         $params['seller_last_name'] = Mage::getStoreConfig('dc_charge_extension/dccharge/seller-last-name');
         $params['seller_country'] = Mage::getStoreConfig('dc_charge_extension/dccharge/seller-country');
         $params['seller_address_line_1'] = Mage::getStoreConfig('dc_charge_extension/dccharge/seller-address-line');
         $params['seller_city'] = Mage::getStoreConfig('dc_charge_extension/dccharge/seller-city');
         $params['seller_zip'] = Mage::getStoreConfig('dc_charge_extension/dccharge/seller-postcode');
         $params['seller_phone'] = Mage::getStoreConfig('dc_charge_extension/dccharge/seller-phone');
         $params['shipment_invoice_no'] = $shipment->getIncrementId();
         $params['shipment_date'] = $shipment->getCreatedAt();
         $params['shipment_number_parcels'] = 1;
         $params['shipment_total_actual_weight'] = 0;
         foreach ($shipment->getAllItems() as $item) {
             $orderItem = $item->getOrderItem();
             $product = Mage::getModel('catalog/product')->load($orderItem->getProductId());
             if ($orderItem->getParentItemId() || !$orderItem->getQuoteItemId() || $product->isVirtual()) {
                 continue;
             }
             $itemWeightInKG = 0;
             if ($item->getWeight()) {
                 $weigthUnit = Mage::getStoreConfig('dc_charge_extension/dccharge/weight-unit');
                 $weight = Mage::getStoreConfig('dc_charge_extension/dccharge/allow-override-products-weight') ? Mage::getStoreConfig('dc_charge_extension/dccharge/overridden-products-weight') : $item->getWeight();
                 if ($weigthUnit == 'lb') {
                     $itemWeightInKG = round($weight * 0.45359237, 2);
                 } else {
                     $itemWeightInKG = $weight;
                 }
             }
             $params['shipment_total_actual_weight'] += $itemWeightInKG * $item->getQty();
         }
         $params['shipment_currency_sale'] = $shipment->getOrder()->getOrderCurrencyCode();
         if ($shipment->getDeliveryDutyType() == Dutycalculator_Charge_Helper_Data::DC_DELIVERY_TYPE_DDP) {
             $params['shipment_incoterms'] = 'DDP';
         } elseif ($shipment->getDeliveryDutyType() == Dutycalculator_Charge_Helper_Data::DC_DELIVERY_TYPE_DDU) {
             $params['shipment_incoterms'] = 'DAP';
         } else {
             $params['shipment_incoterms'] = '';
         }
         $shippingAddress = $shipment->getShippingAddress();
         $billingAddress = $shipment->getBillingAddress();
         $params['shipto_first_name'] = $shippingAddress->getFirstname();
         $params['shipto_last_name'] = $shippingAddress->getLastname();
         $params['shipto_address_line_1'] = $shippingAddress->getStreet(-1);
         $params['shipto_city'] = $shippingAddress->getCity();
         $params['shipto_zip'] = $shippingAddress->getPostcode();
         $params['shipto_country'] = $shippingAddress->getCountryId();
         $params['shipto_phone'] = $shippingAddress->getTelephone();
         $params['soldto_first_name'] = $billingAddress->getFirstname();
         $params['soldto_last_name'] = $billingAddress->getLastname();
         $params['soldto_address_line_1'] = $billingAddress->getStreet(-1);
         $params['soldto_city'] = $billingAddress->getCity();
         $params['soldto_zip'] = $billingAddress->getPostcode();
         $params['soldto_country'] = $billingAddress->getCountryId();
         $params['soldto_phone'] = $billingAddress->getTelephone();
         $params['print_first_name'] = Mage::getStoreConfig('dc_charge_extension/dccharge/seller-first-name');
         $params['print_last_name'] = Mage::getStoreConfig('dc_charge_extension/dccharge/seller-last-name');
         $params['print_date'] = date('Y-m-d');
         $rawXml = $helper->sendRequest('documents', $params);
         try {
             if (stripos($rawXml, '<?xml') === false) {
                 throw new Exception($rawXml);
             }
             $answer = new SimpleXMLElement($rawXml);
             $commercialInvoice = current($answer->xpath('commercial-invoice'));
             $packingList = current($answer->xpath('packing-list'));
             $result['commercial_invoice_url'] = (string) $commercialInvoice->url;
             $result['packing_list_url'] = (string) $packingList->url;
         } catch (Exception $ex) {
             Mage::logException($ex);
         }
     }
     return $result;
 }
开发者ID:Fishead-Communications,项目名称:dutycalculator_charge_import_duty,代码行数:80,代码来源:Importdutytaxes.php

示例5: _filterShipment

 /**
  * @param Mage_Sales_Model_Order_Shipment $shipment
  *
  * @return Bronto_Common_Model_Email_Template_Filter
  */
 protected function _filterShipment(Mage_Sales_Model_Order_Shipment $shipment)
 {
     $this->setStoreId($shipment->getOrder()->getStoreId());
     if (!in_array('shipment', $this->_filteredObjects)) {
         $index = 1;
         foreach ($shipment->getAllItems() as $item) {
             $_item = $item->getOrderItem();
             if (!$_item->getParentItem()) {
                 $this->_filterOrderItem($_item, $index);
                 $index++;
             }
         }
         $createdAt = $shipment->getCreatedAtStoreDate();
         if (empty($createdAt)) {
             // unset the blank string to force current timestamp
             $createdAt = null;
         }
         // Add Related Content
         $this->_items = $shipment->getAllItems();
         $this->setField('shipmentIncrementId', $shipment->getIncrementId());
         $this->setField('shipmentCreatedAt', Mage::helper('core')->formatDate($createdAt, 'long', true));
         // TODO: needed?
         $this->setField('shipmentItems', $this->_filterShipmentItems($shipment));
         $this->setField('shipmentTracking', $this->_getShipmentTrackingNumber($shipment, $shipment->getOrder()));
         $this->_filteredObjects[] = 'shipment';
     }
     return $this;
 }
开发者ID:bevello,项目名称:bevello,代码行数:33,代码来源:Filter.php


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