im trying to create new button in shipping multiple addresses page. When i open addresses.phtml, there's so much button like in code below.

 <div class="actions-toolbar">
        <div class="primary">
            <button type="submit" title="<?php /* @escapeNotVerified */ echo __('Go to Shipping Information') ?>" class="action primary continue<?php if ($block->isContinueDisabled()):?> disabled<?php endif; ?>" data-role="can-continue" data-flag="1"<?php if ($block->isContinueDisabled()):?> disabled="disabled"<?php endif; ?>><span><?php /* @escapeNotVerified */ echo __('Go to Shipping Information') ?></span></button>
        <div class="secondary">
            <button type="submit" data-multiship-item-update="" class="action update" data-role="can-continue" data-flag="0"><span><?php /* @escapeNotVerified */ echo __('Update Qty &amp; Addresses') ?></span></button>
            <button type="button" title="<?php /* @escapeNotVerified */ echo __('Enter a New Address') ?>" class="action add" data-role="add-new-address"><span><?php /* @escapeNotVerified */ echo __('Enter a New Address') ?></span></button>
            <a href="<?php /* @escapeNotVerified */ echo $block->getBackUrl() ?>" class="action back"><span><?php /* @escapeNotVerified */ echo __('Back to Shopping Cart') ?></span></a>

And that submit will send form to AddressesPost.php which got code like below.

public function execute()
        if (!$this->_getCheckout()->getCustomerDefaultShippingAddress()) {
        try {
            if ($this->getRequest()->getParam('continue', false)) {
            } elseif ($this->getRequest()->getParam('new_address')) {
            } else {
            if ($shipToInfo = $this->getRequest()->getPost('ship')) {
        } catch (\Magento\Framework\Exception\LocalizedException $e) {
        } catch (\Exception $e) {
            $this->messageManager->addException($e, __('Data saving problem'));

Like in the code above, there's getParam() which i though that the button send data and the code getParam will know what button did we clicked. But i can't find where or when did the button send data. So my question, how could the code know which button we clicked?

1 Answer 1


Look inside:


The option is:

placeOrderSubmit: 'button[type="submit"]'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.