Skip to content

Commit

Permalink
Fix an error on PHP8.
Browse files Browse the repository at this point in the history
We fixed an error with the Canpar shipping plugin on PHP8
https://www.hikashop.com/forum/shipping-methods/904088-canpar-shipping-error.html
  • Loading branch information
hikashop-nicolas authored Mar 9, 2022
1 parent ac2de4b commit f817d61
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plg_hikashopshipping_canpar/canpar.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

defined('_JEXEC') or die('Restricted access');

class plgHikashopshippingCANPAR extends hikashopShippingPlugin {
class plgHikashopshippingCanpar extends hikashopShippingPlugin {
var $canpar_methods = array(
array('key' => '1', 'code'=>'1', 'name' => 'Ground', 'countries' => 'CANADA'),
array('key' => '2', 'code'=>'2','name' => 'USA', 'countries' => 'USA'),
Expand Down Expand Up @@ -143,11 +143,11 @@ function onShippingDisplay(&$order, &$dbrates, &$usable_rates, &$messages) {
$selected_method = $canpar_method['key'];
}
}
$local_usable_rates[$i]->shipping_name = $name;
$local_usable_rates[$i]->shipping_name .= ' ' . $name;
if(!empty($selected_method))
$local_usable_rates[$i]->shipping_id .= '-' . $selected_method;

if ($method['deliveryDate'] != 'www.canpar.ca') {
if (!empty($method['deliveryDate']) && $method['deliveryDate'] != 'www.canpar.ca') {
if (is_numeric($method['deliveryDate'])) {
$timestamp = strtotime($method['deliveryDate']);
$time = parent::displayDelaySECtoDAY($timestamp - strtotime('now'), 2);
Expand Down Expand Up @@ -329,7 +329,7 @@ function _getBestMethods(&$rate, &$order, &$usableWarehouses, $null) {
if (empty($usableWarehouses)) {
return false;
}
$method_available = '';
$method_available = array();

foreach ($usableWarehouses as $k => $warehouse) {
if (!empty($warehouse -> methods)) {
Expand Down

0 comments on commit f817d61

Please sign in to comment.