News:

Support the VirtueMart project and become a member

Main Menu

Total Value of Products In Inventory

Started by buzzbored, October 28, 2016, 19:15:29 PM

Previous topic - Next topic

buzzbored

Is there a way to tell with VM what the total value of my inventory is? If so how, if not are there any plugins that will do this?
Joomla 3.5.1, VM 3.0.16, PHP 5.4.x

kishoreonwork

Hello ,


I do believe there is no plugin or module available to show or calculate the total price value of your inventory.

But if you know how to run mysql query from phpmyadmin it is very easy to calculate . I am writting down the query below
SELECT sum((product_in_stock*product_price)) as total_price FROM #__virtuemart_products` as p  join #__virtuemart_product_prices as pr
on p.virtuemart_product_id=pr.virtuemart_product_id


Replace #__ with your joomla database prefix

Thanks
Kishore
I am available for paid joomla and virtuemart consulting.
http://www.kishoreweblabs.com/
skype kishore2607

buzzbored

Thank you, I would think that that would be widely wanted. When I run the script it returns: #1054 - Unknown column 'product_price' in 'field list' is it 'product_prices'? I don't know sql so won't make any changes without a more knowledgeable persons input.
Joomla 3.5.1, VM 3.0.16, PHP 5.4.x

pctechnikch

Many Thanks Kishore. The SQL query works very well. It would be nice, if someone could post the code, that one can integrate this SQL query into the Virtuemart Inventory Template with PHP. I am not a PHP programmer. Maybe someone can help me.

Many Thanks Rene