Post by SenerK » Sun Apr 03, 2022 8:23 pm

Hello,

In PHP7.4 I get an error like this in the plugin, how can I solve it?
Unknown: Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in /public_html/catalog/model/extension/total/promotion_total.php on line 1260
promotion_total.php on line 1260;

Code: Select all


1260				$promotion_name = isset($general_settings['name'][$this->config->get('config_language')]) ? $general_settings['name'][$this->config->get('config_language')] : is_array($general_settings['name']) ? end($general_settings['name']) : '';
1261
1262				$conditions = $value['conditions'];
1263				$condition_rules = $value['condition_rules'];
1264				$actions = $value['actions'];
1265				$total_promotion = 0;
1266				$this->usedProducts = array();
Thanks,
Sener
Last edited by SenerK on Mon Apr 04, 2022 4:05 am, edited 2 times in total.

Newbie

Posts

Joined
Wed Oct 09, 2019 3:21 am

Post by JNeuhoff » Sun Apr 03, 2022 9:13 pm

There is no catalog/model/extension/total/promotion_total.php in OpenCart 3.0.x.x releases.

Hence, you'll have to contact the extension author to fix this line, which should be easily done.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by straightlight » Mon Apr 04, 2022 12:40 am

Code: Select all

if (isset($general_settings['name'][$this->config->get('config_language')])) {
	$promotion_name = $general_settings['name'][$this->config->get('config_language')];
} elseif (!empty($general_settings['name']) && is_array($general_settings['name'])) {
	$promotion_name = end($general_settings['name']);
}

$conditions = $value['conditions'];

$condition_rules = $value['condition_rules'];

$actions = $value['actions'];

$total_promotion = 0;

$this->usedProducts = array();

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by SenerK » Mon Apr 04, 2022 4:04 am

Thanks, problem solved!
straightlight wrote:
Mon Apr 04, 2022 12:40 am

Code: Select all

if (isset($general_settings['name'][$this->config->get('config_language')])) {
	$promotion_name = $general_settings['name'][$this->config->get('config_language')];
} elseif (!empty($general_settings['name']) && is_array($general_settings['name'])) {
	$promotion_name = end($general_settings['name']);
}

$conditions = $value['conditions'];

$condition_rules = $value['condition_rules'];

$actions = $value['actions'];

$total_promotion = 0;

$this->usedProducts = array();

Newbie

Posts

Joined
Wed Oct 09, 2019 3:21 am

Post by straightlight » Mon Apr 04, 2022 4:23 am

SenerK wrote:
Mon Apr 04, 2022 4:04 am
Thanks, problem solved!
straightlight wrote:
Mon Apr 04, 2022 12:40 am

Code: Select all

if (isset($general_settings['name'][$this->config->get('config_language')])) {
	$promotion_name = $general_settings['name'][$this->config->get('config_language')];
} elseif (!empty($general_settings['name']) && is_array($general_settings['name'])) {
	$promotion_name = end($general_settings['name']);
}

$conditions = $value['conditions'];

$condition_rules = $value['condition_rules'];

$actions = $value['actions'];

$total_promotion = 0;

$this->usedProducts = array();
No problem, enjoy!

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 11 guests