在产品页面上不加税的显示价格。

时间:2022-10-25 09:52:27

I am using WooCommerce & WooShop Theme for Wordpress.

我使用WooCommerce & WooShop主题为Wordpress。

I need to display the Product Price EXCLUDING tax on Single Product Page.

我需要在单个产品页面上显示不含税的产品价格。

There are 2 functions if I understand correctly:

如果我理解正确,有两个函数:

$_product->get_price()
$_product->get_price_excluding_tax()

$ _product - > get_price _product - > get_price_excluding_tax美元()()


and this is Price.php (Under Single Product)

这是价格。php(在单一产品)

<p itemprop="price" class="price"><?php echo $product->get_price_html(); ?></p>

which leads to

导致

  'price_html' => '<span class="price">'.$variation->get_price_html().'</span>',

Any ideas?

什么好主意吗?

THANKS!

谢谢!

1 个解决方案

#1


4  

I know this question is old, but here's a go for anyone else looking for an answer to using those functions in the proper way.

我知道这个问题已经过时了,但是对于其他想要用正确的方法来使用这些函数的人来说,这是一个很好的答案。

I found that when I used $_product->get_price_excluding_tax() it would return the full price.

我发现,当我使用$_product-> get_price_ding_tax()时,它将返回全部价格。

However, after adjusting a setting in WooCommerce, it now appears correctly.

然而,在调整了WooCommerce的设置之后,它现在看起来是正确的。

You should tick the box the says "Catalog prices defined including tax".

你应该在方框里标出“包括税金在内的目录价格”。

在产品页面上不加税的显示价格。

You also need to make sure that you have a tax rule setup in the 'Tax' tab. I setup one for UK VAT at 20%.

您还需要确保在“tax”选项卡中设置了税务规则设置。我为英国增值税设定了20%。

在产品页面上不加税的显示价格。

Hope that this helps somebody in future.

希望这能帮助未来的人。

Thanks, Mikey.

谢谢你,米奇。

#1


4  

I know this question is old, but here's a go for anyone else looking for an answer to using those functions in the proper way.

我知道这个问题已经过时了,但是对于其他想要用正确的方法来使用这些函数的人来说,这是一个很好的答案。

I found that when I used $_product->get_price_excluding_tax() it would return the full price.

我发现,当我使用$_product-> get_price_ding_tax()时,它将返回全部价格。

However, after adjusting a setting in WooCommerce, it now appears correctly.

然而,在调整了WooCommerce的设置之后,它现在看起来是正确的。

You should tick the box the says "Catalog prices defined including tax".

你应该在方框里标出“包括税金在内的目录价格”。

在产品页面上不加税的显示价格。

You also need to make sure that you have a tax rule setup in the 'Tax' tab. I setup one for UK VAT at 20%.

您还需要确保在“tax”选项卡中设置了税务规则设置。我为英国增值税设定了20%。

在产品页面上不加税的显示价格。

Hope that this helps somebody in future.

希望这能帮助未来的人。

Thanks, Mikey.

谢谢你,米奇。