Jump to content

ajaxProcessDetails() not work in prestashop 1.6 to display admin tab details


Recommended Posts

hello 

i have written below code in prestashop 1.5.6.2 and same code in prestashop 1.6.0.6 but its worked fine in version 1.5 but not in 1.6

 

 

public function ajaxProcessDetails()

{
if (($id = Tools::getValue('id')))
{
 
$this->_join = '
LEFT JOIN`'._DB_PREFIX_.'partial_payment_installment_master` pim ON(pim.`id_partialpayment` = a.`id_partialpayment`)';
 
$this->table = 'partialpayment';
$this->className = 'PartialPaymentDetail';
$this->identifier = 'id_installment';
 
$this->_where = 'AND pim.`id_partialpayment` = '.(int)$id;
 
$this->fields_list = array(
'id_partialpayment' => array(
'title' => $this->l('ID'),
'width' => 40,
'align' => 'center'
),
'installment_amount' => array(
'title' => $this->l('Partial Payment ID'),
'width' => 'auto'
),
'installment_due_date' => array(
'title' => $this->l('Installment Due Date'),
'width' => 'auto'
),
'installment_paid_date' => array(
'title' => $this->l('Installment Paid Date'),
'width' => 'auto'
),
'installment_status' => array(
'title' => $this->l('Installment Status'),
'width' => 'auto'
),
'payment_method' => array(
'title' => $this->l('Payment Method'),
'width' => 'auto'
)
);
 
//$this->addRowAction('edit');
//$this->addRowAction('delete');
 
// get list and force no limit clause in the request
$this->getList($this->context->language->id, null, null, 0, false);
 
// Render list
$helper = new HelperList();
$helper->actions = $this->actions;
$helper->list_skip_actions = $this->list_skip_actions;
$helper->no_link = true;
$helper->shopLinkType = '';
$helper->identifier = 'id_partialpayment';
$helper->toolbar_scroll = false;
$helper->orderBy = 'position';
$helper->orderWay = 'ASC';
$helper->currentIndex = self::$currentIndex;
$helper->token = $this->token;
$helper->table = $this->table;
$helper->simple_header = true;
$helper->show_toolbar = false;
$helper->bulk_actions = $this->bulk_actions;
$helper->position_identifier = 'id_partialpayment';
$content = $helper->generateList($this->_list, $this->fields_list);
 
die (Tools::jsonEncode(array('use_parent_structure' => false, 'data' => $content)));
}
}

i want to make admin tab like i have attach image same thing in prestashop 1.6.

post-781913-0-38546300-1399700977_thumb.jpg

Link to comment
Share on other sites

  • 4 months later...

Modify the following file: BOadmin/themes/default/template/helpers/lis/list_action_details.tpl

this:

<a href="{$href|escape:'html':'UTF-8'}" id="details_{$params.action|escape:'html':'UTF-8'}_{$id|escape:'html':'UTF-8'}" title="{$action|escape:'html':'UTF-8'}" onclick="display_action_details('{$id}', '{$controller}', '{$token}', '{$params.action}', {$json_params|escape}); return false" class="btn btn-default">
    <i class="icon-question-sign"></i>
</a>

<script type="text/javascript">
    var element = $("#details_{$params.action|escape:'html':'UTF-8'}_{$id|escape:'html':'UTF-8'}");
    var parent = $("#details_{$params.action|escape:'html':'UTF-8'}_{$id|escape:'html':'UTF-8'}").parent().parent().parent().parent().parent();
    parent.append(element.detach());
</script>

Ugly, but work :)

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...