tax

Show the tax line when rate is 0% in Woocommerce

有些话、适合烂在心里 提交于 2019-12-11 10:11:06
问题 I’m updating to the latest version of WooCommerce from a very old version. I have noticed that when using the option “Display tax totals: Itemized”, the Tax name is not displayed anymore in the Sub Total line included in Cart page, Checkout page and in any customer e-mail, invoice, etc. The reason appears to be that if the Tax rate is set to 0.0000%, the new version of WooCommerce automatically hides that line after the Sub Total, look below: If I set rates to 1.0000% or whatever, it appears.

Get tax rate used in an order for one product and for shipping in WooCommerce

♀尐吖头ヾ 提交于 2019-12-11 05:26:17
问题 In woocomerce, how to get the tax rate used in an order for one product ? And the tax rate For shipping ? 回答1: You can get the tax data used for an item (product) through WC_Order_Item_Product object and methods: // Get the an occurrence of the WC_Order object (if needed, from a defined $order ID) $order = wc_get_order( $order_id ); // Iterating through WC_Order_Item_Product objects foreach( $order->get_items() as $item_id => $line_item ){ ## -- Get all protected data in an accessible array -

How to integrate JavaScript into a HTML page

谁说我不能喝 提交于 2019-12-10 11:49:43
问题 I am trying to make an HTML website that sells pens, pencils and erasers. My issue is integrating the JavaScript into my HTML page. Everything has been working properly up until the last couple chunks of JavaScript any thoughts on how I could fix this problem. <!DOCTYPE html> <html> <head> <title>Pens, Pencils and Erasers</title> <meta name="description" content="This is the description"> <link rel="stylesheet" href="style.css" /> <script src="store.js" async></script> </head> <body> <header

Remove “estimated for {country}” text after tax amount in Woocommerce checkout page

老子叫甜甜 提交于 2019-12-09 23:58:06
问题 I set up a 19% standard tax amount in my Woocommerce Online-Shop. Unfortunatley - now there is a text "estimated for Germany" behind the (includes 20,12 €... part below the total-amount in my checkout page (see image below). I guess it displays the text because the calculated tax amount has a lot of decimals. HTML <small class="includes_tax"> (includes <span class="woocommerce-Price-amount amount">20.12 <span class="woocommerce-Price-currencySymbol">€<span> </span> estimated for Germany) <

Display Woocommerce product price with and without tax and tax amount

本秂侑毒 提交于 2019-12-04 19:08:20
问题 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. How can I do this? 回答1: 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

Customize Tax amount in “woocommerce_package_rates” hook

女生的网名这么多〃 提交于 2019-12-03 09:01:22
I recently tried to modify all my shipping rates with hook to apply discount. Here's my code : add_filter( 'woocommerce_package_rates', 'woocommerce_package_rates' ); function woocommerce_package_rates( $rates ) { $user_id = get_current_user_id(); if ( ! wc_memberships_is_user_active_member( $user_id, 'silver' ) ) { return $rates; } $discount_amount = 30; // 30% foreach($rates as $key => $rate ) { $rates[$key]->cost = $rates[$key]->cost - ( $rates[$key]->cost * ( $discount_amount/100 ) ); } return $rates; } But one more step is the tax ! I got wrong tax. For example I have my shipping rate who

Python: How do I get user input in the middle of a sentence (fill-in-the-blank style) using the input function?

て烟熏妆下的殇ゞ 提交于 2019-11-30 09:45:47
问题 I am trying to create a program that calculates sales tax. I first ask the user what was the total cost of their meal. I then ask them what is the sales tax of their area in the form of: y = input('What is the sales tax of your area? ') I want to have a percent sign "%" at the end of the question so that the users sees the question as: What is the sales tax of your area?_% , where the user can enter a number between the question and the percent sign (denoted by the underline). This is what I

Python: How do I get user input in the middle of a sentence (fill-in-the-blank style) using the input function?

[亡魂溺海] 提交于 2019-11-29 16:41:38
I am trying to create a program that calculates sales tax. I first ask the user what was the total cost of their meal. I then ask them what is the sales tax of their area in the form of: y = input('What is the sales tax of your area? ') I want to have a percent sign "%" at the end of the question so that the users sees the question as: What is the sales tax of your area?_% , where the user can enter a number between the question and the percent sign (denoted by the underline). This is what I have tried: x = float(input("What is the cost of your meal? ")) y = input("What is the sales tax in

Set different Tax rates conditionally based on cart item prices in Woocommerce

♀尐吖头ヾ 提交于 2019-11-28 13:06:09
In My Wordpress e-commerce web site I use WP Hotel Booking , a plugin for hotel room bookings. The checkout process is done using WooCommerce . The Issue : We have different rooms with different pricing.For example : Room A price - 1500 Room B Price - 2700 Room c price - 2200 GST Tax is set at 12% for rooms wich price is below 2500 and 18% for rooms above 2500. Since I am using WP Hotel Booking for this custom product (room Management), I am unable to use the Additional Tax Classes option in woocommerce to set different tax classes. I need your help in writing a function to check the room