<?php $buttonTitle = __('Invalidate Quotes');?>
<div class="fieldset-wrapper customer-information">
    <div class="fieldset-wrapper-title">
        <span class="title"><?php /* @escapeNotVerified */
echo __('Invalidate customer quote') ?></span>
    <table class="admin__table-secondary">
        <?php echo $block->getChildHtml(); ?>
            <th><?php /* @escapeNotVerified */
echo __('Customer ID:') ?></th>
            <td><?php echo $block->getCustomerId(); ?></td>
            <th><?php /* @escapeNotVerified */
echo __('Invalidate Active Quote:') ?></th>

            <div class="pp-buttons-container">
                <button class="import" id="<?php echo $block->getId() ?>" onclick="return false;">
                    <span><span><span><?php echo 'Remove Active Quote'; ?></span></span></span>


<script type="text/javascript">
    require(["jquery",'mage/url'], function($, url){
        "use strict";
        $(document).on('click','.col-action-grouped a',function(){

            url: "/invalidatequote/index/quote",
            type: "POST",
            dataType: 'json',
            data: {data:'success'},
            success: function(response){



My controller vendor\module_name\Controller\Adminhtml\Index\Quote.php


namespace vendor\module_name\Controller\Adminhtml\Index;

class Quote extends \Magento\Backend\App\Action
    protected $resultPageFactory;

    public function __construct(
        \Magento\Backend\App\Action\Context $context,
        \Magento\Framework\Controller\Result\JsonFactory $resultPageFactory
    ) {
        $this->resultPageFactory = $resultPageFactory;

    public function execute()
        if ($this->getRequest()->isAjax()) {

            echo "Testing";

        return false;

Request URL: https://localhost/admin/customer/index/edit/id/710825/key/51d5c1c3a251b6c0ce8b36ce3d832b2b1f359c8f073691f8c1df296ebf4a22c5/invalidatequote/index/quote?isAjax=true

Request Method: POST

Status Code: 200

Remote Address:

Referrer Policy: no-referrer-when-downgrade

routes.xml vendor\module_name\etc\adminhtml\routes.xml

    <?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="admin">
        <route id="invalidatequote" frontName="invalidatequote">
            <module name="module_name" before="Magento_Backend"/>
  • Testing printed in response or not? – Naresh Rupareliya Dec 16 '19 at 13:12
  • not getting any response – jibin george Dec 16 '19 at 13:13
  • can u please print Testing outside function and check – Naresh Rupareliya Dec 16 '19 at 13:14
  • 2
    Please write base_url/invalidatequote/index/quote in browser directly and check your contoroller called or not. we just want to check if your controller called successfully so we need to only check in phtml file – Naresh Rupareliya Dec 16 '19 at 13:33
  • 1
    e.g, this is your base_url => localhost.com/, type something like this and hit localhost.com/admin/invalidatequote/index/quote – Partab Saifuddin Zakir Dec 16 '19 at 13:33

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.