Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Hybrid View

  1. #1
    Join Date
    Mar 2022
    Location
    United States
    Posts
    8
    Plugin Contributions
    0

    Default Error when installing the shipping surcharge module

    I've followed the instructions for unzipping and uploading the files for the shipping surcharge module and it shows up in the "Order Totals Modules" list.

    Unfortunately when I click on it so the right hand side bar with the “Install” button should show up all I get is the partial list of the "Order Totals Modules" that shows above the shipping surcharge module. I see nothing of the list that should be below and no right hand side bar were the ”Install” button should be.

    Image A
    Click image for larger version. 

Name:	Screenshot 2022-03-06 134714_a.jpg 
Views:	201 
Size:	26.6 KB 
ID:	19918

    Image B
    Click image for larger version. 

Name:	Screenshot 2022-03-06 134758_b.jpg 
Views:	201 
Size:	26.8 KB 
ID:	19919

    Here is the debug log file that I get with it. (I've replaced admin folder name and IP address with *)

    [06-Mar-2022 19:35:54 UTC] PHP Fatal error: Uncaught Error: Call to a member function Execute() on null in /includes/modules/order_total/ot_shippingsurcharge.php:115
    Stack trace:
    #0 /*********/modules.php(218): ot_shippingsurcharge->keys()
    #1 /*********/index.php(11): require('/nfs/home4/home...')
    #2 {main}
    thrown in /includes/modules/order_total/ot_shippingsurcharge.php on line 115

    [06-Mar-2022 19:35:54 UTC] Request URI: /*********/index.php?cmd=modules&set=ordertotal&module=ot_shippingsurcharge, IP address: ***.**.**.**
    --> PHP Fatal error: Uncaught Error: Call to a member function Execute() on null in /includes/modules/order_total/ot_shippingsurcharge.php:115
    Stack trace:
    #0 /*********/modules.php(218): ot_shippingsurcharge->keys()
    #1 /*********/index.php(11): require('/nfs/home4/home...')
    #2 {main}
    thrown in /includes/modules/order_total/ot_shippingsurcharge.php on line 115.

    Thanks for any help that anyone can provide. I'm just a beginner at this coding stuff.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Screenshot 2022-03-06 134714.jpg 
Views:	302 
Size:	23.7 KB 
ID:	19916   Click image for larger version. 

Name:	Screenshot 2022-03-06 134758.jpg 
Views:	309 
Size:	17.9 KB 
ID:	19917  

  2. #2
    Join Date
    Mar 2022
    Location
    United States
    Posts
    8
    Plugin Contributions
    0

    Default Re: Error when installing the shipping surcharge module

    Is there anybody out there?

  3. #3
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Error when installing the shipping surcharge module

    Able to provide the code that is at line 115 and before to a point where you see something like:
    function
    public function
    protected function
    static function

    Or any thing like the above?

    The error message suggests that a variable or class method is being used that hasn't been set or shared in the current code space.

    Should be an easy fix. Also may help to post the location where this code is available. Suggest including the version number installed to your system and php version.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #4
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Error when installing the shipping surcharge module

    I forgot to mention. Good job of working this far to try to solve the problem. You identified a partial blank screen and checked your logs for what might be causing the issue. Then you posted the logs for interpretation.

    Ideally the associated software would have a forum thread in which to post this issue. Can't tell yet because of not knowing from where it was downloaded.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Mar 2022
    Location
    United States
    Posts
    8
    Plugin Contributions
    0

    Default Re: Error when installing the shipping surcharge module

    Quote Originally Posted by mc12345678 View Post
    Able to provide the code that is at line 115 and before to a point where you see something like:
    function
    public function
    protected function
    static function

    Or any thing like the above?

    The error message suggests that a variable or class method is being used that hasn't been set or shared in the current code space.

    Should be an easy fix. Also may help to post the location where this code is available. Suggest including the version number installed to your system and php version.
    I meant to include the ZenCart version and PHP version being used on the server but I forgot. ZenCart Version is 1.5.7c. The PHP version running on the server at this time is 7.4
    The site that I'm working with is https://eastforksales.com/.

    Lines 98 thru 115:
    function check() {
    global $db;
    if (!isset($this->_check)) {
    $check_query = "SELECT configuration_value
    FROM " . TABLE_CONFIGURATION . "
    WHERE configuration_key = 'MODULE_ORDER_TOTAL_SHIPPINGSURCHARGE_STATUS'";

    $check_query = $db->Execute($check_query);
    $this->_check = $check_query->RecordCount();
    }

    return $this->_check;
    }

    function keys() {

    if (!defined('MODULE_ORDER_TOTAL_SHIPPINGSURCHARGE_VALUE_THRESHOLD')) {
    $db->Execute(" " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Value threshold for Shipping Surcharge', 'MODULE_ORDER_TOTAL_SHIPPINGSURCHARGE_VALUE_THRESHOLD', '0', 'Charge shipping surcharge for orders over this value.', '6', '4', now())");

    I hope that this is the info that you were looking for.
    Thanks.
    Last edited by Semi-Crazy; 18 Mar 2022 at 02:08 AM.

  6. #6
    Join Date
    Mar 2022
    Location
    United States
    Posts
    8
    Plugin Contributions
    0

    Default Re: Error when installing the shipping surcharge module

    Thanks to Everyone for the input. The changes swguy made did the trick!

  7. #7
    Join Date
    Mar 2022
    Location
    United States
    Posts
    8
    Plugin Contributions
    0

    Default Re: Error when installing the shipping surcharge module

    Quote Originally Posted by mc12345678 View Post
    Able to provide the code that is at line 115 and before to a point where you see something like:
    function
    public function
    protected function
    static function

    Or any thing like the above?

    The error message suggests that a variable or class method is being used that hasn't been set or shared in the current code space.

    Should be an easy fix. Also may help to post the location where this code is available. Suggest including the version number installed to your system and php version.
    Downloaded the plug-in from here. https://www.zen-cart.com/downloads.php?do=file&id=2308. Written by "That Software Guy".

    Thanks for all your help!

  8. #8
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,532
    Plugin Contributions
    127

    Default Re: Error when installing the shipping surcharge module

    Pull the latest version - it has the fix you wanted.
    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.

  9. #9
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,915
    Plugin Contributions
    13

    Default Re: Error when installing the shipping surcharge module

    Quote Originally Posted by Semi-Crazy View Post
    I've followed the instructions for unzipping and uploading the files for the shipping surcharge module and it shows up in the "Order Totals Modules" list.

    Unfortunately when I click on it so the right hand side bar with the “Install” button should show up all I get is the partial list of the "Order Totals Modules" that shows above the shipping surcharge module. I see nothing of the list that should be below and no right hand side bar were the ”Install” button should be.

    Image A
    Click image for larger version. 

Name:	Screenshot 2022-03-06 134714_a.jpg 
Views:	201 
Size:	26.6 KB 
ID:	19918

    Image B
    Click image for larger version. 

Name:	Screenshot 2022-03-06 134758_b.jpg 
Views:	201 
Size:	26.8 KB 
ID:	19919

    Here is the debug log file that I get with it. (I've replaced admin folder name and IP address with *)

    [06-Mar-2022 19:35:54 UTC] PHP Fatal error: Uncaught Error: Call to a member function Execute() on null in /includes/modules/order_total/ot_shippingsurcharge.php:115
    Stack trace:
    #0 /*********/modules.php(218): ot_shippingsurcharge->keys()
    #1 /*********/index.php(11): require('/nfs/home4/home...')
    #2 {main}
    thrown in /includes/modules/order_total/ot_shippingsurcharge.php on line 115

    [06-Mar-2022 19:35:54 UTC] Request URI: /*********/index.php?cmd=modules&set=ordertotal&module=ot_shippingsurcharge, IP address: ***.**.**.**
    --> PHP Fatal error: Uncaught Error: Call to a member function Execute() on null in /includes/modules/order_total/ot_shippingsurcharge.php:115
    Stack trace:
    #0 /*********/modules.php(218): ot_shippingsurcharge->keys()
    #1 /*********/index.php(11): require('/nfs/home4/home...')
    #2 {main}
    thrown in /includes/modules/order_total/ot_shippingsurcharge.php on line 115.

    Thanks for any help that anyone can provide. I'm just a beginner at this coding stuff.
    in /includes/modules/order_total/ot_shippingsurcharge.php lines 114-119 SHOULD be deleted:

    PHP Code:
    if (!defined('MODULE_ORDER_TOTAL_SHIPPINGSURCHARGE_VALUE_THRESHOLD')) {
          
    $db->Execute("insert into " TABLE_CONFIGURATION " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Value threshold for Shipping Surcharge', 'MODULE_ORDER_TOTAL_SHIPPINGSURCHARGE_VALUE_THRESHOLD', '0', 'Charge shipping surcharge for orders over this value.', '6', '4', now())");
          }
    if (!
    defined('MODULE_ORDER_TOTAL_SHIPPINGSURCHARGE_WEIGHT_THRESHOLD')) {
          
    $db->Execute("insert into " TABLE_CONFIGURATION " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Weight threshold for Shipping Surcharge', 'MODULE_ORDER_TOTAL_SHIPPINGSURCHARGE_WEIGHT_THRESHOLD', '0', 'Charge shipping surcharge for orders over this weight.', '6', '4', now())");
          } 
    alternatively one could comment them out.

    @swguy is the plugin author. it needs fixing.
    author of square Webpay.
    mxWorks now has Apple Pay and Google Pay. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  10. #10
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Error when installing the shipping surcharge module

    Quote Originally Posted by carlwhat View Post
    in /includes/modules/order_total/ot_shippingsurcharge.php lines 114-119 SHOULD be deleted:

    PHP Code:
    if (!defined('MODULE_ORDER_TOTAL_SHIPPINGSURCHARGE_VALUE_THRESHOLD')) {
          
    $db->Execute("insert into " TABLE_CONFIGURATION " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Value threshold for Shipping Surcharge', 'MODULE_ORDER_TOTAL_SHIPPINGSURCHARGE_VALUE_THRESHOLD', '0', 'Charge shipping surcharge for orders over this value.', '6', '4', now())");
          }
    if (!
    defined('MODULE_ORDER_TOTAL_SHIPPINGSURCHARGE_WEIGHT_THRESHOLD')) {
          
    $db->Execute("insert into " TABLE_CONFIGURATION " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Weight threshold for Shipping Surcharge', 'MODULE_ORDER_TOTAL_SHIPPINGSURCHARGE_WEIGHT_THRESHOLD', '0', 'Charge shipping surcharge for orders over this weight.', '6', '4', now())");
          } 
    alternatively one could comment them out.

    @swguy is the plugin author. it needs fixing.
    I disagree with the need to comment out or remove the code. Perhaps for this user if the software has never ever been installed to the store, though there is little information provided about the history of the particular store's database.

    The code requested to be posted was:
    Code:
        function keys() {
    
          if (!defined('MODULE_ORDER_TOTAL_SHIPPINGSURCHARGE_VALUE_THRESHOLD')) {
              $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Value threshold for Shipping Surcharge', 'MODULE_ORDER_TOTAL_SHIPPINGSURCHARGE_VALUE_THRESHOLD', '0', 'Charge shipping surcharge for orders over this value.', '6', '4', now())");
    The fix to this is to ensure that $db is set to something meaningful. As provided it is null because it is undeclared. In Zen Cart, $db is intended to provide access to the database and related functions. That is typically done by making the variable global or globally accessible.

    So the fix would be to add the following line:
    Code:
        function keys() {
          global $db;
    
    
          if (!defined('MODULE_ORDER_TOTAL_SHIPPINGSURCHARGE_VALUE_THRESHOLD')) {
              $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Value threshold for Shipping Surcharge', 'MODULE_ORDER_TOTAL_SHIPPINGSURCHARGE_VALUE_THRESHOLD', '0', 'Charge shipping surcharge for orders over this value.', '6', '4', now())");
    As to the appropriate location to get the best help on this software? That would be in the forum thread for the plugin: https://www.zen-cart.com/showthread....ping-Surcharge
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 16
    Last Post: 28 Sep 2020, 02:18 AM
  2. Add a flat surcharge into cart when using USPS module?
    By stride-r in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 9 Dec 2008, 02:57 AM
  3. Installing shipping module causes headers already sent error
    By swguy in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 22 Dec 2007, 06:19 PM
  4. Error installing cloned zone shipping module
    By shocker in forum Built-in Shipping and Payment Modules
    Replies: 11
    Last Post: 16 Aug 2007, 04:15 AM
  5. Canada Post shipping module - Fuel Surcharge
    By jbrit in forum Addon Shipping Modules
    Replies: 0
    Last Post: 4 Aug 2006, 05:36 AM

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