Discount Codes

Blank Screen when I try to install it - Discount Codes

Blank Screen when I try to install it

by Omar_one » Sun May 02, 2021 11:47 am

Hello raiwa
v1.0.8.2
MySQL 10.3.28-MariaDB
PHP Version: 7.4.16 (Zend 3.4.0)

I am trying to install the discount code and I get Blank Screen (HTTP ERROR 500) when try to install it

Code: Select all

This page isn’t working www.XXXX.fi is currently unable to handle this request.
HTTP ERROR 500

and here is the error on the log file

Code: Select all

[02-May-2021 14:24:25 Europe/Helsinki] PHP Notice:  Undefined variable: db in /home/xxxx/public_html/test/includes/modules/order_total/ot_discount.php on line 424
[02-May-2021 14:24:25 Europe/Helsinki] PHP Fatal error:  Uncaught Error: Call to a member function query() on null in /home/xxxx/public_html/test/includes/modules/order_total/ot_discount.php:424
Stack trace:
#0 /home/xxxx/public_html/test/kirje2/modules.php(84): ot_discount->install()
#1 {main}
  thrown in /home/xxxx/public_html/test/includes/modules/order_total/ot_discount.php on line 424
the lines 420-431

Code: Select all

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

      // CREATE NEEDED TABLES INTO DB
      $db->query("
        CREATE TABLE IF NOT EXISTS customers_to_discount_codes (
          customers_id int(11) NOT NULL default '0',
          discount_codes_id int(11) NOT NULL default '0',
          KEY customers_id (customers_id),
          KEY discount_codes_id (discount_codes_id)
          ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
        ");
BTW. I have customers_to_discount_codes table in the database from earlier version .

Br
Omar
Omar_one
VIP Member
VIP Member
Posts: 481
Joined: Fri Oct 25, 2019 5:06 pm
Contact:

Re: Blank Screen when I try to install it

by raiwa » Sun May 02, 2021 12:37 pm

Hi Omar,

Change:

Code: Select all

$db->query
to;

Code: Select all

$GLOBALS['db']->query
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
PhoenixCart Developer
PhoenixCart Developer
Posts: 1184
Joined: Sat Dec 21, 2019 8:08 am
Contact:

Re: Blank Screen when I try to install it

by Omar_one » Sun May 02, 2021 2:19 pm

Thank you Rainer.
I think I need to change every

Code: Select all

$db->query
in that file
Omar_one
VIP Member
VIP Member
Posts: 481
Joined: Fri Oct 25, 2019 5:06 pm
Contact:

Re: Blank Screen when I try to install it

by raiwa » Sun May 02, 2021 2:33 pm

Yes, sorry, I didn't check.
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
PhoenixCart Developer
PhoenixCart Developer
Posts: 1184
Joined: Sat Dec 21, 2019 8:08 am
Contact:

Re: Blank Screen when I try to install it

by Omar_one » Sun May 02, 2021 2:47 pm

raiwa wrote:Yes, sorry, I didn't check.
no worries... thank you its working. but there issue with payment module (paytrail) its add the discount to total, but not if I use Cash on Delivery module, its show right there ,

I have payment module (paytrail) working with discount code on the earlier version (Frozen) without issue.
Omar_one
VIP Member
VIP Member
Posts: 481
Joined: Fri Oct 25, 2019 5:06 pm
Contact:

Re: Blank Screen when I try to install it

by raiwa » Sun May 02, 2021 4:33 pm

I do not know this module. It may require to be updated for Phoenix and for compatibility with other Addons.
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
PhoenixCart Developer
PhoenixCart Developer
Posts: 1184
Joined: Sat Dec 21, 2019 8:08 am
Contact: