Show total amount of products

Hello, can anyone tell me is it available to show Product inventory on the front-page?



Please see attached image and you will understand what I mean much better.



Thank you.





Hello easyshop,



Thank you for your message.



Some code modifications are required to implement this feature. We would be happy to assist you in this matter within our technical support service. Please contact us via Customer Help Desk if you have support credits or an active support period.



Thank you.





Pavel Zyukin

CS-Cart Support team

Create a custom block (see elsewhere on how to do this in V3).

Inside that block's code, use a variable named {$my_total_product_inventory} and whatever other text/formattting you want.

In your my_changes directory, create a directory/file named controllers/customer/index.pre.php

In this file do:


Registry::get('view')->assign('my_total_product_inventory', db_get_field("SELECT sum(pi.amount) FROM ?:products as p LEFT JOIN ?:products_options_inventory AS pi ON p.product_id=pi.product_id WHERE p.status = 'A'));


This should put your total inventory amount into the variable $my_total_product_inventory. Note that if you have a very large number of products this could slow things appreciably. But for most all stores, you probably won't notice the difference.



Then add your custom block wherever you wan in the block manager.

[color=#282828][font=arial, verdana, tahoma, sans-serif]whether it is possible in more detail? not work for me. thanks[/font][/color]

someone help?