Jump to content

genrateList


Recommended Posts

Hello,

I have a problem, i have develop an function who will generate a list of product

 

public function CreateListProductBySeller(){
        $ProductOrder = SellerOrder::getProductBySeller($_GET['id'], $_GET['id_seller']);
        // var_dump($ProductOrder);die();
        foreach ($ProductOrder as $key => $value) {
            $ProductOrder[$key]['price'] = $value['tax'] * $value['price'] + 0;
        }

        /* var_dump($ProductOrder);die();*/
         $this->fields_list = array(
            'id_product' => array(
                    'title' => 'Id du produit',
                    'type' => 'text',
            ),

            'name' => array(
                    'title' => 'Nom du produit',
                    'type' => 'text',
            ),

            'quantity' => array(
                    'title' => 'quantité',
                    'type' => 'text',
                    'align' => 'center',
            ),

            'price' => array(
                    'title' => 'Prix',
                    'type' => 'text',
            ),
            'lot' => array(
                    'title' => 'Lot',
                    'type' => 'text',
            ),

            'replace_lot' => array(
                    'title' => 'remplacement Lot',
                    'type' => 'text',
            ),
            'replace_quantity' => array(
                    'title' => 'remplacement quantité',
                    'type' => 'text',
            ),
            'replace_name' => array(
                    'title' => 'remplacement produit',
                    'type' => 'text',
            ),
            'checked' => array(
                    'title' => 'Statut',
                    'type' => 'bool',
                    'active' => 'status',
            )

          );

        $helper = new HelperList();
        $helper->shopLinkType = '';
        $helper->simple_header = true;
        $helper->listTotal = count($ProductOrder);

        $helper->module = $this->module;
        $helper->identifier = 'id_seller';
        $helper->title = "Liste des produit pour la référence : <bold>" . $ProductOrder[0]['reference'] . "</bold> Du Vendeur : " . $ProductOrder[0]['shop'];
        // $helper->table = 'Delivery';
        $helper->token = $this->token;
        $helper->currentIndex = 'index.php?controller=AdminSellerOrder&inSeller=1&id=' . $_GET['id'];

        return $helper->generateList($ProductOrder, $this->fields_list);
    }

And i call this function in :

 

public function renderList() {

        $this->context->controller->addCSS(_PS_MODULE_DIR_.'/jmarketplace/views/css/disabledClickActive.css');

        if (Tools::isSubmit('submitResetconfiguration')) {
            return $this->resetFilters();
        }
        if (isset($_GET['inOrder']) && !isset($_POST['submitFilterconfiguration']) && !isset($_GET['configurationOrderby'])) {
            
            return $this->CreateListCustomersById().$this->CreateListSellerByOrder();
        }

        if (isset($_GET['inSeller'])) {
            return $this->CreateListProductBySeller();
            
        }

But when i call this function is open a new page with my list, but i want to  when i call my function to generate my list is display in my current page but i don't know how to do.

If anyone have a idea thank you to share this

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...