How to show products in order list



  • copy your AdminOrdersController.php from /controllers/admin to the folder /override/controllers/admin/

    After changing you can see the ordered products with variants on order list.
    Don´t forget to clear the cache!

    change this

    		os.`color`,
    		IF((SELECT so.id_order FROM `'._DB_PREFIX_.'orders` so WHERE so.id_customer = a.id_customer AND so.id_order < a.id_order LIMIT 1) > 0, 0, 1) as new,
    		country_lang.name as cname,
    

    to

    		os.`color`,
    		(SELECT GROUP_CONCAT(odd.product_name SEPARATOR ", ") FROM `'._DB_PREFIX_.'order_detail` odd WHERE odd.id_order = a.id_order) as products,
    		IF((SELECT so.id_order FROM `'._DB_PREFIX_.'orders` so WHERE so.id_customer = a.id_customer AND so.id_order < a.id_order LIMIT 1) > 0, 0, 1) as new,
    		country_lang.name as cname,
    

    and change this

            $this->fields_list = array_merge(
                $this->fields_list,
                [
                    'total_paid_tax_incl' => [
                        'title'         => $this->l('Total'),
                        'align'         => 'text-right',
                        'type'          => 'price',
                        'currency'      => true,
                        'callback'      => 'setOrderCurrency',
                        'badge_success' => true,
                    ],
                    'payment'             => [
                        'title' => $this->l('Payment'),
                    ],
    

    to

            $this->fields_list = array_merge(
                $this->fields_list,
                [
                    'total_paid_tax_incl' => [
                        'title'         => $this->l('Total'),
                        'align'         => 'text-right',
                        'type'          => 'price',
                        'currency'      => true,
                        'callback'      => 'setOrderCurrency',
                        'badge_success' => true,
                    ],
    			'products' => [
    				'title' => $this->l('Products'),
    				'havingFilter' => true,
    				'filter_key' => 'products',
    				
    			],
                    'payment'             => [
                        'title' => $this->l('Payment'),
                    ],
    

    before
    0_1514306264334_7cfdc20e-19b7-4451-979a-18735ab8f4b1-grafik.png


    after changing
    0_1514306286397_f38de6b1-aed3-43eb-957d-8bb04efcb318-grafik.png


 

Looks like your connection to thirty bees forum was lost, please wait while we try to reconnect.