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 1


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


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.