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');
},
]]);
}
}