Discount Codes

Error on 1.0.8.04 - Discount Codes

Error on 1.0.8.04

by gsmiley007 » Thu Jul 01, 2021 10:44 pm

Tested discount code: 5.6.0 on Fresh install of 1.0.8.04

Tried to install module:

Notice: Undefined variable: db in /includes/modules/order_total/ot_discount.php on line 424

Fatal error: Uncaught Error: Call to a member function query() on null in /includes/modules/order_total/ot_discount.php:424 Stack trace: #0 /admin/modules.php(84): ot_discount->install() #1 {main} thrown in /includes/modules/order_total/ot_discount.php on line 424
gsmiley007
Member
Posts: 82
Joined: Sun Mar 14, 2021 9:28 pm
Phoenix Version:
Contact:

Re: Error on 1.0.8.04

by raiwa » Fri Jul 02, 2021 6:28 am

Yes, thank you. $db globalization is missing in the install and remove functions.
Please add it in includes/modules/order_total/ot_discount.php:
in line 422 to look like this:

Code: Select all

    function install($parameter_key = null) {
      parent::install($parameter_key);
      global $db;

      // CREATE NEEDED TABLES INTO DB
and in line 496 to look like this:

Code: Select all

    function remove($parameter_key = null) {
      parent::remove($parameter_key);
      global $db;

      if ( defined('MODULE_ORDER_TOTAL_DISCOUNT_DELETE_TABLES') && MODULE_ORDER_TOTAL_DISCOUNT_DELETE_TABLES == 'True' ) {
Meanwhile version 5.6.0 is flagged for Phoenix 1.0.8.2. You may get other errors on Phoenix 1.0.8.4.
PLease wait for the next update.
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing

Need Help?viewtopic.php?f=10&t=27
raiwa
Certified Developer
Posts: 1640
Joined: Sat Dec 21, 2019 8:08 am
Phoenix Version: 1.1.0.6
Contact: