I have a variable in item.phtml
file (order approval extension) in my base folder and I want to pass It to another .phtml
file (one called cart.phtml
). I don’t think cart.phtml
is a child of item.phtml
. The variable is called $postdata
and is just a simple PHP variable and I wish to display the text is holds on the same page as item.phtml
but in another file.
1 Answer
I dont know why you want to do this But you can use Magento registry
for this.
Set data to registry
Mage::register('name-of-registry-key', $postdata);
Get your data
$var = Mage::registry('name-of-registry-key');
Clear registry data
Mage::unregister('name-of-registry-key');