public function ItemEditForm()
    {
        $form = parent::ItemEditForm();
        $printlink = $this->Link('printorder') . '?print=1';
        $printwindowjs = <<<JS
            window.open('$printlink', 'print_order', 'toolbar=0,scrollbars=1,location=1,statusbar=0,menubar=0,resizable=1,width=800,height=600,left = 50,top = 50');return false;
JS;
        $form->Actions()->push(
            LiteralField::create(
                'PrintOrder',
                "<button class=\"no-ajax grid-print-button btn action btn-primary font-icon-print\" onclick=\"javascript:$printwindowjs\">"
                . _t('SilverShop\Model\Order.Print', 'Print') . '</button>'
            )
        );

        return $form;
    }
public function ItemEditForm()
    {
        $form = parent::ItemEditForm();
        $printlink = $this->Link('printorder') . '?print=1';
        $printwindowjs = <<<JS
            window.open('$printlink', 'print_order', 'toolbar=0,scrollbars=1,location=1,statusbar=0,menubar=0,resizable=1,width=800,height=600,left = 50,top = 50');return false;
JS;
        $form->Actions()->push(
            LiteralField::create(
                'PrintOrder',
                "<button class=\"no-ajax grid-print-button btn action btn-primary font-icon-print\" onclick=\"javascript:$printwindowjs\">"
                . _t('SilverShop\Model\Order.Print', 'Print') . '</button>'
            )
        );

        return $form;
    }
public function ItemEditForm ( ) { $ form = parent :: ItemEditForm ( ) ; $ printlink = $ this -> Link ( 'printorder' ) . '?print=1' ; $ printwindowjs =  <<<JS
            window.open('$printlink', 'print_order', 'toolbar=0,scrollbars=1,location=1,statusbar=0,menubar=0,resizable=1,width=800,height=600,left = 50,top = 50');return false;
JS ; $ form -> Actions ( ) -> push ( LiteralField :: create ( 'PrintOrder' , "<button class=\"no-ajax grid-print-button btn action btn-primary font-icon-print\" onclick=\"javascript:$printwindowjs\">" . _t ( 'SilverShop\Model\Order.Print' , 'Print' ) . '</button>' ) ) ; return $ form ; }
Add print button to order detail form
Add print button to order detail form