VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: buzzbored on October 28, 2016, 19:15:29 PM

Title: Total Value of Products In Inventory
Post by: buzzbored on October 28, 2016, 19:15:29 PM
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?
Title: Re: Total Value of Products In Inventory
Post by: kishoreonwork on October 29, 2016, 21:14:37 PM
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
Title: Re: Total Value of Products In Inventory
Post by: buzzbored on November 01, 2016, 21:13:05 PM
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.
Title: Re: Total Value of Products In Inventory
Post by: pctechnikch on February 12, 2017, 21:02:31 PM
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