0

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.

2

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');   

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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