0

我可以为来自 magento increment_id 的订单生成 adminhtml“查看订单”网址,如下所示:

<?php
$order_id = Mage::getModel('sales/order')->loadByIncrementId('100001234')->getId();
?>
<a href="<?php echo Mage::helper('adminhtml')->getUrl('adminhtml/sales_order/view', array('order_id' => $order_id)) ?>">
    Click here to view order
</a>

我想在装运方面达到同样的效果。我有我以编程方式生成的发货的 increment_id。

有没有办法通过发货增量 id 生成一个 adminhtml“查看发货”网址(就像我在上面为查看订单所做的那样)?

4

2 回答 2

2

那将是这样的:

<?php
  $shipment_id = Mage::getModel('sales/order_shipment')
    ->loadByIncrementId($shipmentIncrementId)
    ->getId();

  $shipment_url = Mage::helper('adminhtml')
    ->getUrl(
      'adminhtml/sales_order_shipment/view',
      array('shipment_id' => $shipment_id));
?>
<a href="<?php echo $shipment_url ?>">
  Click here to view shipment
</a>
于 2013-06-07T08:41:42.497 回答
0
hi you can use below code
 $shipment = Mage::getModel('sales/order_shipment')->loadByIncrementId($shipmentIncrementId);

and can get more information from magento documnet
http://docs.magentocommerce.com/Mage_Sales/Mage_Sales_Model_Order_Shipment.html( search for http://docs.magentocommerce.com/Mage_Sales/Mage_Sales_Model_Order_Shipment.html)

and http://www.magentodocs.org/1.7.0.2/db/dec/app_2code_2core_2_mage_2_sales_2_model_2_order_2_shipment_2api_8php_source.php()( search for  public function info($shipmentIncrementId))
于 2013-05-31T19:11:07.743 回答