wackojacko10101 wrote:at the check-out that when you click calculate shipping it , adds a seemingly random amount to the total. ( ranging from $3.67 AU to $7.61 AU)
Just going to echo this one - though in my case, it's subtracting a non-random (that is to say, it's always the same) amount from my order total.
As far as I can tell, this happens with all currencies -except for- the U.S. Dollar.
Specifically, this is what I'm seeing:
If I go to my cart (
http://www.sparkfun.com/cart ), I have a total / particular item (LinkM) cost of:
AUD: 136.29 / 30.29
CAD: 133.58 / 29.69
EUR: 100.69 / 22.38
GBP: 84.95 / 18.88
USD: 134.75 / 29.95
Now if I click the "Calculate Shipping" link and select an address after going to the cart page / selecting a currency, I get the following total / particular item (LinkM) +shipping cost after the numbers are updated -again-:
AUD: 137.84 / 30.64 +29.89
CAD: 132.42 / 29.43 +29.29
EUR: 75.24 / 16.72 +22.08
GBP: 53.55 / 11.90 +18.63
USD: 134.75 / 29.95 +29.55
In that "-again-" seems to lie the problem. Taking for example the original EUR total cost over the USD total cost:
100.69 / 134.75 = 0.747236
Now apply that same factor to the already established cost of EUR 100.69:
0.747236 * 100.69 ~= 75.24
Which happens to be the oddball number suddenly presented after choosing the shipping address.
It looks like the culprit(s) is/are in
sparkfun.js . The number-to-currency code (
render_currency: function() which, by the way, is really neat - my computer is old and slow, so I can actually watch it in action
) is run again (
this.render_currency(shipping_calculator)) when selecting the shipping option (
show_shipping_quotes: function(address_book_id, addresses)).
The intent is undoubtedly to convert the shipping cost from USD to whatever currency applies, but as
render_currency always applies itself to -all-
span elements of
class="price", the conversions on individual cart items and the total price are converted 'again' (and again and again if you keep clicking the calculate shipping + address links (e.g. user changes their mind and selects a different address) right down to a total of EUR 0.00).
Plenty of ways to solve that one; personally I'd make it
render_currency(container) the value of
container being the container element whose descendants one would want to affect (defaulting to the main document if not supplied), and update
show_shipping_quotes accordingly - though a more robust (additional) method is probably to store the value one wants to convert separately from the value that is actually being displayed to prevent rounding errors should the currency selector become all AJAX-ified as well.
Regardless, and thankfully for you guys at SparkFun, the correct totals are still in the actual payment processing pages. But it can be rather confusing: I was wondering why I was suddenly being offered such a great deal, even if I had to add shipping costs.
Back to shopping.. that Logomatic v2 is agonizingly tempting and I must read the materials to see if it fits my needs.