Jump to content

Products and Stock Levels


Ggib

Recommended Posts

Please can you explain how we can see our actual stock levels on the site.

We can see the total number of products listed and within each listed product we can obviously see our stock levels but is there anywhere to see the total stocks at a glance rather than having to do the maths?

Any help would be appreciated.

Thanks.

Link to comment
Share on other sites

Hi

I am assuming that you are talking about total stock levels on the admin side across all products (not clear from your question if you mean fro t end or back end) and if so, then no but I cannot understand why you would ever need to know how many total products you have in stock ? It would be possible to write a simple sql query to calculate this if you really do want this figure - it would be a bit more complicated if you use stock levels on product options though

Ian

Link to comment
Share on other sites

I am talking about on the admin side (ie backend).

If for example I have 6 products available with different stock levels available in each (for example, 3,5,4,6,2 & 0) then my total stock portfolio would be 20 but my total number of products would be 6.

On the admin side you can see a total product level but not a total stock level which seems surprising seeing as the only mathematical calculation needed within the site would be to add up the stock numbers within all the products that actually contain stock omitting any with no stock.

Is there really no where this is displayed at all on the admin side?

Link to comment
Share on other sites

I am talking about on the admin side (ie backend).

If for example I have 6 products available with different stock levels available in each (for example, 3,5,4,6,2 & 0) then my total stock portfolio would be 20 but my total number of products would be 6.

OK although I still cant see any real reason why this figure would be useful

Is there really no where this is displayed at all on the admin side?

No there isnt and as never come across this as a requirement from any other site either via clients or any one on here it is t something that is in big demand.

However, several solutions already offered on here which is exporting inventory and calculating via Excel or simply using MySQL to calculate

Ian

Link to comment
Share on other sites

In the file /admin/skins/default/templates/dashboard.index.php, near line 227 (CC6b7):

Find:
         <legend>{$LANG.dashboard.title_inventory_data}</legend>
         <dl>
            <dt>{$LANG.dashboard.inv_customers}</dt>
            <dd>{$COUNT.customers}</dd>
            <dt>{$LANG.dashboard.inv_products}</dt>
            <dd>{$COUNT.products}</dd>
 
Add after:
            <dt>Aggregate Inventory</dt>
            <dd>{$COUNT.inventory}</dd>

In the file /admin/sources/dashboard.index.inc.php, near line 281:

Find:
$GLOBALS['main']->addTabControl($lang['dashboard']['title_store_overview'], 'advanced');

$count = array(
    'products' => (int)$GLOBALS['db']->count('CubeCart_inventory', 'product_id'),
    'orders' => (int)$GLOBALS['db']->count('CubeCart_order_summary', 'cart_order_id'),
    'customers' => (int)$GLOBALS['db']->count('CubeCart_customer', 'customer_id'),
);

Add after:
$inventory_stock_levels['inventory'] = $GLOBALS['db']->select('CubeCart_inventory', array('product_id', 'stock_level'));
$inventory_stock_levels['matrix'] = $GLOBALS['db']->select('CubeCart_option_matrix', array('DISTINCT' => 'product_id', 'SUM' => 'stock_level'));
foreach ($inventory_stock_levels['inventory'] as $result_record) $count['inventory'][$result_record['product_id']] = $result_record['stock_level'];
unset($result_record);
foreach ($inventory_stock_levels['matrix'] as $result_record) $count['inventory'][$result_record['product_id']] = $result_record['SUM_stock_level'];
unset($result_record);
$count['inventory'] = array_sum($count['inventory']);
This will get the main stock levels and options stock levels. For each product, it's main stock level will be used unless there is an options matrix table for the product. If there is an options matrix table, the sum total of stock levels amongst all option variants will be used - replacing the main stock level count for that product.

 

You will see this value in admin, Dashboard, Store Overview tab.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...