Skip to main content
3 of 3
added 471 characters in body
Dhiren Vasoya
  • 9.5k
  • 12
  • 35
  • 59

First you need to update your phtml ajax code like this.

$(document).on('click','.import',function(){
            jQuery.ajax({
            url: '/admin/customimport/index/import',
            type: "POST",
            data: {customimport_id : '<?php echo $this->getRequest()->getParam('icustomimport_id'); ?>'},
            success: function(response){
                console.log('ABCD');
            }
        });

Now replace your controller code like this.

$id = $this->getRequest()->getParams('customimport_id'); 
print_r($id);
exit;

Or try this code.

$postData = $this->getRequest()->getPost(); 
$id = $postData['customimport_id'];
print_r($id);
exit;
Dhiren Vasoya
  • 9.5k
  • 12
  • 35
  • 59