I created a button in order view page of magento 1.9.x with the following guide: https://www.siphor.com/add-custom-buttons-to-order-view-pages-in-magento/. I edited the Observer like my needs:

class Siphor_Custombuttons_Model_Observer
    public function addButtons($observer)

$block = $observer->getBlock();

if ($block instanceof Mage_Adminhtml_Block_Sales_Order_View) {

            $message = Mage::helper('core')->__('Sei sicuro di voler chiamare?');
            $block->addButton('custom_button', array(
                'label'     => Mage::helper('core')->__('Chiama'),
                'onclick'   => "if(confirm('Sicuro di voler chiamare?'))window.open('https://api.api/?api=$customerphonenumber');",
                'class'     => 'go'

So like you can see i need to start a call to customer on button click but i can't get customer phone number to put it in the variable for the API

P.S. If possible I prefer to send directly a POST request to my API instead of open a new window with a GET request

Your Answer

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

Browse other questions tagged or ask your own question.