Adjustment to home delivery module

Merchant
Van Australia
Lid sinds jun. 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
Van Sweden
Lid sinds mei 2013
tim

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

tim
Founder
Van Sweden
Lid sinds mei 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.

U
Deze website maakt geen gebruik van cookies en geen trackingtechnologie van derden . Wij denken dat we het beter kunnen dan anderen en hechten veel waarde aan uw privacy.