Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Im getting this every time in the Checkout complete page
Notice: Undefined offset: 0 in commerce_google_analytics_ecommerce_js() (line 68 of C:\damp\www\es_gshop\sites\all\modules\commerce_google_analytics\commerce_google_analytics.module).
Any hint?
Comments
Comment #1
brunorios1 CreditAttribution: brunorios1 commentedComment #2
urlaub CreditAttribution: urlaub commentedI can confirm this bug under latest drupal dev 7.11 and drupal commerce 7.1.0
Comment #3
wayout CreditAttribution: wayout commentedCan also confirm I get this same message.
Comment #4
yannisc CreditAttribution: yannisc commentedSame here. PHP 5.3
Comment #5
yannisc CreditAttribution: yannisc commentedA quick solution to hide the notice is to change line 68 of commerce_google_analytics.module from:
$tax_sum += commerce_currency_amount_to_decimal($tax_component[0]['price']['amount'], $tax_component[0]['price']['currency_code']);
to:
$tax_sum += @commerce_currency_amount_to_decimal($tax_component[0]['price']['amount'], $tax_component[0]['price']['currency_code']);
Comment #6
willieseabrook CreditAttribution: willieseabrook commentedThis occurred for me when a tax rate is not applied. If the tax is not applied, then $tax_component[0]['price']['amount'] never exists.
The specific example on our site is that we ship to two countries - Australia and New Zealand.
Australian tax is applied to orders shipped to Australia
New Zealand tax applied to orders shipping to New Zealand
So for each order, one tax is not applied.
See my patch which adds a condition to first check whether the tax has been applied or not.
Comment #7
CyberschorschThis still needs to be reviewed please.
Comment #8
CyberschorschCommited in new 7.10 release
Comment #9
CyberschorschComment #10
zambrey CreditAttribution: zambrey commentedLooks like this fix wasn't commited
http://drupal.org/node/1136656/commits
Error still occurs in 7.x-1.0.
Comment #11
zambrey CreditAttribution: zambrey commentedActually the patch needs to be rerolled.
Also removed some extra whitespaces.
Comment #12
douggreen CreditAttribution: douggreen commentedHere is the same patch as above but without the extra spaces, and adds a period to the end of the comment (proper Drupal coding standards).
This patch (and the one above) works for me.
Comment #13
CyberschorschThanks ppl! Committed and pushed in the dev release for now.