Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

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
Enthusiast
 
Avatar
Total Posts:  811
Joined:  2011-07-03
 

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

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