How do i get price value with tax

  • Posts: 57
  • Thank you received: 1
9 years 11 months ago #181549

-- HikaShop version -- : 2.3.4
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.5.14-1

hi

How do i get price value with tax in my custom module
I only get price value (without tax)

        <span class="price"> <?php
					    if($this->component=="com_hikamarket") 
		     {     
		     $msrpCurrencied = $currencyClass->convertUniquePrice($item->price_value,$mainCurr,$currCurrency);
			if($msrpCurrencied == $item->price_value)
				$price= $currencyClass->format($item->price_value,$mainCurr); 
			else
				$price= $currencyClass->format($msrpCurrencied,$currCurrency).' ('.$currencyClass->format($item->price_value,$mainCurr).')';
		       
		echo $price."<br/><a href='".JRoute::_("index.php?option=com_hikamarket&ctrl=vendor&task=show&cid=" . $item->extra_id."&name=".$item->vendor_name)."'>".$item->vendor_name."</a><br/>";
	    }
                           
                                ?> </span>

Last edit: 9 years 11 months ago by Jerome. Reason: [code] is nice !

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
9 years 11 months ago #181564

Hi,

You have to use $item->price_value_with_tax instead of $item->price_value

Please Log in or Create an account to join the conversation.

  • Posts: 57
  • Thank you received: 1
9 years 11 months ago #181630

hi xavier
I did already try it in my code but then just get 0

<span class="price"> <?php
if($this->component=="com_hikamarket") {
	$msrpCurrencied = $currencyClass->convertUniquePrice( $item->price_value_with_tax,$mainCurr,$currCurrency);
	if($msrpCurrencied ==  $item->price_value_with_tax)
		$price= $currencyClass->format($item->price_value,$mainCurr);
	else
		$price= $currencyClass->format($msrpCurrencied,$currCurrency).' ('.$currencyClass->format( $item->price_value_with_taxe,$mainCurr).')';

	echo $price."<br/><a href='".JRoute::_("index.php?option=com_hikamarket&ctrl=vendor&task=show&cid=" . $item->extra_id."&name=".$item->vendor_name)."'>".$item->vendor_name."</a><br/>";
}

?> </span>
thanks in advance

Last edit: 9 years 11 months ago by Jerome. Reason: [code] is nice !

Please Log in or Create an account to join the conversation.

  • Posts: 26146
  • Thank you received: 4026
  • MODERATOR
9 years 11 months ago #181659

Hi,

What is your module ?
Where the variables come from ?
What is exactly "$item" ?
What's the exact result you got ?

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

Time to create page: 0.069 seconds
Powered by Kunena Forum