-- HikaShop version -- : 2.3.3
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.5.14-1
How do i get price value with tax in Search Result plugin
function getPrice($pid) {
$arr = array();
$arr[0] = new stdClass();
$arr[0]->product_id = $pid;
$currency = hikashop_get('type.currency');
$currencyClass = hikashop_get('class.currency');
$zone = hikashop_getZone();
$cur = hikashop_getCurrency();
$currencyClass->getListingPrices($arr,$zone,$cur);
$i=0;
$currPrice = 0;
foreach($arr[0]->prices as $k=>$price) {
if(!$i) {
$currPrice = $price->price_value_with_tax;
}
if($price->price_value_with_tax < $currPrice) $currPrice = $price->price_value_with_tax;
$i++;
}
return $currencyClass->format($currPrice, $cur);
}
Here is a little snippet from the prices what the search plugin gets from hikashop by products:
stdClass Object ( [price_id] => 42 [price_currency_id] => 73 [price_product_id] => 56 [price_value] => 233.64486 [price_min_quantity] => 10 [price_access] => all [price_site_id] => [price_value_with_tax] => 233.64 [taxes] => Array ( ) )
As you can see price and the price with tax is the same ?
anyone with an idea how to i fix this?