Thread: Supertracker

Results 1 to 10 of 324

Hybrid View

  1. #1
    Join Date
    Sep 2009
    Posts
    23
    Plugin Contributions
    0

    Default Re: Supertracker

    I'm moving this discussion over from another support thread (http://www.zen-cart.com/showthread.p...ng-array-given).... I'm using ZC 1.5.1 and PHP 5.3.

    I believe I've found a problem with Supertracker. Specifically it seems to be when a user checks out and Supertracker attempts to write the cart contents to the cart_contents field in the supertracker table. The file that controls this, I believe, is /includes/classes/supertracker.php about line 150ish. You can see that if the cart contents return as a string then it serializes them. But what happens when they don't return as a string? What if they are undefined or an array or some other non-string condition. Since the database write operation depends on zen_db_input() function, which is really just a container for the native add_slashes() function, it causes a PHP warning. Under PHP 5.3 addslashes() now strictly checks to see if the data passed to it is a string. If it isn't it throws a warning which ends up as a myDEBUG log file in the /logs folder under Zen Cart 1.5.1. They start adding up quickly if you have a store with enough daily transactions.

    If I pass this data straight into the db, bypassing addslashes, it writes "Array" at least in my initial couple tests.

    Suggestions on the best way to filter the $carts_content variable so it always ends up a string? I'll try a couple things but just wanted others to weigh in....

    Thanks!

  2. #2
    Join Date
    Aug 2004
    Location
    Saint Petersburg, Russia
    Posts
    1,786
    Plugin Contributions
    13

    Default Re: Supertracker

    Wow! You really use this old script? Can you tell me why you use this script? What do you miss in Google Analytics and Piwik?

    Quick bug fix.
    includes/class/supertracker.php
    Search
    PHP Code:
    $cart_contents unserialize($tracking_data->fields['cart_contents']); 
    replace by
    PHP Code:
    $cart_contents $tracking_data->fields['cart_contents']; 
    Last edited by a_berezin; 10 May 2013 at 12:48 PM.

  3. #3
    Join Date
    Dec 2010
    Location
    UK
    Posts
    1,771
    Plugin Contributions
    3

    Default Re: Supertracker

    Quote Originally Posted by a_berezin View Post
    Wow! You really use this old script? Can you tell me why you use this script? What do you miss in Google Analytics and Piwik?

    Quick bug fix.
    includes/class/supertracker.php
    Search
    PHP Code:
    $cart_contents unserialize($tracking_data->fields['cart_contents']); 
    replace by
    PHP Code:
    $cart_contents $tracking_data->fields['cart_contents']; 
    It works (naturally)

  4. #4
    Join Date
    Sep 2009
    Posts
    23
    Plugin Contributions
    0

    Default Re: Supertracker

    Quote Originally Posted by a_berezin View Post
    Wow! You really use this old script? Can you tell me why you use this script? What do you miss in Google Analytics and Piwik?

    Quick bug fix.
    includes/class/supertracker.php
    Search
    PHP Code:
    $cart_contents unserialize($tracking_data->fields['cart_contents']); 
    replace by
    PHP Code:
    $cart_contents $tracking_data->fields['cart_contents']; 
    Indeed, that's the solution I came to as well but was too busy to post a reply yesterday. After examining admin activity logs, it appears this add-on isn't getting used so I'm going to remove it. Plus there are other issues (reports that won't generate properly) that I think have to do with either PHP 5.3 or Zen Cart 1.5.1 or a combination of both.

    As you say, Google Analytics, which the site uses, is a more comprehensive solution.

    Thanks for your reply and maybe all of this helps someone who isn't comfortable with another solution.

  5. #5
    Join Date
    Nov 2007
    Location
    Upstate NY
    Posts
    232
    Plugin Contributions
    0

    Default Re: Supertracker

    So I've installed Supertracker 1.1 on ZC 1.5.1. It worked fine for about a week then I got blank front end (admin is fine). I uninstalled Supertracker and it's good.

    The debug logs give this error:

    PHP Fatal error: Cannot redeclare geoip_country_code_by_name() in /home/ . . . /public_html/ . . . /includes/geoip.inc on line 351
    I installed and uninstalled a few times and same result. I have this mod running on 1.3.9h with no problems. It was also OK on this version for about a week.

    We've had some strange php errors the last month or so. Little things that I've fixed one at a time. I believe there's some creeping php/mysql upgrade in the works that is running into bad/old/depreciated code.

    This issue has happened in the past with this exact error in this file. I've found posts and solutions for this thing from every year for the last 4 years.

    This one - adding !if statements in the geoip.inc file - worked for me. the code is around line 340 in geoip.inc.

    Fair warning: after I made the code changes and re-uploaded the whole package my front and backend dragged for about 5 mins. Seemed frozen. I waited and refreshed and everything's fine. Supertracker even works

    Fatal error: Cannot redeclare geoip_country_code_by_name()

    The solution is very simple. in your geoip.inc file, look for this code

    function geoip_country_code_by_name($gi, $name) {
    ...
    }

    function geoip_country_name_by_name($gi, $name) {
    ...
    }

    and replace with

    if (!function_exists('geoip_country_code_by_name')) {
    function geoip_country_code_by_name($gi, $name) {
    ...
    }
    }

    if (!function_exists('geoip_country_name_by_name')) {
    function geoip_country_name_by_name($gi, $name) {
    ...
    }
    }

    -------------------------------------------------------
    Here are some other solutions I found in case that fix doesn't work for you. I HAVE NOT TRIED THESE

    From 2011: this fix from razvantudorica.com/03/cannot-redeclare-geoip_country_code_by_name/. This one is from the same post as the code fix I used: it's an alternative that is supposed to do the same thing.

    Cannot redeclare geoip_country_code_by_name
    Fatal error: Cannot redeclare geoip_country_code_by_name()

    The reason was that I have geoip extension enabled in my PHP configuration and also I used the geoip.inc file from maxmind.com.

    The solution is very simple. Actually, there are two solutions:

    First is to disable the geoip extension from your configuration. In /etc/php5/apache2/conf.d/geoip.ini comment the first line:

    ;extension=geoip.so

    . . . . second solution is the code fix above.
    One person on max_mind says this but I don't know what he's talking about: I don't have that in my php.ini
    the reason is that you use the php code _and_ the php extension. Remove the geoip extension from your php.ini to fix the namespace clash.
    ( both use the same function name geoip_country_code_by_name )
    From a 2010 posting on 4homepages.de/forum/index.php?topic=28684.0
    Problem solved. It`s depend on hosting changes...
    For resolve this problem, uncomment this path in you geoip.inc
    function geoip_country_code_by_name($gi, $name) {
    $country_id = geoip_country_id_by_name($gi,$name);
    if ($country_id !== false) {
    return $gi->GEOIP_COUNTRY_CODES[$country_id];
    }
    return false;
    }

    function geoip_country_name_by_name($gi, $name) {
    $country_id = geoip_country_id_by_name($gi,$name);
    if ($country_id !== false) {
    return $gi->GEOIP_COUNTRY_NAMES[$country_id];
    }
    return false;
    Last edited by Tapper; 16 May 2013 at 05:59 PM.

  6. #6
    Join Date
    Aug 2007
    Posts
    277
    Plugin Contributions
    0

    Default Re: Supertracker

    zc 1.5.1
    SUPER TRACKER V1.1
    multisite V1.0

    I have installed ths mod on zc1.5.1

    I noticed 2 thing not lading correctly:

    1. "The Top Landing Pages (No Sale)" is not displaing correctly. Instead of display "Top Landing Pages (No Sale)", it displays TEXT_LANDING_PAGE.
    Also. the gray bar heading under the heading displays " Serail TEXT_LANIDING_PAGE" instead of the correct heading as well.

    What is wrong here? How Do I fix this?

    2. "The Top Landing Pages (No Sale, bit added to cart)" does not display anything at all.
    Again, what is wrong here and how do I fix it?

    Does anyone else encounter this problem?

    Any Help is greatly appreciated.

  7. #7
    Join Date
    Aug 2007
    Posts
    277
    Plugin Contributions
    0

    Default Re: Supertracker

    Quote Originally Posted by twi View Post
    zc 1.5.1
    SUPER TRACKER V1.1
    multisite V1.0

    I have installed ths mod on zc1.5.1

    I noticed 2 thing not lading correctly:

    1. "The Top Landing Pages (No Sale)" is not displaing correctly. Instead of display "Top Landing Pages (No Sale)", it displays TEXT_LANDING_PAGE.
    Also. the gray bar heading under the heading displays " Serail TEXT_LANIDING_PAGE" instead of the correct heading as well.

    What is wrong here? How Do I fix this?

    2. "The Top Landing Pages (No Sale, bit added to cart)" does not display anything at all.
    Again, what is wrong here and how do I fix it?

    Does anyone else encounter this problem?

    Any Help is greatly appreciated.
    I found the solution in this thread on post #210 and #211 in case anyone encounter the same problem.

  8. #8
    Join Date
    Apr 2006
    Location
    Largo, Florida USA
    Posts
    102
    Plugin Contributions
    0

    Default Re: Supertracker

    MOBILE SITE ERROR - I tried uploading the tracker code to my mobile template and get the following error, any ideas on how to add to a mobile site?
    Warning: gethostbyaddr() [function.gethostbyaddr]: Address is not a valid IPv4 or IPv6 address in /home/public_html/ADMINXXX/supertracker.php on line 602

 

 

Similar Threads

  1. Supertracker
    By enquirer66 in forum All Other Contributions/Addons
    Replies: 5
    Last Post: 2 Mar 2011, 08:37 PM
  2. SuperTracker
    By ma.r.a in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 11 Feb 2011, 08:19 PM
  3. Supertracker referrals?
    By mlbacher in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 24 Aug 2009, 07:53 PM
  4. supertracker mod
    By confused_aswell in forum General Questions
    Replies: 2
    Last Post: 1 Aug 2008, 12:55 PM
  5. Supertracker Add-on
    By bcmartinez in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 19 May 2006, 01:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg