Adjustment to home delivery module

Merchant
Alates Australia
Liige alates

I was getting a deprecated command error with litecart and PHP 8.2 for the below:

$customer['shipping_address']['postcode'] = preg_replace('#([0-9]{3})-?([0-9]{2})#', '$1$2',
$customer['shipping_address']['postcode']);

This was the fix:

if (isset($customer['shipping_address']['postcode'])) {
    $postcode = $customer['shipping_address']['postcode'];
    $postcode = preg_replace('#([0-9]{3})-?([0-9]{2})#', '$1$2', $postcode);
    $customer['shipping_address']['postcode'] = $postcode;
}

tim
Founder
Alates Sweden
Liige alates
tim

What file is this? PHP 8.2 will go bananas if passing null when expecting a string argument.

tim
Founder
Alates Sweden
Liige alates
tim

Ok, I moved this forum topic from Feature Requests to the Addons section, connecting it to the right addon. For Public Domain addons you are allowed to upload updates of the addons directly on the addon page.

Teie
This website uses no cookies and no third party tracking technology. We think we can do better than others and really think about your privacy.