cancel
Showing results for 
Search instead for 
Did you mean: 

Add field to a confirmation block message

Add field to a confirmation block message

I need to add a field in my confirmation message in the block. I have my class here

class PMC_Manutention_Model_Observer extends Mage_Adminhtml_Block_Widget_Form_Container
{
    public function adminhtmlWidgetContainerHtmlBefore(Varien_Event_Observer $observer) {
        $block = $observer->getEvent()->getBlock();
        if ($block instanceof Mage_Adminhtml_Block_Sales_Order_View) {
            $order = $block->getOrder();
            if($order->hasShipments()){
                $message = Mage::helper('sales')->__('Are you sure you want to regenerate the stickers and resend the new tracking number to customer?');
              
                $block->addButton('order_Sticker_bouton', array(
                    'label'     => Mage::helper('sales')->__('Print Sticker'),
                    'onclick'   => "confirmSetLocation('{$message}', '{$this->getPrintStickerUrl($order)}')",
                ));   
            }
        }  
        
    }

 

I need to add a field like this

$block->addField('nb_sticker', 'text', array(
                    'name'      => 'nb_sticker',
                    'label'     => Mage::helper('sales')->__('nb sticker'),
                    'title'     => Mage::helper('sales')->__('nb sticker'),
                    'required'  => true,
                ));

 

any idea how to do that?
thanks for advance

2 REPLIES 2

Re: Add field to a confirmation block message

Hi @bakaye

 

Can you please elaborate what you want to do? Because, the way you are trying to do will not help you add the field.

Was my answer helpful? You can Click Kudos/Accept As Solution.
200+ professional extensions for M1 & M2 with free lifetime updates!

Re: Add field to a confirmation block message