Quote Originally Posted by swguy View Post
Edit https://www.zen-cart.com/showthread....ion-header_php
and change

} elseif (sizeof($products) > 0) {

to


} elseif (!empty($products) > 0) {
  • i think your edit url is wrong. were you planning on pointing to the github? as your url is just pointing right back to here.
  • your code correction is confusing. why would you first question if it is not empty, and then compare if it is greater than 0? it seems the greater than 0 is not necessary.
  • is it not possible to properly initialize these vars instead of testing them for what they are supposed to be prior to using? see snippet below.


PHP Code:
// change line 35 from:
(array) $products $_POST['notify'];

// to:
    
$products = [];
    if (isset(
$_POST['notify'])) {
        
$products $_POST['notify'];
    } 
the casting to an array is not done when the POST is null. from a code readability, this correction seems better to me. both do work. but i see no need for the greater than 0.