| Project: | Ubercart |
| Version: | 6.x-2.4 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
When the uc_googleanalytics.module is enabled, it should add the appropriate Google Analytics code to the footer of the page upon a successful checkout.
If the "Alternate checkout completion page:" option is used in the Checkout settings, this doesn't seem to work for url aliased completion pages.
Lines 69 - 74 of uc_googleanalytics.module (6.x-2.0) read as follows:
// Or if the URL is the custom completion page.
$completion_page = variable_get('uc_cart_checkout_complete_page', '');
if (!empty($completion_page) && $completion_page == $_GET['q']) {
return TRUE;
}For a completion page stored as its url alias, this should compare the alias of $_GET['q'] with the 'uc_cart_checkout_complete_page variable, as follows
// Or if the URL is the custom completion page.
$completion_page = variable_get('uc_cart_checkout_complete_page', '');
if (!empty($completion_page) && $completion_page == drupal_get_path_alias($_GET['q'])) {
return TRUE;
}This is a small change, but it took me a while to figure out.
I just checked out the latest HEAD version, and while the code has changed somewhat, it still seems to compare the uc_cart_checkout_complete_page variable directly with $_GET['q'].
It's only a one liner, but I attach a patch against HEAD in case it is of use.
Hope this helps.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| uc_googleanalytics_20091106_HEAD.patch | 1.01 KB | Idle | FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch uc_googleanalytics_20091106_HEAD.patch. | View details |
Comments
#1
We've encountered this issue too, which still exists in 2.4. This patch provides an effective fix. Here's my +1 for including it in the next release.
Thanks, David
#2
My apologies. This is still an issue in 2.4. However, the patch provided above does not apply successfully to the 2.4 version of uc_googleanalytics.module. I've attached an updated version below.
Thanks, David
#3
#4
The last submitted patch, uc_googleanalytics-completion.patch, failed testing.
#5
Committed to both branches.
#6
Automatically closed -- issue fixed for 2 weeks with no activity.