Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Tweaks › Problem with regional sales tax on taxable and non-taxable products
- This topic has 12 replies, 3 voices, and was last updated 13 years, 6 months ago by amin007.
-
AuthorPosts
-
April 10, 2011 at 4:16 pm #3159bowerstechMember
Hello,
California requires sales tax to be charged to my customers who live in the state. I setup the PayPal regional option to only charge residents of CA which is working fine.
I am selling my book in both paperback and ebook format (http://keepyourfamilysafeonline.com). The problem is that sales tax is being assessed on the ebook (digital) format which is a non-taxable item.
I tried assigning a tax rate of 0% in the shopping cart but PayPal ignored that setting for the eBook. According to PayPal’ site (https://www.paypal.com/cgi-bin/webscr?cmd=_pdn_cart_overrides_outside) the fix is simply passing the following variable:
<input type=”hidden” name=”tax” value=”0.00″>
Unfortunately, this solution only works for people using the PayPal buttons not your shopping cart. I am not familiar enough with coding to figure out how to tweak your code to do this for only certain products.
This is an urgent matter as the book sales launch in 15 hours! Please help.
Thanks,
Bryan
April 11, 2011 at 1:10 am #31223amin007ParticipantAre you using the “Add to Cart” type button or “Buy Now” type buttons of eStore?
If you are using “Add to Cart” type buttons then open the “eStore_payment_submission.php” file and look for the following block of code:
if(!empty($_SESSION['eStore_cart_total_tax']))
{
$myPaypal->addField('tax_cart', round($_SESSION['eStore_cart_total_tax'], 2));
}Once you find it replace it with the following
if(!empty($_SESSION['eStore_cart_total_tax']))
{
$myPaypal->addField('tax_cart', round($_SESSION['eStore_cart_total_tax'], 2));
}
else
{
$myPaypal->addField('tax_cart', '0.00');
}Let me know how that goes.
April 11, 2011 at 3:10 am #31224bowerstechMemberAdd to Cart. I will try it in a few minutes!
April 11, 2011 at 3:26 am #31225bowerstechMemberReceived the following error:
Parse error: syntax error, unexpected T_ELSE in /home/besafe/public_html/wp-content/plugins/wp-cart-for-digital-products/eStore_payment_submission.php on line 218
April 11, 2011 at 3:32 am #31226bowerstechMemberHere is the modified line:
// Tax
if(!empty($_SESSION))
{
$myPaypal->addField(‘tax_cart’, round($_SESSION, 2));
}
else
{
$myPaypal->addField(‘tax_cart’, ‘0.00’);
}
else
{
$myAuthorize->addField(‘x_tax’, 0);
}
April 11, 2011 at 4:38 am #31227bowerstechMemberI tried removing this:
else
{
$myAuthorize->addField(‘x_tax’, 0);
}
which caused the error to disappear. Only problem is that PayPal still added the tax to the non-taxable unit.
April 11, 2011 at 11:31 pm #31228amin007ParticipantLooks like you added it in the wrong place. I told you to find the following BLOCK OF CODE not just the first line of that block
if(!empty($_SESSION['eStore_cart_total_tax']))
{
$myPaypal->addField('tax_cart', round($_SESSION['eStore_cart_total_tax'], 2));
}Hint: Do not search for
if(!empty($_SESSION['eStore_cart_total_tax']))
as there are a few occurrences of that line.Maybe search for the following line to get to that code block:
$myPaypal->addField('tax_cart', round($_SESSION['eStore_cart_total_tax'], 2));
Please revert the changes you made earlier and try applying what I explained in the previous post again. Let me know how you go.
April 12, 2011 at 5:24 am #31229bowerstechMemberSorry for the confusion.
I found the correct line this time and did as you said. It fixed the non-taxable issue but now tax is not calcuated for the taxable item.
I input a tax amount in the tax/shipping section for the taxable product but that didn’t work either. I emailed the file to you so you can verify if I modified it correctly.
Thanks,
Bryan
April 12, 2011 at 8:32 am #31230amin007ParticipantYour code update looks good to me. Obviously this method is not working.
Mixing the taxable and non-taxable items with profile based taxing needs to be looked at more. I think you will have a much better quick solution now if you just use a “Buy Now” button for your non-taxable items. Buy Now type buttons are individual checkouts and the plugin will be able to set the tax correctly for each item without any hassle. Is that a viable solution for you?
April 12, 2011 at 9:11 am #31231bowerstechMemberI will have to ponder that. Perhaps that will work.
April 24, 2011 at 2:00 pm #31232bowerstechMemberWill that allow for coupon’s to be used?
April 25, 2011 at 12:11 am #31233wpCommerceModeratorCoupon can be used on the cart items(the products added with add to cart type button) whereas with Buy Now button you directly checkout to PayPal. So you can’t use coupon on Buy Now type button.
April 28, 2011 at 4:19 am #31234amin007ParticipantJust updating the thread with some new information…
I have added some condition in the plugin which will make it so if you set the individual tax rate of an item to 0 (zero) then PayPal will not charge any tax for that item when you use profile based tax.
Please get a new build of the plugin from here:
https://support.tipsandtricks-hq.com/update-request
Then set the individual tax amount to 0 (zero) for the items that you don’t want to charge tax for. Do a test checkout and let me know how you go.
-
AuthorPosts
- You must be logged in to reply to this topic.