Add Custom Row Action in PrestashopAdminController Module

I want to add a download button for each line in the moduleadmincontroller helper.

I tried to add it using the following code in the RenderList function. But it does not work.

$this->addRowAction('download');

Please let me know if I can add custom actions for each line and how to handle it.

+4
source share
1 answer

, , ('view', 'edit', 'delete', 'duplicate'); , , . , your_prestashop/controller/admin/AdminRequestSqlController.php 'export'

          $this->addRowAction('export');

displayExportLink(),

         public function displayExportLink($token, $id)
{
    $tpl = $this->createTemplate('list_action_export.tpl');

    $tpl->assign(array(
        'href' => self::$currentIndex.'&token='.$this->token.'&
                     '.$this->identifier.'='.$id.'&export'.$this->table.'=1',
            'action' => $this->l('Export')
    ));

    return $tpl->fetch();
}

initProcess() initcontent() -

public function initProcess()
{
    parent::initProcess();
    if (Tools::getValue('export'.$this->table))
    {
        $this->display = 'export';
        $this->action = 'export';
    }
}
+5

All Articles