On my hosting with php 7.4 after upgrade from version 3.0.2.0 to 3.0.3.8 I notice that when I place a product in the cart and click on checkout I have this message
Warning: A non-numeric value encountered in /home/....../public_html/....../catalog/model/extension/total/shipping.php on line 24
... where on line 24 I have
$total['total'] += $this->session->data['shipping_method']['cost'];
...and after upgrade doesn't work anymore seo urls that instead worked on 3.0.2.0
Anyone has suggestions?
thanks
Warning: A non-numeric value encountered in /home/....../public_html/....../catalog/model/extension/total/shipping.php on line 24
... where on line 24 I have
$total['total'] += $this->session->data['shipping_method']['cost'];
...and after upgrade doesn't work anymore seo urls that instead worked on 3.0.2.0
Anyone has suggestions?
thanks
On line 4 of that file, replace:opensab677 wrote: ↑Sun Mar 13, 2022 10:23 pmOn my hosting with php 7.4 after upgrade from version 3.0.2.0 to 3.0.3.8 I notice that when I place a product in the cart and click on checkout I have this message
Warning: A non-numeric value encountered in /home/....../public_html/....../catalog/model/extension/total/shipping.php on line 24
... where on line 24 I have
$total['total'] += $this->session->data['shipping_method']['cost'];
...and after upgrade doesn't work anymore seo urls that instead worked on 3.0.2.0
Anyone has suggestions?
thanks
Code: Select all
if ($this->cart->hasShipping() && isset($this->session->data['shipping_method'])) {
Code: Select all
if ($this->cart->hasShipping() && isset($this->session->data['shipping_method']['title']) && isset($this->session->data['shipping_method']['cost'])) {
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
now in /catalog/model/extension/total/ (opencart 3.0.3.8 + Php 7.4)
the file shipping.php is like this below but the error persist
<?php
class ModelExtensionTotalShipping extends Model {
public function getTotal($total) {
if ($this->cart->hasShipping() && isset($this->session->data['shipping_method']['title']) && isset($this->session->data['shipping_method']['cost'])) {
$total['totals'][] = array(
'code' => 'shipping',
'title' => $this->session->data['shipping_method']['title'],
'value' => $this->session->data['shipping_method']['cost'],
'sort_order' => $this->config->get('total_shipping_sort_order')
);
if ($this->session->data['shipping_method']['tax_class_id']) {
$tax_rates = $this->tax->getRates($this->session->data['shipping_method']['cost'], $this->session->data['shipping_method']['tax_class_id']);
foreach ($tax_rates as $tax_rate) {
if (!isset($total['taxes'][$tax_rate['tax_rate_id']])) {
$total['taxes'][$tax_rate['tax_rate_id']] = $tax_rate['amount'];
} else {
$total['taxes'][$tax_rate['tax_rate_id']] += $tax_rate['amount'];
}
}
}
$total['total'] += $this->session->data['shipping_method']['cost'];
}
}
}
the file shipping.php is like this below but the error persist
<?php
class ModelExtensionTotalShipping extends Model {
public function getTotal($total) {
if ($this->cart->hasShipping() && isset($this->session->data['shipping_method']['title']) && isset($this->session->data['shipping_method']['cost'])) {
$total['totals'][] = array(
'code' => 'shipping',
'title' => $this->session->data['shipping_method']['title'],
'value' => $this->session->data['shipping_method']['cost'],
'sort_order' => $this->config->get('total_shipping_sort_order')
);
if ($this->session->data['shipping_method']['tax_class_id']) {
$tax_rates = $this->tax->getRates($this->session->data['shipping_method']['cost'], $this->session->data['shipping_method']['tax_class_id']);
foreach ($tax_rates as $tax_rate) {
if (!isset($total['taxes'][$tax_rate['tax_rate_id']])) {
$total['taxes'][$tax_rate['tax_rate_id']] = $tax_rate['amount'];
} else {
$total['taxes'][$tax_rate['tax_rate_id']] += $tax_rate['amount'];
}
}
}
$total['total'] += $this->session->data['shipping_method']['cost'];
}
}
}
See this solution inside the method: https://github.com/opencart/opencart/bl ... ipping.php (and exclude the 'extension' key line in the array).
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Who is online
Users browsing this forum: No registered users and 4 guests