Automattic / woocommerce-services

WooCommerce Services is a feature plugin that integrates hosted services into WooCommerce (3.0+), and currently includes automated tax rates and the ability to purchase and print USPS shipping labels.
GNU General Public License v2.0
107 stars 20 forks source link

Weekly synchronized subscription products incorrectly show free trial language with automated taxes enabled #2144

Open jessLundie opened 4 years ago

jessLundie commented 4 years ago

Affected Ticket 3216602-zen

Synopsis

When automated taxes are enabled, synchronized subscription products set to charge nothing at initial purchase show "ghost" free trial language in the cart even when there is no free trial set on the product:

https://d.pr/i/GBGeAE Full Image: https://d.pr/i/GBGeAE

To Replicate

  1. Under WooCommerce > Settings > Subscriptions, set: https://d.pr/i/tJqmPW Full Image: https://d.pr/i/tJqmPW
  2. Set up a synchronized subscription product that renews weekly
  3. Set the synchronization day to any day except today
  4. Add the subscription product to the cart
  5. See that free trial language shows up for that product in the cart

What I Expected

Free trial language will only show in the cart for subscription products that actually have a free trial configured on the product.

Additional Notes

The customer determined and our testing confirmed that commenting out this line of code resolves this issue:

https://github.com/Automattic/woocommerce-services/blob/1.24.0/classes/class-wc-connect-taxjar-integration.php#L639

I did some testing with this line commented out on subscription products with free-trial periods and did not see any issues caused by commenting out this code. The initial order for a free trial appears to (correctly) not charge tax.

aheckler commented 3 years ago

28746439-hc