Jump to content

Edit History

cybermad

cybermad

Bonjour,

J'ai fait un remplacement classique "la classe AdminCustomersController étend AdminCustomersControllerCore" qui ajoute n'importe quelle colonne, qui contient un lien. Le lien a besoin de l'id_customer pour fonctionner mais je ne sais pas comment l'obtenir. Je cherche depuis plus de 5 heures ...

L'élément "contexte" ne fonctionne pas. C'est tout ce dont j'ai besoin. Obtenez customer_id ...



    



     
    
 
             
                  
                  
                  
                  false,
                'prefix' => '<a href="?controller=AdminMemberPlanDetail&token=' .$token . '&id_customer=' . $this->context->customer->id .'">',
                'suffix' => '</a>'
            )
        )
        );
        $this->_select .= ', (
        SELECT abo.expir_on FROM ' . _DB_PREFIX_ . 'ps_member_plan_detail abo WHERE abo.id_customer =  a.id_customer) as abonnement ';

        
    

Merci de votre aide.

MODIFICATEUR: Prestashop 1.7.3

cybermad

cybermad

Bonjour,

J'ai fait un remplacement classique "la classe AdminCustomersController étend AdminCustomersControllerCore" qui ajoute n'importe quelle colonne, qui contient un lien. Le lien a besoin de l'id_customer pour fonctionner mais je ne sais pas comment l'obtenir. Je cherche depuis plus de 5 heures ...

L'élément "contexte" ne fonctionne pas. C'est tout ce dont j'ai besoin. Obtenez customer_id ...

<?php

class AdminCustomersController  extends AdminCustomersControllerCore

{

    public function renderList()
    {

        $token = Tools::getAdminTokenLite('AdminMemberPlanDetail');
        $this->fields_list = array_merge($this->fields_list, array(
            'abonnement' => array(
                'title' => $this->trans('Abonnement', array(), 'Admin.Global'),
                'maxlength' => 30,
                'orderby' => false,
                'search' => false,
                'prefix' => '<a href="?controller=AdminMemberPlanDetail&token=' .$token . '&id_customer=' . $this->context->customer->id .'">',
                'suffix' => '</a>'
            )
        )
        );
        $this->_select .= ', (
        SELECT abo.expir_on FROM ' . _DB_PREFIX_ . 'ps_member_plan_detail abo WHERE abo.id_customer =  a.id_customer) as abonnement ';

        return parent::renderList();
    }

}

Merci de votre aide.

MODIFIER: Prestashop 1.7.3

cybermad

cybermad

Bonjour,

J'ai fait un remplacement classique "la classe AdminCustomersController étend AdminCustomersControllerCore" qui ajoute n'importe quelle colonne, qui contient un lien. Le lien a besoin de l'id_customer pour fonctionner mais je ne sais pas comment l'obtenir. Je cherche depuis plus de 5 heures ...

L'élément "context" ne fonctionne pas. C'est tout ce dont j'ai besoin. Obtenez customer_id ...



    



     
    
 
             
                  
                  
                  
                  
                     
                  
            
        
           

        
    

Merci de votre aide.

EDIT: Prestashop 1.7.3

cybermad

cybermad

Hello,

I made a classic override "class AdminCustomersController extends AdminCustomersControllerCore" which adds any column, which contains a link. The link needs the id_customer to work but I don't know how to get it. I've been looking for more than 5 hours ...

The "context" element does not work. That's all I need. Get customer_id ...

<?php

class AdminCustomersController  extends AdminCustomersControllerCore

{

    public function renderList()
    {

        $token = Tools::getAdminTokenLite('AdminMemberPlanDetail');
        $this->fields_list = array_merge($this->fields_list, array(
            'abonnement' => array(
                'title' => $this->trans('Abonnement', array(), 'Admin.Global'),
                'maxlength' => 30,
                'orderby' => false,
                'search' => false,
                'prefix' => '<a href="?controller=AdminMemberPlanDetail&token=' .$token . '&id_customer=' . $this->context->customer->id .'">',
                'suffix' => '</a>'
            )
        )
        );
        $this->_select .= ', (
        SELECT abo.expir_on FROM ' . _DB_PREFIX_ . 'ps_member_plan_detail abo WHERE abo.id_customer =  a.id_customer) as abonnement ';

        return parent::renderList();
    }

}

Thanks for your help.

×
×
  • Create New...