Row heading add admin catalog

Ask the community for help with CE Phoenix Cart.
Post Reply
User avatar
Pierre_P
Posts: 119
Joined: Fri Mar 12, 2021 5:06 am
Has thanked: 12 times
Been thanked: 5 times

Row heading add admin catalog

Post by Pierre_P »

I am trying to add a qty heading to products in admin example admin/catalog.php?cPath=1 after Status heading i want to put Qty to show how many is in stock for each product.

I tried but not getting it to display.
Also tried siteWide folder.
This code i placed in folder hooks/admin/catalog/show_qty.php

Any help on this pls.

Code: Select all

class hook_admin_catalog_show_qty {

    public function listen_constructPaginator($param) {
        global $table_definition, $db;

        array_splice($table_definition['columns'], 2, 0, [[
            'name' => "Qty",
            'class' => 'text-center',
            'function' => function (&$row) use ($db) {
                $qty_query = $db->query("SELECT products_quantity FROM products WHERE products_id = " . (int)$row['products_id']);
                $qty_result = $qty_query->fetch_assoc();

                return $row($qty_result['products_quantity'] ?? '0');
            },
        ]]);
    }
}
heatherbell
VIP Member
VIP Member
Posts: 2315
Joined: Mon Oct 07, 2019 4:39 am
Has thanked: 31 times
Been thanked: 218 times

Re: Row heading add admin catalog

Post by heatherbell »

The catalog page does not (yet) use the paginator to make the table of contents though it can be injected via JavaScript.
User avatar
Pierre_P
Posts: 119
Joined: Fri Mar 12, 2021 5:06 am
Has thanked: 12 times
Been thanked: 5 times

Re: Row heading add admin catalog

Post by Pierre_P »

I was also about realizing there is as you say not yet one as i assumed there were one...
Javascript, let me see how i mess up

Thanks heather
Post Reply