Prices do not show with a tax included

  • Posts: 351
  • Thank you received: 14
  • Hikaauction Standard Hikamarket Multivendor Hikaserial Subscription Hikashop Business
3 months 4 weeks ago #307691

-- HikaShop version -- : 4.1.0

Hi, I want to show the variants in listing_img_title, I managed to do it through the code below but the problem is that I can not take the value price_value_with_tax. How can I show price with tax ?

<?php
$productClass = hikashop_get('class.product');
$productClass->getProducts($this->row->product_id);
$products = $productClass->products;
foreach ($products as $product) {
	$variants = $product->variants;
	foreach ($variants as $variant) {
		$vendor_id = $variant->product_vendor_id;
		$sales = $variant->product_sales;
		$price = $this->currencyHelper->format($variant->prices[0]->price_value, $variant->prices[0]->price_currency_id);
	}
}
?>

Last edit: 3 months 4 weeks ago by nicolas.

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

  • Posts: 67119
  • Thank you received: 9946
  • MODERATOR
3 months 4 weeks ago #307698

Hi,
You can do like that:

$taxed_price = $this->currencyHelper->format($this->currencyHelper->getTaxedPrice($variant->prices[0]->price_value, hikashop_getZone(), $this->row->product_tax_id), $variant->prices[0]->price_currency_id);

The following user(s) said Thank You: neo191987

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

Time to create page: 0.051 seconds
Powered by Kunena Forum