Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2006
    Location
    North Carolina
    Posts
    279
    Plugin Contributions
    0

    Default Need solution: Undefined index: customer_id when using sidebox/login_box.php

    Hi,

    Any help would be appreciated.
    I use the plugin Login Box, but I'm receiving debug errors in 157 (mostly like earlier too but didn't notice until I turned debugging on.
    Can anyone help me to fix the undefined index below? The plugin hasn't been updated since 138a.

    [30-Nov-2020 15:49:01 America/New_York] PHP Notice: Undefined index: customer_id in /Users/..../login_box.php on line 37
    [30-Nov-2020 15:49:01 America/New_York] PHP Notice: Undefined index: customer_id in /Users/..../tpl_login_box.php on line 33







    $content = "<!-- loginSideBox -->" . "\n\n";
    $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';

    if(!$_SESSION['customer_id']) {

    $content .=zen_draw_form('login_box', zen_href_link(FILENAME_LOGIN, 'action=process', 'SSL'), 'post', 'id="loginFormSidebox"');
    $content .=LOGIN_BOX_EMAIL_ADDRESS . '<br />' . zen_draw_input_field('email_address', '', 'size="18" maxlength="100" style="width: ' . ($column_width-30) . 'px"').'<br />';
    $content .=LOGIN_BOX_PASSWORD . '<br />' . zen_draw_password_field('password', '', 'size="18" maxlength="100" style="width: ' . ($column_width-30) . 'px"') . '<br />';
    $content .='<a href="' . zen_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL') . '">' . LOGIN_BOX_PASSWORD_FORGOTTEN . '</a>' . '<br />' . '<a href="' . zen_href_link(FILENAME_LOGIN, '', 'SSL') . '">' . LOGIN_BOX_CREATE_ACCOUNT . '</a>' . '<br />';
    $content .= zen_draw_hidden_field('securityToken', $_SESSION['securityToken']);
    $content .='<div class="centeredContent">'.zen_image_submit(BUTTON_IMAGE_LOGIN, BUTTON_LOGIN_ALT).'</div>';
    $content .='</form>';
    } else {

    $content .= '<ul>';
    $content .= '<li><a class="loginBoxLinks" href="' . zen_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . LOGIN_BOX_ACCOUNT . '</a></li>';
    $content .= '<li><a class="loginBoxLinks" href="' . zen_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '">' . LOGIN_BOX_SHOPPING_CART . '</a></li>';
    $content .= '<li><a class="loginBoxLinks" href="' . zen_href_link(FILENAME_LOGOFF, '', 'SSL') . '">' . LOGIN_BOX_LOGOFF . '</a></li>';
    $content .= '</ul>';
    }

    $content .= '</div>';
    Jeff Michaels,
    pres of Musical Creations Ltd.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Need solution: Undefined index: customer_id when using sidebox/login_box.php

    You could replace
    Code:
    if(!$_SESSION['customer_id']) {
    with
    Code:
    if(!zen_is_logged_in()) {
    .

    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.

 

 

Similar Threads

  1. v157 PHP Notice: Undefined index
    By yueli7 in forum Upgrading to 1.5.x
    Replies: 1
    Last Post: 24 Jul 2020, 06:56 PM
  2. v155 Undefined index: shipping in classes/order.php
    By torvista in forum Bug Reports
    Replies: 3
    Last Post: 11 Sep 2017, 04:09 PM
  3. v151 Undefined index: path in configure.php (using Apsona)
    By torvista in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 5 Apr 2013, 06:46 PM
  4. Using application_top.php for multi store solution?
    By redg8r in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 22 Jan 2009, 04:33 PM
  5. internal error 500 when using admin/index.php
    By mobs in forum Upgrading from 1.3.x to 1.3.9
    Replies: 4
    Last Post: 29 Apr 2008, 10:48 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR