or then wait, until possibly someone will create an Extension, one day ...
Please don't send me OC Forum Personal Messages, just contact: email@example.com
OC 184.108.40.206 LIGHT Test Site: http://www.bigmax.ch/shop/
OC 220.127.116.11 V-PRO Test Site: http://www.openshop.li/shop/
My Github OC Site: https://github.com/IP-CAM
2'750 FREE OC Extensions on the World's largest Github OC Repository Archive Site.
Code: Select all
$data['sold_count'] = $this->db->query("SELECT SUM(op.quantity) AS quantity FROM " . DB_PREFIX . "order_product op LEFT JOIN `" . DB_PREFIX . "order` o ON (op.order_id = o.order_id) WHERE o.order_status_id > '0' AND op.product_id = '" . (int)$product_info['product_id'] . "' GROUP BY op.product_id")->row['quantity'];
<?php echo $sold_count; ?>
on the tpl or whatever the twig format is.
You may like these extension : - https://www.opencart.com/index.php?rout ... er=cmsroom
HiHow to show the number of items sold in product page in OpenCart v3? Unfortunately, I don't have any knowledge in php or twig. I tried to find an extension as well, but no luck.
@markjohnson You can just say thank's Qphoria... and me . Download attached extension and count products which are sold...
After installing this ocmod extension do not forget refresh modifications...
I slightly edited Qphoria code, because when the product is not yet sold, we get an error.
Custom OpenCart modules and solutions. You can write PM with additional questions... Extensions you can find here
Users browsing this forum: No registered users and 29 guests