You must be logged in to view the page.×

Adjustment to home delivery module

Merchant
Da Australia
Membro dal giu 2023

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
Da Sweden
Membro dal mag 2013
tim

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

tim
Founder
Da Sweden
Membro dal mag 2013
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.

Tu
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.