Forums / General Questions / Value of main_page being returned incorrectly

Value of main_page being returned incorrectly

Locked

Started by badarac on 6 Oct 2010, 3:58 PM · Views: 1,300

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
6 Oct 2010, 3:58 PM
#1
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Location:
Longs, SC
Posts:
635
Plugin Contributions:
0

Value of main_page being returned incorrectly

I'm having a problem that's making me a little nuts and I'm hoping somebody can point me in the right direction.

I installed the Simple Google Analytics add on and the ecommerce tracking code did not appear to be generated in the page source. The normal tracking code was generated correclty.

I posted in the support thread for the add on and the owner of the add-on discovered that it is in fact being generated. It's just not being generated in my Firefox browser. Placing an order from a different browser on the same PC or using a Firefox browser on a different PC works as expected.

I added a line of code to echo the value of the main_page variable. This variable is being tested in the add-on to determine if the page is checkout_success. On my Firefox browser the value is being returned as time_out on the checkout success page even though the page is displaying properly. As a result the if path is never being followed. I've tried clearing cache, cookies, and running FF in safe mode with no change.

Any ideas?

6 Oct 2010, 4:31 PM
#2
absolute avatar

absolute

Totally Zenned

Join Date:
May 2005
Location:
Bath, Somerset
Posts:
1,054
Plugin Contributions:
2

Re: Value of main_page being returned incorrectly

Are you just refreshing the checkout_success page over and over on the first PC, or are you placing a fresh order each time? The reason I ask is that the checkout success page is a "dumb" page, meaning that it doesn't actually do anything with regard an order. By the time this page loads, the whole order process has completed. This page then checks the last order you placed, and displays the details of this order.

If you are testing on 2 PCs, and on one you place a fresh order and the code appears, and on the other, you just keep refreshing the same page to test code, it may be that once the code has been displayed, it is never shown again. Especially as this is order tracking code. When we code modules such as this, we add in a SESSION variable checker, so that we only post the data to the tracking system once. After all, you don't want someone to hit refresh 5 times and your tracker show that you've had 5 orders placed!

It might be worth logging out of the session on one PC, and then placing a fresh order. Remember to remove all cached files and cookies, just in case.

Absolute

Back, after a 4 year absence! Did you miss me?
Absolute Web Solutions Ltd
Interested in our work? Take a look at one of our sites - The Tech Store

6 Oct 2010, 4:37 PM
#3
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Location:
Longs, SC
Posts:
635
Plugin Contributions:
0

Re: Value of main_page being returned incorrectly

Absolute:

Are you just refreshing the checkout_success page over and over on the first PC, or are you placing a fresh order each time? The reason I ask is that the checkout success page is a "dumb" page, meaning that it doesn't actually do anything with regard an order. By the time this page loads, the whole order process has completed. This page then checks the last order you placed, and displays the details of this order.

If you are testing on 2 PCs, and on one you place a fresh order and the code appears, and on the other, you just keep refreshing the same page to test code, it may be that once the code has been displayed, it is never shown again. Especially as this is order tracking code. When we code modules such as this, we add in a SESSION variable checker, so that we only post the data to the tracking system once. After all, you don't want someone to hit refresh 5 times and your tracker show that you've had 5 orders placed!

It might be worth logging out of the session on one PC, and then placing a fresh order. Remember to remove all cached files and cookies, just in case.

Absolute

Thanks for the reply. I'm not refreshing the page. I go through the order process fresh each time. I've tried rebooting the PC and running through a new order with the same result.

6 Oct 2010, 6:51 PM
#4
absolute avatar

absolute

Totally Zenned

Join Date:
May 2005
Location:
Bath, Somerset
Posts:
1,054
Plugin Contributions:
2

Re: Value of main_page being returned incorrectly

Do you have force new sessions turned on in the admin?

When you reboot your computer, are you also clearing all cache and cookies? Cookies remain even if you reboot the PC, and if you are still within the session time limit, it may be that you are simply re-establishing the same session.

Absolute

Back, after a 4 year absence! Did you miss me?
Absolute Web Solutions Ltd
Interested in our work? Take a look at one of our sites - The Tech Store

6 Oct 2010, 7:00 PM
#5
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Location:
Longs, SC
Posts:
635
Plugin Contributions:
0

Re: Value of main_page being returned incorrectly

Absolute:

Do you have force new sessions turned on in the admin?

When you reboot your computer, are you also clearing all cache and cookies? Cookies remain even if you reboot the PC, and if you are still within the session time limit, it may be that you are simply re-establishing the same session.

Absolute

I'm not sure exactly which setting you're referring to. If its recreate session then that is set to true. If not can you point me to where that's set?

I'll try doing a reboot followed by clearing cache and cookies to be sure that's the way I did it.

7 Oct 2010, 3:04 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Value of main_page being returned incorrectly

Sounds like one or more addons are bad. When uncertain, go back to basics: http://www.zen-cart.com/wiki/index.php/Troubleshoot_-_Diagnosing_Obscure_Issues

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

7 Oct 2010, 2:29 PM
#7
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Location:
Longs, SC
Posts:
635
Plugin Contributions:
0

Re: Value of main_page being returned incorrectly

DrByte:

Sounds like one or more addons are bad. When uncertain, go back to basics: http://www.zen-cart.com/wiki/index.php/Troubleshoot_-_Diagnosing_Obscure_Issues

Thanks for that link. It seems that the problem was related to some cookies on the system. I found cookies for the website and zencart. After deleting the cookie the tracking code is generated as expected. Looks like Firefox doesn't do a real good job of cleaning up after itself. All is well!

7 Oct 2010, 5:42 PM
#8
absolute avatar

absolute

Totally Zenned

Join Date:
May 2005
Location:
Bath, Somerset
Posts:
1,054
Plugin Contributions:
2

Re: Value of main_page being returned incorrectly

Firefox cleans up after itself as it should. Cookies are designed to stay on your PC for as long as the software requires them. They are usual used so that you can return to a previous session, when the original session has expired, for example as you can with phpMyAdmin.

This is why when testing, you should regularly clear cache and cookies, so that you can see the changes you are implementing.

Absolute

Back, after a 4 year absence! Did you miss me?
Absolute Web Solutions Ltd
Interested in our work? Take a look at one of our sites - The Tech Store