Prices do not show with a tax included

  • Posts: 410
  • Thank you received: 15
4 years 9 months 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: 4 years 9 months ago by nicolas.

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

  • Posts: 81379
  • Thank you received: 13037
  • MODERATOR
4 years 9 months 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.056 seconds
Powered by Kunena Forum