QUICK TIP: If you want to publicly display how many customers bought the product, and the total amount of products sold...
DEMO
1) In /reboot/get_product_info.php
Before...
Insert...
Code:
# Get amount of people who bought this product
$users_bought_qry = db_query("SELECT COUNT(DISTINCT(userid)) AS total FROM $sql_tbl[order_details_stats] WHERE productid='$productid';");
$users_bought_result = db_fetch_array($users_bought_qry);
$smarty->assign("buyers", $users_bought_result);
# Get amount of products sold
$product_sales_qry = db_query("SELECT SUM(sum_amount) AS total FROM $sql_tbl[order_details_stats] WHERE productid='$productid' GROUP BY productid");
$product_sales_result = db_fetch_array($product_sales_qry);
$smarty->assign("sales", $product_sales_result);
2) In /skin/reboot/customer/main/product_header.tpl
Before...
Code:
{if $config.Reboot.reboot_product_added_modified_details eq "Y"}
Insert...
Code:
{if $buyers.total && $buyers.total gte "2"}
<div class="col-12 col-md-auto mr-md-4 mt-3 mt-md-2">Buyers: <span class="badge badge-pill badge-dark float-right float-md-none">{$buyers.total}</span></div>
{/if}
{if $sales.total && $sales.total gte "2"}
<div class="col-12 col-md-auto mr-md-4 mt-3 mt-md-2">Sales: <span class="badge badge-pill badge-dark float-right float-md-none">{$sales.total}</span></div>
{/if}
Or, do something like...
Code:
{if ($buyers.total && $buyers.total gte "2") && ($sales.total && $sales.total gte "2")}
{capture name=alert}
<b>{$buyers.total}</b> people bought <b>{$sales.total}</b> of these!
{/capture}
{include file="customer/alert.tpl" content=$smarty.capture.alert close=true type="success" icon="check"}
{/if}
Maybe useful if you have healthy sales