Results 1 to 3 of 3
  1. #1
    Join Date
    May 2009
    Posts
    1,073
    Plugin Contributions
    2

    Default PHP Warning: Use of undefined constant

    Hi
    Using 1.5.6c
    php 7.3

    Getting a lot of PHP Warning: Use of undefined constant

    Here are some of them:

    [same for page_2, page_3, and page_4]
    --> PHP Warning: Use of undefined constant page_4 - assumed 'page_4' (this will throw an Error in a future version of PHP) in /includes/templates/CUSTOM/templates/tpl_modules_categories_tabs.php on line 89.
    the code I have is this:
    PHP Code:
    <li><a href="<?php echo zen_href_link(page_4''); ?>"><?php echo FZ_4_DESCRIPTION?></a></li>
    Other ones are:
    --> PHP Warning: Use of undefined constant LARGE_IMAGE_WIDTH - assumed 'LARGE_IMAGE_WIDTH' (this will throw an Error in a future version of PHP) in /includes/templates/CUSTOM/templates/tpl_modules_main_product_image.php on line 17.
    --> PHP Warning: Use of undefined constant LARGE_IMAGE_HEIGHT - assumed 'LARGE_IMAGE_HEIGHT' (this will throw an Error in a future version of PHP) in /includes/templates/CUSTOM/templates/tpl_modules_main_product_image.php on line 17.
    --> PHP Warning: Use of undefined constant LARGE_IMAGE_WIDTH - assumed 'LARGE_IMAGE_WIDTH' (this will throw an Error in a future version of PHP) in /includes/templates/CUSTOM/templates/tpl_modules_main_product_image.php on line 35.
    --> PHP Warning: Use of undefined constant LARGE_IMAGE_HEIGHT - assumed 'LARGE_IMAGE_HEIGHT' (this will throw an Error in a future version of PHP) in /ncludes/templates/CUSTOM/templates/tpl_modules_main_product_image.php on line 35.
    the code being:
    PHP Code:
    // line 17
    echo zen_image($products_image_medium$products_nameLARGE_IMAGE_WIDTHLARGE_IMAGE_HEIGHT) . '<br /><span class="imgLink">' TEXT_CLICK_TO_ENLARGE '</span></a>';
    // line 35
    echo zen_image($products_image_large$products_nameLARGE_IMAGE_WIDTHLARGE_IMAGE_HEIGHT); 
    Thank you

  2. #2
    Join Date
    Jul 2012
    Posts
    14,795
    Plugin Contributions
    17

    Default Re: PHP Warning: Use of undefined constant

    Quote Originally Posted by keneso View Post
    Hi
    Using 1.5.6c
    php 7.3

    Getting a lot of PHP Warning: Use of undefined constant

    Here are some of them:

    [same for page_2, page_3, and page_4]
    --> PHP Warning: Use of undefined constant page_4 - assumed 'page_4' (this will throw an Error in a future version of PHP) in /includes/templates/CUSTOM/templates/tpl_modules_categories_tabs.php on line 89.
    the code I have is this:
    PHP Code:
    <li><a href="<?php echo zen_href_link(page_4''); ?>"><?php echo FZ_4_DESCRIPTION?></a></li>
    Other ones are:
    --> PHP Warning: Use of undefined constant LARGE_IMAGE_WIDTH - assumed 'LARGE_IMAGE_WIDTH' (this will throw an Error in a future version of PHP) in /includes/templates/CUSTOM/templates/tpl_modules_main_product_image.php on line 17.
    --> PHP Warning: Use of undefined constant LARGE_IMAGE_HEIGHT - assumed 'LARGE_IMAGE_HEIGHT' (this will throw an Error in a future version of PHP) in /includes/templates/CUSTOM/templates/tpl_modules_main_product_image.php on line 17.
    --> PHP Warning: Use of undefined constant LARGE_IMAGE_WIDTH - assumed 'LARGE_IMAGE_WIDTH' (this will throw an Error in a future version of PHP) in /includes/templates/CUSTOM/templates/tpl_modules_main_product_image.php on line 35.
    --> PHP Warning: Use of undefined constant LARGE_IMAGE_HEIGHT - assumed 'LARGE_IMAGE_HEIGHT' (this will throw an Error in a future version of PHP) in /ncludes/templates/CUSTOM/templates/tpl_modules_main_product_image.php on line 35.
    the code being:
    PHP Code:
    // line 17
    echo zen_image($products_image_medium$products_nameLARGE_IMAGE_WIDTHLARGE_IMAGE_HEIGHT) . '<br /><span class="imgLink">' TEXT_CLICK_TO_ENLARGE '</span></a>';
    // line 35
    echo zen_image($products_image_large$products_nameLARGE_IMAGE_WIDTHLARGE_IMAGE_HEIGHT); 
    Thank you
    The undefined constant issue with tpl_modules_categoreis_tabs.php file, instead of page_4 it should be: FILENAME_PAGE_4 and similar for pages 2 and 3.

    As far as LARGE_IMAGE_WIDTH and LARGE_IMAGE_HEIGHT, those are constants that had been used by one or another plugins and I recently saw someone else reporting a similar issue that was supposedly to be resolved by defining those constants in one of the template's files. I don't recall where I saw it but it was in the last week or so. There have been other solutions as well such as changing out for MEDIUM_IMAGE_WIDTH and height, or defining the value for each of those in an includes/extra_configures or includes/extra_datafiles file.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...
    Upgraded to Zen Cart V1.5.3 from V1.5.1 from V1.5.0 from V1.3.9h

  3. #3
    Join Date
    May 2009
    Posts
    1,073
    Plugin Contributions
    2

    Default Re: PHP Warning: Use of undefined constant

    Thank you.

    Not that I had doubts, just confirming for others in case they get here for the same:
    The page_x is now fixed.

    I'll look further into the other ones.

 

 

Similar Threads

  1. Replies: 18
    Last Post: 27 Jan 2020, 05:29 PM
  2. Replies: 14
    Last Post: 7 Jan 2020, 08:21 PM
  3. v156 PHP Warning Use of undefined constant
    By ianhg in forum General Questions
    Replies: 6
    Last Post: 10 Oct 2019, 12:19 PM
  4. v155 adding constants - PHP Notice: Use of undefined constant
    By torvista in forum Contribution-Writing Guidelines
    Replies: 0
    Last Post: 4 May 2016, 07:07 AM

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