VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: memos on April 15, 2013, 19:47:21 PM

Title: Show how many products sold.
Post by: memos on April 15, 2013, 19:47:21 PM
Is there any way to show how many items from each product sold?
Title: Re: Show how many products sold.
Post by: chetanmadaan on April 16, 2013, 00:10:28 AM
not as of right now... but this can be a good feature for future releases
Title: Re: Show how many products sold.
Post by: memos on April 16, 2013, 14:58:04 PM
I have a code from joomla 1.5 and virtuemart 1 ,which shows sold products in an article.

<?php //echo $custom[8]->value;?>
<?php
require_once JPATH_SITE DS "components" DS "com_virtuemart" DS "virtuemart_parser.php";
/*get product's stock from VM*/
$db = &JFactory::getDBO();
$stock  "SELECT product_sales, product_in_stock FROM #__" VM_TABLEPREFIX "_product p WHERE p.product_publish='Y' AND p.product_id = " $db->Quote($custom[3]->value);
$db->setQuery($stock);
$item $db->loadObject();
                    
$remainingitem $item->product_in_stock;
                    
$itemsold $item->product_sales;
echo $itemsold " bought products";
                    
?>


But it doesn't work for joomla 2.5 and virtuemart 2.There is no virtuemart_parser.php

How will work?
Title: Re: Show how many products sold.
Post by: memos on April 17, 2013, 12:42:58 PM
Anyone?