It’s been 2 months and countless hours later and I’ve still not been able to fix this.
No matter what I do, taxes are calculated based on the shop's location. I need to only charge taxes if the customer's shipping or billing address is in Illinois.
I have one set of tax rules set, for IL.
Example 1: Base state set to Illinois.
Billing address and shipping address set to California (or any other state).
Customer is charged IL taxes.
Example 2: Base state set to California.
Billing address and shipping address set to Illinois.
Customer is not charged Illinois taxes.
I've tried disabling all plugins and using default theme with no joy.
UPdating with screenshot of current settings
current tax settings
In the docs:
If you use store base address, taxes will always be based on your
store location and not your customer’s location.
So change it to Customer Shipping Address
Read: https://docs.woocommerce.com/document/setting-up-taxes-in-woocommerce/
There is no bug report: https://github.com/woocommerce/woocommerce/issues?utf8=%E2%9C%93&q=shop%20location%20calculation%20. Or any other search string I could think of.
See: https://code.tutsplus.com/articles/the-beginners-guide-to-woocommerce-taxes--cms-22060
And https://docs.woocommerce.com/document/configuring-woocommerce-settings/ for the default customer addresss
Default Customer Address
An online store owner is completely unaware about the location of any
new customer who visits the store. The calculation of taxes becomes
quite difficult at that time. This option lets a store owner to
display prices by assuming a default location before any customer
enters his actual address. You will select ‘Shop base address’
(instead of ‘No address’) in this case an automatic tax correction is
applied once a customer enters his country as his base address.
After comparing hundreds of database rows, I finally narrowed it down to 1 row, which gave details of local shipping. Using that, I did some testing and found that when my local shipping is enabled, it breaks the tax calculation.
I found a solution . The problem is that it calculates from the default store address and always the default location is sent from the function get_tax_location( $tax_class = '', $customer = null ) . So you need to change that to customer address . I can help if anybody need but I am not sure if it will affect any other area .
Thanks
Shan
Related
Is it possible to set a currency per user rather than based on a user's address. So that no matter where in the world a customer was looking at the site they would always see their "home" price? e.g a US based customer always sees the $ price, even if they are currently shopping from Europe.
Ideal solution would be to have a currency selection box in the user profile.
Option 1
Check this WooCommerce Plugin: "The Currency Converter Widget lets you offer a dynamic currency switcher for displaying product prices and totals." "... your customers will be able to change the currency". (It costs extra, though.)
https://woocommerce.com/products/currency-converter-widget/
https://docs.woocommerce.com/document/handle-multiple-regions-currencies-woocommerce/
Option 2
Another plugin. WooCommerce Multi-Currency: "Multi-Currency is a WooCommerce extension that provides switching currencies and re-calculating rates on-the-fly." The user can "Choose the currency using a sidebar widget" and "Pay in the selected currency" (Also costs extra.)
https://woocommerce.com/products/multi-currency/
Here is an overview on the topic:
https://docs.woocommerce.com/document/shop-currency/ -> text on Multiple Currencies
In our project, we have a specific scenario. Basically, we need to set calculation of tax based on:
Shop base address
but that address should be different for each product.
Product A = Address A
Product B = address B
So taxes and currency are then set based on selected product address.
Please does anyone have idea/experience if it is possible in WooCommerce settings somewhere, or it would need plugin/custom PHP code?
Thanks,
J.
I've a site where transactions are based purely on credits. No actual money is exchanged. In such a case, I want to restrict users from adding products to cart if they do not have credits to do so.
In steps of how this should be accomplished, here is the sequence of events which I think should work :
Whenever somebody tries to add a product :
Use Rule "Before adding product to cart"
I need to get the value of the following :
Get user credits
Get sum of current product + cart value
Check for condition if credits is greater than product + cart.
If true, add product to cart else display "Not enough credits".
I use the loyalty points module for the user credits.
How can I set up the rules for this scenario?
Instead of using a module I just used a custom_validation function on commerce_add_to_card_form as suggested by lamp5
The problem
We have created a customer segment and linked both a customer and a price list to this customer segment. The linked price list defines a special price of $5 for one of the products. This product has a 'default' price of $10.
When I login to the storefront with a user that belongs to customer segment, I see the correct price of $5 on the PDP. However once this product is added to the basket, it shows the 'default' product price of $10 in the minicart and on the cart page. I would expect to see $5 there as well.
Technical information
The (correct) price on the PDP is retrieved directly from the ProductBO by using the default ISProductPrice module which links to the default ProductPrice.isml.
<ISProductPrice
ProductBO="#ProductBO#"
Currency="#CurrentRequest:Currency#"
ShowInformationalPrice="true"
RichSnippetsEnabled="#RichSnippetsEnabled#"
>
The (wrong) price on the cart page is retrieved from the BasketComputedProductLineItemBO with the following (default ISH) code
<isif condition="#PriceDisplayType EQ 'net'#">
<isprint value="#PLI:SingleBasePriceNet#">
<iselse/>
<isprint value="#PLI:SingleBasePriceGross#">
</isif>
What I've tried so far
Clear cookies/cache to make sure we have a completely new basket
Made sure the Customer Segmentation Service is enabled (default ISH service).
Tried all the different methods to fetch a price from the BasketComputedProductLineItemBO
Added a couple of different products to the price list
Added a couple of different customers to the customer segment
Ran a search index
Tried to reproduce the issue on the ISH demo server
Checked the documentation on customer segmentation from the ISH support page
Tried to add a customer to the price list directly instead of a customer segment. When doing it this way, everything seems to work as expected.
At this point I'm completely stuck. Any help on how to go from here would be greatly appreciated.
Check this
https://support.intershop.com/kb/index.php/Display/IS-22923
If you search on segment on the support for version 7.9 then you get few bugs. Disable the dynamic segment service because it is buggy. See if that work or else i think you really do have a platform bug here.
Also a good idea to upgrade to the lastest minor version.
I've implemented a filter as per this WooCommerce article on taxes:
add_filter('woocommerce_adjust_non_base_location_prices', '__return_false');
This effectively 'ignores' tax rates on checkout: an €8,99 product (where prices are added inclusive of tax) being sold from a UK store will cost €8,99 to a German customer, a French customer or an ROI customer. This all works fine on the front end.
However, I just created an order in the backend for a German customer, and that €8,99 product is being added to the order at €7,49 with no tax. I understand from a tax perspective why this is happening (a UK store selling in Germany shouldn't apply tax, so 8.99 - 20% UK VAT = 7.49), however this seems to be ignoring my woocommerce_adjust_non_base_location_prices filter.
At the moment my filter call is just a single line in a custom plugin, so being implemented at plugins_loaded, I guess. There's no condition for it (e.g. if (!is_admin()) {}), so I'm wondering if I need some other kind of condition to ensure it is applied to admin orders, or if I'm looking at a bug?