News:

Support the VirtueMart project and become a member

Main Menu

Show how many products sold.

Started by memos, April 15, 2013, 19:47:21 PM

Previous topic - Next topic

memos

Is there any way to show how many items from each product sold?

chetanmadaan

not as of right now... but this can be a good feature for future releases

memos

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?