Hello All:
I'm wondering why I get the following error when I try to checkout: "The address(es) used for tax calculation did not have State/Province or Country values set, so we cannot determine the taxes to charge. " Some background: 1) I don't need to calculate taxes for this particular product (in the Catalog MGR I specify no tax & no shipping charges - since its a digital product) 2) I bypass the shipping address form in my checkout process (the customers for this product don't need to have a shipping address, so I shouldn't ask them for one.) Seems like there's some kind of mandatory relationship set up between the shipping address, tax calculation and the order creation process. Is this the way it should work? I would think that the order process should determine if tax calculations are even needed before it goes on to create the order. BTW, if I put the shipping address form back in my checkout process, then everything works fine - no error and the order is created. Am I doing something wrong in setting up the product? Any insight would be appreciated. Ruth _______________________________________________ Users mailing list [hidden email] http://lists.ofbiz.org/mailman/listinfo/users |
Ruth,
this is a quick fix (not tested) to avoid the error: in the org.ofbiz.order.shoppingcart.CheckOutHelper class, add the following code at the beginning of the calcAndAddTax(GenericValue shipAddress) method: if (shipAddress == null) { return; } It should work for you, but I'd like to hear comments from others to see if this patch can go into the SVN. Jacopo Ruth Hoffman wrote: > Hello All: > I'm wondering why I get the following error when I try to checkout: > > "The address(es) used for tax calculation did not have State/Province or > Country values set, so we cannot determine the taxes to charge. " > > Some background: > 1) I don't need to calculate taxes for this particular product (in the > Catalog MGR I specify no tax & no shipping charges - since its a digital > product) > 2) I bypass the shipping address form in my checkout process (the > customers for this product don't need to have a shipping address, so I > shouldn't ask them for one.) > > Seems like there's some kind of mandatory relationship set up between > the shipping address, tax calculation and the order creation process. Is > this the way it should work? I would think that the order process should > determine if tax calculations are even needed before it goes on to > create the order. BTW, if I put the shipping address form back in my > checkout process, then everything works fine - no error and the order is > created. Am I doing something wrong in setting up the product? > > Any insight would be appreciated. > Ruth > > _______________________________________________ > Users mailing list > [hidden email] > http://lists.ofbiz.org/mailman/listinfo/users > _______________________________________________ Users mailing list [hidden email] http://lists.ofbiz.org/mailman/listinfo/users |
Thanks! I'll give it a try today.
Ruth Jacopo Cappellato wrote: >Ruth, > >this is a quick fix (not tested) to avoid the error: > >in the org.ofbiz.order.shoppingcart.CheckOutHelper class, add the >following code at the beginning of the calcAndAddTax(GenericValue >shipAddress) method: > > >if (shipAddress == null) { > return; >} > >It should work for you, but I'd like to hear comments from others to see >if this patch can go into the SVN. > >Jacopo > > >Ruth Hoffman wrote: > > >>Hello All: >>I'm wondering why I get the following error when I try to checkout: >> >>"The address(es) used for tax calculation did not have State/Province or >>Country values set, so we cannot determine the taxes to charge. " >> >>Some background: >>1) I don't need to calculate taxes for this particular product (in the >>Catalog MGR I specify no tax & no shipping charges - since its a digital >>product) >>2) I bypass the shipping address form in my checkout process (the >>customers for this product don't need to have a shipping address, so I >>shouldn't ask them for one.) >> >>Seems like there's some kind of mandatory relationship set up between >>the shipping address, tax calculation and the order creation process. Is >>this the way it should work? I would think that the order process should >>determine if tax calculations are even needed before it goes on to >>create the order. BTW, if I put the shipping address form back in my >>checkout process, then everything works fine - no error and the order is >>created. Am I doing something wrong in setting up the product? >> >>Any insight would be appreciated. >>Ruth >> >>_______________________________________________ >>Users mailing list >>[hidden email] >>http://lists.ofbiz.org/mailman/listinfo/users >> >> >> > > >_______________________________________________ >Users mailing list >[hidden email] >http://lists.ofbiz.org/mailman/listinfo/users > > > _______________________________________________ Users mailing list [hidden email] http://lists.ofbiz.org/mailman/listinfo/users |
In reply to this post by Jacopo Cappellato
This is a good question... I think it's a little risky to give up on taxes if the shipping address isn't passed in... Is there a billing address in the case we're looking at? There is some code higher up to pass the billing address down if there is no shipping address, but maybe it needs to be a little more intelligent? One way or another, unless taxes aren't needed for your case Ruth (in which case we should support leaving them out when nothing is associated with the store, or something like that), we should make sure taxes are calculated with whatever information is available... -David Jacopo Cappellato wrote: > Ruth, > > this is a quick fix (not tested) to avoid the error: > > in the org.ofbiz.order.shoppingcart.CheckOutHelper class, add the > following code at the beginning of the calcAndAddTax(GenericValue > shipAddress) method: > > > if (shipAddress == null) { > return; > } > > It should work for you, but I'd like to hear comments from others to see > if this patch can go into the SVN. > > Jacopo > > > Ruth Hoffman wrote: >> Hello All: >> I'm wondering why I get the following error when I try to checkout: >> >> "The address(es) used for tax calculation did not have State/Province or >> Country values set, so we cannot determine the taxes to charge. " >> >> Some background: >> 1) I don't need to calculate taxes for this particular product (in the >> Catalog MGR I specify no tax & no shipping charges - since its a digital >> product) >> 2) I bypass the shipping address form in my checkout process (the >> customers for this product don't need to have a shipping address, so I >> shouldn't ask them for one.) >> >> Seems like there's some kind of mandatory relationship set up between >> the shipping address, tax calculation and the order creation process. Is >> this the way it should work? I would think that the order process should >> determine if tax calculations are even needed before it goes on to >> create the order. BTW, if I put the shipping address form back in my >> checkout process, then everything works fine - no error and the order is >> created. Am I doing something wrong in setting up the product? >> >> Any insight would be appreciated. >> Ruth >> >> _______________________________________________ >> Users mailing list >> [hidden email] >> http://lists.ofbiz.org/mailman/listinfo/users >> > > > _______________________________________________ > Users mailing list > [hidden email] > http://lists.ofbiz.org/mailman/listinfo/users _______________________________________________ Users mailing list [hidden email] http://lists.ofbiz.org/mailman/listinfo/users |
David:
There may be a billing address, but not necessarily one owned or known by OFBiz. So, the answer to your question: depends :-) For some of these products, there is no sales tax associated with them. There may be tariffs (a form of tax), that are calculated based on a billing location, but so far, that hasn't been identified as a requirement. On a related topic - I'm curious about why the shopping cart events are not implemented as services. For example, why did you decide that adding an item to a cart was better done as an event, than as a service? TIA Ruth David E Jones wrote: >This is a good question... I think it's a little risky to give up on taxes if the shipping address isn't passed in... > >Is there a billing address in the case we're looking at? There is some code higher up to pass the billing address down if there is no shipping address, but maybe it needs to be a little more intelligent? > >One way or another, unless taxes aren't needed for your case Ruth (in which case we should support leaving them out when nothing is associated with the store, or something like that), we should make sure taxes are calculated with whatever information is available... > >-David > > >Jacopo Cappellato wrote: > > >>Ruth, >> >>this is a quick fix (not tested) to avoid the error: >> >>in the org.ofbiz.order.shoppingcart.CheckOutHelper class, add the >>following code at the beginning of the calcAndAddTax(GenericValue >>shipAddress) method: >> >> >>if (shipAddress == null) { >> return; >>} >> >>It should work for you, but I'd like to hear comments from others to see >>if this patch can go into the SVN. >> >>Jacopo >> >> >>Ruth Hoffman wrote: >> >> >>>Hello All: >>>I'm wondering why I get the following error when I try to checkout: >>> >>>"The address(es) used for tax calculation did not have State/Province or >>>Country values set, so we cannot determine the taxes to charge. " >>> >>>Some background: >>>1) I don't need to calculate taxes for this particular product (in the >>>Catalog MGR I specify no tax & no shipping charges - since its a digital >>>product) >>>2) I bypass the shipping address form in my checkout process (the >>>customers for this product don't need to have a shipping address, so I >>>shouldn't ask them for one.) >>> >>>Seems like there's some kind of mandatory relationship set up between >>>the shipping address, tax calculation and the order creation process. Is >>>this the way it should work? I would think that the order process should >>>determine if tax calculations are even needed before it goes on to >>>create the order. BTW, if I put the shipping address form back in my >>>checkout process, then everything works fine - no error and the order is >>>created. Am I doing something wrong in setting up the product? >>> >>>Any insight would be appreciated. >>>Ruth >>> >>>_______________________________________________ >>>Users mailing list >>>[hidden email] >>>http://lists.ofbiz.org/mailman/listinfo/users >>> >>> >>> >> >>_______________________________________________ >>Users mailing list >>[hidden email] >>http://lists.ofbiz.org/mailman/listinfo/users >> >> > >_______________________________________________ >Users mailing list >[hidden email] >http://lists.ofbiz.org/mailman/listinfo/users > > > _______________________________________________ Users mailing list [hidden email] http://lists.ofbiz.org/mailman/listinfo/users |
In reply to this post by Ruth Hoffman
Hi Jacopo:
Sorry I haven't had a chance to test this until today. It seems to work fine. I noticed that you have not applied this to more recent versions of OFBiz. FYI - I checked out version 7759 (today), put this code in: ... public void calcAndAddTax(GenericValue shipAddress) throws GeneralException { if(shipAddress == null) { return; ... Here's how I tested: Created a digital product, with no shipping and no tax & added it to the Featured Products category. Created the order. The shipping form did /not/ show up and the order was created with no problems - which is what I wanted. I also tried creating an order with a shippable product and my non shippable product, and the shipping request form did show up. The order was created with no problems. So, again, this is what I was looking for. Thanks much. Maybe you should add this to the code base. Regards, Ruth Ruth Hoffman wrote: >Thanks! I'll give it a try today. >Ruth > >Jacopo Cappellato wrote: > > > >>Ruth, >> >>this is a quick fix (not tested) to avoid the error: >> >>in the org.ofbiz.order.shoppingcart.CheckOutHelper class, add the >>following code at the beginning of the calcAndAddTax(GenericValue >>shipAddress) method: >> >> >>if (shipAddress == null) { >> return; >>} >> >>It should work for you, but I'd like to hear comments from others to see >>if this patch can go into the SVN. >> >>Jacopo >> >> >>Ruth Hoffman wrote: >> >> >> >> >>>Hello All: >>>I'm wondering why I get the following error when I try to checkout: >>> >>>"The address(es) used for tax calculation did not have State/Province or >>>Country values set, so we cannot determine the taxes to charge. " >>> >>>Some background: >>>1) I don't need to calculate taxes for this particular product (in the >>>Catalog MGR I specify no tax & no shipping charges - since its a digital >>>product) >>>2) I bypass the shipping address form in my checkout process (the >>>customers for this product don't need to have a shipping address, so I >>>shouldn't ask them for one.) >>> >>>Seems like there's some kind of mandatory relationship set up between >>>the shipping address, tax calculation and the order creation process. Is >>>this the way it should work? I would think that the order process should >>>determine if tax calculations are even needed before it goes on to >>>create the order. BTW, if I put the shipping address form back in my >>>checkout process, then everything works fine - no error and the order is >>>created. Am I doing something wrong in setting up the product? >>> >>>Any insight would be appreciated. >>>Ruth >>> >>>_______________________________________________ >>>Users mailing list >>>[hidden email] >>>http://lists.ofbiz.org/mailman/listinfo/users >>> >>> >>> >>> >>> >>_______________________________________________ >>Users mailing list >>[hidden email] >>http://lists.ofbiz.org/mailman/listinfo/users >> >> >> >> >> > >_______________________________________________ >Users mailing list >[hidden email] >http://lists.ofbiz.org/mailman/listinfo/users > > > _______________________________________________ Users mailing list [hidden email] http://lists.ofbiz.org/mailman/listinfo/users |
Free forum by Nabble | Edit this page |