Get Shipment Id Associated with Product

I would use smart debugging to add breakpoint and step through the code in the template that does what you want. When dealing with gigantic code bases like Magento smart debugging is the only equally efficient and effective method. I worked with Magento for two years and I always had to find something in core and step through the logic real-time to figure out how to do things properly. Not tomention there can be rewrites that go unnoticed without stepping through the code real-time. Something might work one way with Magento core but be completely different with an extension that rewrites core functionality.

I got it with:

[code]

<?php $_shipment = Mage::getModel('sales/order_shipment')->loadByIncrementId($shipid); $itemsCollection = $_shipment->getItemsCollection(); foreach($itemsCollection as $item) { $_product = $item->getName(); } echo $_product; ?> [/code]

That’s magento!

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.