Does anyone could get a help to let the QTY range table showed in the latest VM 3.6.3 and Joomla 3.9 version.
I would buy a coffee for you if you get me a support.
Thank you, friend !
Jacky
I use this in the product details template but there may be cleaner ways using the price & currency models
<?php //GJC
$usermodel = VmModel::getModel ('user');
$currentVMuser = $usermodel->getCurrentUser ();
$currentVMuser->shopper_groups[] = '0'; //This allows pricing for ALL Shopper groups to appear
$virtuemart_shoppergroup_ids = $currentVMuser->shopper_groups;
$virtuemart_shoppergroup_id_str = implode(',',$virtuemart_shoppergroup_ids);
$db = JFactory::getDBO();
$sql = "
SELECT
product_price, price_quantity_start, price_quantity_end
FROM #__virtuemart_product_prices
WHERE
virtuemart_product_id = '".$this->product->virtuemart_product_id."'
AND
virtuemart_shoppergroup_id IN (".$virtuemart_shoppergroup_id_str.")
";
$db->setQuery($sql);
$prices = $db->loadObjectList();
#print 'Debug Line '.__LINE__.' $prices <pre>'; print_r ($prices); print "</pre><br />\n";
if(!empty ($prices) && count($prices) > 1){
?>
<div class="qprices_product">
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="pdqprices">
<tr>
<tr>
<td class="pheader"><?php echo vmText::_('COM_VIRTUEMART_PRODUCT_QUANTITY_LBL') ?></td>
<td class="pheader" align="right"><?php echo vmText::_('COM_VIRTUEMART_CART_PRICE') ?></td>
</tr>
<tr>
<?php
$ct=0;
foreach($prices as $price) {
$price_range = '';
if($price->price_quantity_start > 0){
$price_range .= $price->price_quantity_start.' - ';
}else{
$price_range = '';
}
if($price->price_quantity_end > 9999){
$price_range = str_replace(' -', '',$price_range);
$price_range .= '+';
}else{
$price_range .= $price->price_quantity_end;
}
if($price->price_quantity_end == 0 && $price->price_quantity_start > 0) {
$price_range = ' > '.$price->price_quantity_start;
}
if($price->price_quantity_end == 0 && $price->price_quantity_start == 0) {
$price_range = ' ANY ';
}
if($ct>0) {
echo "</tr>\n<tr>\n";
}
echo "<td class='pinfo'>".$price_range."</td>\n";
//with vat is ($price->product_price*1.21)
echo "<td align='right' class='pinfo'>€ ".number_format($price->product_price, 2, ',', ' ')."</td>\n";
$ct++;
}
?>
</tr>
</table>
</div>
<?php
}
//GJC ?>