Try the Demo

Magento Forum

   
Get variable in observer from block
 
arthurio
Jr. Member
 
Total Posts:  10
Joined:  2012-10-11
 

Hey everyone.
I have event:

<frontend>
        <
events>
            <
payment_method_is_active>
            <
observers>
                <
customer_group_check>
                    <class>
company_modulename_model_payment_observer</class>
                    <
method>methodIsAvailable</method>
                </
customer_group_check>
            </
observers>
          </
payment_method_is_active>
        </
events>
</
frontend>
Also, I have a block, which dynamically creates necessary fields in back-end.
I want to get values from this block to my observer, but not these values, which are saved. I need variables which i declared in block class.
In block function I have(included only necessary part):
protected function _getFieldHtml($fieldset$payment)
    
{
        $paymentCode 
$payment->getId();
I need this $paymentCode variable to my observer.
If you need more details, just ask.
Many thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Siggi_Schmitz
Guru
 
Avatar
Total Posts:  515
Joined:  2011-07-03
 

Make a dispatchEvent() in the block with $paymentCode as parameter and catch your event with your observer.

 Signature 

Magento Freelancer.

Need an extension? Feel free to contact me!

Web: http://www.sig-tec.de
E-Mail:
Skype: sig-tec
Xing: https://www.xing.com/profile/Siegfried_Schmitz2
Profil auf freelance.de
Profil auf freelancermap.de

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top