久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

顯示含稅和不含稅的 Woocommerce 產品價格和稅額

Display Woocommerce product price with and without tax and tax amount(顯示含稅和不含稅的 Woocommerce 產品價格和稅額)
本文介紹了顯示含稅和不含稅的 Woocommerce 產品價格和稅額的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我正在使用 WooCommerce for WordPress,我列出的商品不含稅.

I am using WooCommerce for WordPress and I'm listing items excluding Tax.

我需要單獨顯示價格(不含稅)、稅和價格+稅在產品頁面(如結帳頁面).

I need to show separately the Price (without tax), the Tax and the PRICE + Tax on the product page (like in checkout page).

我還沒有找到可以做到這一點的插件.

I have not been able to find a plugin that does this.

我該怎么做?

推薦答案

WooCommerce v3.0.0 及更高版本
從 WooCommerce 3.0 版開始,函數 woocommerce_price() 已棄用,方法 get_price_include_tax() 也是如此.相反,您應該使用 wc_get_price_including_tax:

WooCommerce v3.0.0 and Later
As of WooCommerce version 3.0, the function woocommerce_price() is deprecated, as is the method get_price_including_tax(). Instead, you should use wc_get_price_including_tax:

<?php echo wc_price( wc_get_price_including_tax( $product ) ); ?>

在 WooCommerce v3.0.0 之前
您需要修改模板.不要修改核心 WooCommerce 模板,而是使用 WooCommerce 模板覆蓋系統將其復制到您的主題中.如需這方面的幫助,請參閱有關使用模板覆蓋系統的 WooCommerce 文檔.

Prior to WooCommerce v3.0.0
You need to modify a template. Do not modify the core WooCommerce template, but rather make a copy of it to your theme, using the WooCommerce template override system. For help with that, refer to the WooCommerce docs on using the template override system.

price.php 模板中,您將在需要包含稅費 (VAT) 的價格的位置添加這段代碼:

In the price.php template, you will add this bit of code where you want the price, including tax (VAT):

<?php echo woocommerce_price( $product->get_price_including_tax() ); ?>

注意:您修改的 price.php 模板應該位于 wp-content/themes/[您的主題文件夾]/woocommerce/single-product/price.php

Note: the price.php template that you modify should be located here in wp-content/themes/[your theme folder]/woocommerce/single-product/price.php

這篇關于顯示含稅和不含稅的 Woocommerce 產品價格和稅額的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Add programmatically a downloadable file to Woocommerce products(以編程方式將可下載文件添加到 Woocommerce 產品)
Get today#39;s total orders count for each product in Woocommerce(獲取今天 Woocommerce 中每種產品的總訂單數)
Add Custom registration fields in WooCommerce and phone field validation issue(在 WooCommerce 和電話字段驗證問題中添加自定義注冊字段)
Add a select field that will change price in Woocommerce simple products(在 Woocommerce 簡單產品中添加一個將更改價格的選擇字段)
Add custom columns to admin products list in WooCommerce 3(在 WooCommerce 3 中將自定義列添加到管理產品列表)
Customizing checkout quot;Place Orderquot; button output html(自定義結帳“下訂單按鈕輸出html)
主站蜘蛛池模板: 超碰在线人人 | 国产精品a久久久久 | 深夜爽视频 | 亚洲一区二区综合 | 99成人| 看a网站 | 黄免费观看视频 | 国产1区在线 | 国产精品毛片 | 欧美精品一区二区三区蜜臀 | 欧美激情精品久久久久 | 免费观看国产视频在线 | 午夜免费福利影院 | 久久精品一级 | 美女黄视频网站 | 亚洲精品一级 | 亚洲成人av| 国产精品成人一区二区三区吃奶 | 色橹橹欧美在线观看视频高清 | 精品久久国产老人久久综合 | 日韩成人在线观看 | 久久成| 欧美精品一区三区 | 国产精品一区二区无线 | 国产在线精品一区 | 亚洲人久久 | 国产高清精品一区二区三区 | 欧美日韩国产在线观看 | 欧美黄色大片在线观看 | 国产免费一区 | 亚洲一区在线日韩在线深爱 | 精品在线一区二区 | 99久久国产精 | 国产在线97| 一区二区中文 | 成人在线观看免费 | 波多野结衣中文字幕一区二区三区 | 激情欧美日韩一区二区 | 国产一区二区免费 | 久久久久久免费毛片精品 | 久久久国产一区 |