in uc_taxes.js, l. 47 :
" for (j in taxes) {"

If for some reason taxes get methods attached to it, the function getTax won't work and this section of the check out page (payment method -> Order total preview:) will loop for ever.

I have added l.48 :
" if(!isNaN(j)) {"

But there is maybe a better method...

CommentFileSizeAuthor
#3 ubercart-n646660.patch3.55 KBDamienMcKenna
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DamienMcKenna’s picture

DamienMcKenna’s picture

FYI this uc_taxes.js adds:

  $('#edit-panes-payment-current-total').click(getTax);

This then gets triggered by render_line_items() in uc_payment.js from the following line:

  $('#edit-panes-payment-current-total').val(cur_total).click();

This gets triggered by set_line_item() which gets triggered on pageload by this line in uc_order.line_item.inc:

        drupal_add_js("if (Drupal.jsEnabled) { \$(document).ready( function() { set_line_item('subtotal', '". $line_item['name'] ."', ". uc_price($line_item['amount'], $context) .", ". $line_item['weight'] ."); } )};", 'inline');

I'm surprised more people aren't complaining.

DamienMcKenna’s picture

Status: Active » Needs review
FileSize
3.55 KB

Here's a patch that checks to see if the return from the AJAX call is empty before running the logic from the 'success' callback.

DamienMcKenna’s picture

FYI I added a pagebreak on this line in both Firefox 3.6 and Safari 5.0.1:

            key = 'tax_' + taxes[j].id;

The breakpoint never triggers in Firefox but it does in Safari. When I inspect the 'taxes' variable in Safari it says:

taxes: Array (0)
  length: 0
  __proto__: Array

with __proto__ listing a whole bunch of functions.

longwave’s picture

Status: Needs review » Fixed

This seems to have been fixed by #684552: Payment summary never loads in IE (Checkout) -- but in FF, please reopen if there are other problems in uc_taxes.js.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

chris_getdepth’s picture

Component: Code » Taxes

greetings

a site i have built with ubercart 6.x-2.4 installed has suddenly started to experience this problem.
when you go to the checkout page the payment method never loads, and the webhost blocks my ip.

the latest site log entries all say:

Type	page not found
Date	Wednesday, 18 May, 2011 - 12:56
User	
Location http://www.mysite.com/taxes/calculate
Referrer http://www.mysite.com/online-shop/cart/checkout
Message 403.shtml
Severity warning

so i am guessing the uc_tax_module and more likely the uc_tax.js is causing the problem.


i have read through
#629964: Patch to Cut Down on Tax Calculation Ajax Calls on Checkout Form
and applied patch #11

as well as

#684552: Payment summary never loads in IE (Checkout) -- but in FF
and applied patch #47

but neither have solved the issue either individually nor together


the site uses the uc_vat module too and i have found the thread #1091440: Endless progress bar loading in checkout form on cart/checkout page when tax 0% is set but the tax is not set to 0% so i guess it isn't that either. (though i have tried the patch #2 but it did not solve this either).


the site is also experiencing the issue described by #766530: Review order button loop back to the cart checkout page! however although it gets redirect to the checkout page it actually throws a 404 page not found so i am guessing that that too might be being caused by this uc_taxes issue.


(apologies if i should have posted in one of those other threads - i just figured this one was the one with the most recent activity)


help with this would be greatly appreciated!
thanks in advance

chris_getdepth’s picture

Priority: Minor » Critical
Status: Closed (fixed) » Active

(just changing the priority and status as i somehow managed to set a different thread's no this one, tut!)

TR’s picture

Priority: Critical » Minor
Status: Active » Closed (fixed)

This issue and the others you cited have been fixed already in 6.x-2.x-dev. Please upgrade to the -dev release, and if you are still having problems then open a new issue describing the problems. It would be helpful if you included a link to your site.

chris_getdepth’s picture

aha ok i didnt realise it had been commited to the dev release - however i dont tend to use dev releases on live sites. i'll upgrade and see if that fixes it.

like i said apologies for cross posting the issue here but it seemed relevent and i didnt want to duplicate the issue.

many thanks

* Update - just to let you know that installing 6.x-2.x-dev did indeed solve this issue. thanks TR for the info.