Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2007
    Location
    Woodbine, Georgia, United States
    Posts
    4,044
    Plugin Contributions
    61

    Default [Beta] Call to undefined function zen_has_product_specials() in copy_product.php

    More than one installation with the error

    Zen Cart 2.0
    Boot 3.6.4
    OPC 2.5.1
    PHP 8.3.6
    MySQL 8.0.37

    [14-May-2024 18:24:18 UTC] Request URI: /XXX/index.php?cmd=category_product_listing&cPath=171&product_type=1&pID=8077&action= copy_product&page=1, IP address: 134.215.175.155
    --> PHP Fatal error: Uncaught Error: Call to undefined function zen_has_product_specials() in /home/XXX/public_html/XXX/includes/modules/copy_product.php:60
    Stack trace:
    #0 /home/XXX/public_html/XXX/category_product_listing.php(1165): require()
    #1 /home/XXX/public_html/XXX/index.php(11): require('/home/XXX/pu...')
    #2 {main}
    thrown in /home/XXX/public_html/XXX/includes/modules/copy_product.php on line 60.

    [14-May-2024 18:24:18 UTC] Request URI: /XXX/index.php?cmd=category_product_listing&cPath=171&product_type=1&pID=8077&action= copy_product&page=1, IP address: 134.215.175.155
    --> PHP Fatal error: Uncaught Error: Call to undefined function zen_has_product_specials() in /home/XXX/public_html/XXX/includes/modules/copy_product.php:60
    Stack trace:
    #0 /home/XXX/public_html/XXX/category_product_listing.php(1165): require()
    #1 /home/XXX/public_html/XXX/index.php(11): require('/home/XXX/pu...')
    #2 {main}
    thrown in /home/XXX/public_html/XXX/includes/modules/copy_product.php on line 60.
    PRO-Webs, Inc. :: Recent Zen Cart Projects :: Zen Cart SEO – 12 Steps to Success
    **I answer questions in the forum, private messages are NOT answered. You are welcome to contact us via our website for professional engagements.

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

    Default Re: Possible Bug

    You should have a file

    admin/includes/init_includes/init_general_funcs.php

    that contains:

    require DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'functions_products.php';
    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.

  3. #3
    Join Date
    Nov 2007
    Location
    Woodbine, Georgia, United States
    Posts
    4,044
    Plugin Contributions
    61

    Default Re: Possible Bug

    Quote Originally Posted by swguy View Post
    You should have a file

    admin/includes/init_includes/init_general_funcs.php

    that contains:

    require DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'functions_products.php';
    I do

    <?php
    /**
    * @copyright Copyright 2003-2024 Zen Cart Development Team
    * @copyright Portions Copyright 2003 osCommerce
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    * @version $Id: DrByte 2024 Mar 22 Modified in v2.0.0 $
    */
    if (!defined('IS_ADMIN_FLAG')) {
    die('Illegal Access');
    }

    // customization for the design layout
    define('BOX_WIDTH', 125); // how wide the boxes should be in pixels (default: 125)


    require 'includes/init_includes/init_pci_settings.php';

    require DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'database.php';

    require DIR_WS_FUNCTIONS . 'general.php';

    require DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'functions_general_shared.php';
    require DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'functions_attributes.php';
    require DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'functions_files.php';
    require DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'functions_traffic.php';
    require DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'functions_strings.php';
    require DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'functions_search.php';
    require DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'functions_addresses.php';
    require DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'functions_dates.php';
    require DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'functions_products.php';
    require DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'functions_categories.php';
    require DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'functions_prices.php';
    require DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'functions_taxes.php';
    require DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'functions_gvcoupons.php';
    require DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'functions_customers.php';
    require DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'functions_customer_groups.php';
    require DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'functions_lookups.php';
    require DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'functions_urls.php';

    require DIR_WS_FUNCTIONS . 'html_output.php';

    require DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'functions_email.php';
    require DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'functions_ezpages.php';
    require DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'plugin_support.php';
    require DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'password_funcs.php';

    /**
    * meta-tag editing functions
    */
    require DIR_WS_FUNCTIONS . 'functions_metatags.php';


    // include the list of extra functions
    foreach (zen_get_files_in_directory(DIR_WS_FUNCTIONS . 'extra_functions') as $file) {
    require $file;
    }

    if (isset($_GET) & sizeof($_GET) > 0 ) {
    foreach ($_GET as $key=>$value) {
    $_GET[$key] = strip_tags($value);
    }
    }

    // check for SSL configuration changes:
    if (!defined('SSLPWSTATUSCHECK')) die('database upgrade required. please run the 1.3.9-to-1.5.0 upgrade via zc_install');
    $e = (substr(HTTP_SERVER, 0, 5) == 'https') ? '1' : '0';
    if (SSLPWSTATUSCHECK == '') {
    $sql = "UPDATE " . TABLE_CONFIGURATION . " set configuration_value = '".$e.':'.$e."', last_modified = now() where configuration_key = 'SSLPWSTATUSCHECK'";
    $db->Execute($sql);
    die('<meta http-equiv="Refresh" content="0">One-time auto-configuration completed. Please refresh the page.');
    }
    list($a, $c) = explode(':', SSLPWSTATUSCHECK); $a = (int)$a; $c = (int)$c;
    if ($a == 0) {
    if ($c == 0 && $e == 1) { // was nonSSL but now is SSL, so need to exp pwds
    $sql = "UPDATE " . TABLE_CONFIGURATION . " set configuration_value = '1:" . $e . "', last_modified = now() where configuration_key = 'SSLPWSTATUSCHECK'";
    $db->Execute($sql);
    $sql = "UPDATE " . TABLE_ADMIN . " set pwd_last_change_date = '1990-01-01 14:02:22'";
    $db->Execute($sql);
    }
    if ($c == 1 && $e == 0) { // was nonSSL then SSL and now nonSSL again, so recording that we're now nonSSL
    $sql = "UPDATE " . TABLE_CONFIGURATION . " set configuration_value = '0:". $e . "', last_modified = now() where configuration_key = 'SSLPWSTATUSCHECK'";
    $db->Execute($sql);
    }
    } else if ($a == 1) { // == 1
    if ($c == 1 && $e == 0) { // was SSL, but is now nonSSL, so recording the change
    $sql = "UPDATE " . TABLE_CONFIGURATION . " set configuration_value = '0:". $e . "', last_modified = now() where configuration_key = 'SSLPWSTATUSCHECK'";
    $db->Execute($sql);
    }
    if ($c == 0 && $e == 1) { // was changed to SSL last time checked, so recording that is all SSL now
    $sql = "UPDATE " . TABLE_CONFIGURATION . " set configuration_value = '1:" . $e . "', last_modified = now() where configuration_key = 'SSLPWSTATUSCHECK'";
    $db->Execute($sql);
    }
    }
    unset($a,$c,$e);
    // end ssl config change detection
    yep
    PRO-Webs, Inc. :: Recent Zen Cart Projects :: Zen Cart SEO – 12 Steps to Success
    **I answer questions in the forum, private messages are NOT answered. You are welcome to contact us via our website for professional engagements.

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

    Default Re: Possible Bug

    I'm stumped. Copy product with product type 1 works for me in ZC 2.0.0/PHP8.3. Let's see if someone else can reproduce it.
    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.

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,595
    Plugin Contributions
    88

    Default Re: Possible Bug

    How about the sites' /includes/functions/functions_products.php. For the zc200 release, lines 838-849 contain
    PHP Code:
    /**
     * Check if a product in the catalogue has a special price defined or not.
     *
     * @param int $product_id
     * @return boolean
     */
    function zen_has_product_specials(int $product_id): bool
    {
        global 
    $db;
        
    $result $db->Execute('SELECT products_id FROM ' TABLE_SPECIALS " WHERE products_id = $product_id"1);
        return !
    $result->EOF;


  6. #6
    Join Date
    Nov 2007
    Location
    Woodbine, Georgia, United States
    Posts
    4,044
    Plugin Contributions
    61

    Default Re: Possible Bug

    Verified replacing the file fixes the issue. It is the beta release was the reason why
    PRO-Webs, Inc. :: Recent Zen Cart Projects :: Zen Cart SEO – 12 Steps to Success
    **I answer questions in the forum, private messages are NOT answered. You are welcome to contact us via our website for professional engagements.

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

    Default Re: Possible Bug

    You may want to double check all your files in that case to make sure you have the final 2.0.0 fileset.
    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.

  8. #8
    Join Date
    Nov 2007
    Location
    Woodbine, Georgia, United States
    Posts
    4,044
    Plugin Contributions
    61

    Default Re: Possible Bug

    Quote Originally Posted by swguy View Post
    You may want to double check all your files in that case to make sure you have the final 2.0.0 fileset.
    Wasn't my build, but upgrading it =)
    PRO-Webs, Inc. :: Recent Zen Cart Projects :: Zen Cart SEO – 12 Steps to Success
    **I answer questions in the forum, private messages are NOT answered. You are welcome to contact us via our website for professional engagements.

 

 

Similar Threads

  1. v157 PHP Fatal error: Uncaught Error: Call to undefined function ctype_digit()
    By katrobb in forum Installing on a Linux/Unix Server
    Replies: 2
    Last Post: 30 Jun 2021, 02:23 AM
  2. Replies: 4
    Last Post: 10 Nov 2018, 01:32 PM
  3. v155 PHP Fatal error: Uncaught Error: Call to undefined function mysqli_close()
    By Brent in forum Installing on a Linux/Unix Server
    Replies: 2
    Last Post: 2 Apr 2018, 04:03 PM
  4. v155 PHP Fatal error: Call to undefined function cfg_select_option
    By JakeLawless in forum General Questions
    Replies: 2
    Last Post: 21 Mar 2018, 08:02 PM
  5. Call to undefined function
    By Forum5 in forum General Questions
    Replies: 10
    Last Post: 14 Sep 2010, 02:43 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