I'm working on a script that will give a Magento user directions after selecting warehouse pickup (a plugin option). I already have the rest built. I'm simply missing one variable I need to call on success.phtml (the warehouse ID). The variable is tied to orders via stock_id.
This produces an array: I'm using $order successfully to pull the rest of the info I need for the script.
$order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());
$items = $order->getItemsCollection();
A shortened version of this array: can be printed with print_r($items->getData());
Array
(
[0] => Array
(
[item_id] => 223
[stock_id] => 15
[base_discount_refunded] =>
)
)
When I try to pull the data that I want out:
echo $items[0]['stock_id']; //the page breaks here and stops the page abruptly...
the page breaks and any logic that should take place after is ignored. What would cause this? I tried braking variables I'm calling in other similar arrays. None of my tests have replicated the page breaking. Why is this specific one breaking the page instead of returning 15?