0

I am facing "Notice: Undefined offset 5584" systom.log error for below code :

<?php $s_qty = 0; ?>

<tr id="item<?php echo $item->getId(); ?>">

<?php
$session_flag = 0;
if (isset($_SESSION['bluedartItemsQty'])) {
    $qtyArr = $_SESSION['bluedartItemsQty'];

    $s_qty = abs($qtyArr[$item->getId()]); // Error in this line 
    $session_flag = 1;
    $sess_qty += $s_qty;
}
?>
<input type="hidden" value="<?php if($s_qty > 0) { echo $s_qty; } else { echo $_qty; }  ?>" />

I added below code in begining , but it did't worked for me.

if( !isset($s_qty)) $s_qty = '' ;
1
1

Maybe add a check at the given line ...

$session_flag = 0;
if (isset($_SESSION['bluedartItemsQty'])) {
    $qtyArr = $_SESSION['bluedartItemsQty'];

    if (isset($qtyArr[$item->getId()])) { # added
        $s_qty = abs($qtyArr[$item->getId()]); // Error in this line 
        $session_flag = 1;
        $sess_qty += $s_qty;
    }
}
2
  • thanks , i added your code & checked , there is no log errors and than again i removed your code and checked with old code, still there was no errors :) i am not getting what actually happend, but its working fine...... Sep 21 '17 at 11:48
  • 1
    Thx. I'd keep the line just to prevent further errros :)
    – sv3n
    Sep 21 '17 at 11:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.