Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2019
    Location
    UK
    Posts
    103
    Plugin Contributions
    0

    Default Use of undefined constant - please help a novice

    I was moved to a larger web server recently and it has a slightly newer version of php and mysql which is causing me a lot of errors, I think I can fix the date standardization issues with info I already found here, but this one is causing a lot of logs to be generated and I'm not sure how to fix it, it's being caused by an extra function used to display prices with and without vat. Can I add something to a template file to declare this variable or do I need to add something to the configuration table? Any help would be much appreciate, even though the store is in maintenance mode its still generating hundreds of log files per hour.

    Code:
    [25-May-2024 13:05:48 UTC] Request URI: /, IP address: 66.249.66.80
    #1  include(/home/***/public_html/includes/functions/extra_functions/inc_ex_functions.php) called at [/home/***/public_html/includes/modules/extra_functions.php:43]
    #2  include(/home/***/public_html/includes/modules/extra_functions.php) called at [/home/***/public_html/includes/init_includes/init_general_funcs.php:51]
    #3  require_once(/home/***/public_html/includes/init_includes/init_general_funcs.php) called at [/home/***/public_html/includes/autoload_func.php:37]
    #4  require(/home/***/public_html/includes/autoload_func.php) called at [/home/***/public_html/includes/application_top.php:222]
    #5  require(/home/***/public_html/includes/application_top.php) called at [/home/***/public_html/index.php:25]
    --> PHP Warning: Use of undefined constant zen_get_products_display_price - assumed 'zen_get_products_display_price' (this will throw an Error in a future version of PHP) in /home/***/public_html/includes/functions/extra_functions/inc_ex_functions.php on line 10.
    Line 10 of inc_ex_functions.php starts here
    PHP Code:
    if(!function_exists(zen_get_products_display_price))
    {
     function 
    zen_get_products_display_price($products_id
     {
        return 
    get_products_display_price($products_id);
     }

    (I do plan to rebuild my store on the latest version of zen cart at some point, but I find the process of upgrading intimidating as i'm such a novice I haven't kept track of which files I've modified, or forgotten to override and modified core files, etc along the years and I have a habit of breaking things.)

    thegluepeople.co.uk

    Thanks

  2. #2
    Join Date
    Jan 2019
    Location
    UK
    Posts
    103
    Plugin Contributions
    0

    Default Re: Use of undefined constant - please help a novice

    I added this line to IncExTaxMod_defines.php (includes/languages/english/extra_definitions/bootstrap) but it still seems to be generating the same error.

    PHP Code:
    define('zen_get_products_display_price''zen_get_products_display_price'); 
    edit: I added those missing ' ' to line 10 around zen_get_products_display_price and the error logs seemed to stop.

    /facepalm
    Last edited by CunningStunt2; 25 May 2024 at 03:19 PM.

  3. #3
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,846
    Plugin Contributions
    124

    Default Re: Use of undefined constant - please help a novice

    Glad you had success with your fix!

    Remember there's a lightweight way to get you upgraded:
    https://docs.zen-cart.com/user/upgra..._only_upgrade/

    Then you can slowly and carefully introduce your changes, testing as you go.
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

 

 

Similar Threads

  1. v157 Use of undefined constant TEXT_ALL_MANUFACTURERS
    By webmanstudios in forum General Questions
    Replies: 7
    Last Post: 27 Mar 2024, 01:45 AM
  2. v156 Use of undefined constant MODULE_PAYMENT_AUTHORIZENET_AIM_CURRENCY
    By RixStix in forum Upgrading to 1.5.x
    Replies: 15
    Last Post: 4 Dec 2023, 05:56 PM
  3. v156 Use of undefined constant MODULE_PAYMENT_PAYFLOW_TRANSACTION_MODE
    By DigitalShadow in forum PayPal Website Payments Pro support
    Replies: 9
    Last Post: 15 Sep 2020, 04:56 PM
  4. Notice: Use of undefined constant
    By infocom in forum General Questions
    Replies: 2
    Last Post: 22 Apr 2010, 08:35 PM
  5. Undefined Notice: Use of undefined constant
    By TheOracle in forum Bug Reports
    Replies: 0
    Last Post: 6 May 2007, 06:33 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