-- HikaShop version -- : 4.3.0
-- Joomla version -- : 3.9.19
Hello,
My client is currently using a series of MetaMod modules to display various free shipping options dependent on various settings.
I'm updating the site to the latest versions etc and trying to port this older code. However I cannot seem to get the cart values currently for this code to function fully:
$maxv = 50;
$minv = 30;
$spendmoretotal = $cart->total->prices[0]->price_value_with_tax;
echo $spendmoretotal;
if ($spendmoretotal > $minv && $spendmoretotal < $maxv) {
$total2 = $maxv - $spendmoretotal;
$formattedNum = number_format($total2, 2);
echo '<p style="text-align:left;">Spend another £'.$formattedNum.' to get free shipping</p>';
}
// BAR
$scale = 1.0;
// Get Percentage out of 100
$percent = ($spendmoretotal * 100) / $maxv;
echo '<div class="percentbar" style="width:'.round(100 * $scale).'%;"><div style="width:'.round($percent * $scale).'%;"></div></div>';
My issue appears to be the
$cart->total->prices[0]->price_value_with_tax piece. Looking at the older version fo the code it had an include to load a helper.php file from Hikashop. However even when I try this older include code nothing is being displayed.
What is the correct code now to include the helper.php files that would give me the $cart variables?
Thanks