15 May 2025, 12:09
#1
New Zenner
- Join Date:
- Jul 2017
- Posts:
- 50
- Plugin Contributions:
- 1
UK shipping by postcode error logs
Hi,
I have installed the UK shipping by postcode module (on ZenCart 2.1.0 using PHP 8.3).
When viewing the shopping cart, a couple of PHP logs are generated due to the delivery postcode not being available/entered yet. The shipping estimator successfully displays at the bottom of the page, but the following logs are generated:
Please see below lines 178 and 179 of ukpost.php
The errors are only generated if a postcode has not been entered. Any help with this issue would be much appreciated.
Rick
I have installed the UK shipping by postcode module (on ZenCart 2.1.0 using PHP 8.3).
When viewing the shopping cart, a couple of PHP logs are generated due to the delivery postcode not being available/entered yet. The shipping estimator successfully displays at the bottom of the page, but the following logs are generated:
--> PHP Warning: Undefined array key "postcode" in ……../includes/modules/shipping/ukpost.php on line 178.
--> PHP Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in ……../includes/modules/shipping/ukpost.php on line 179.Please see below lines 178 and 179 of ukpost.php
$destination_postcode = $order->delivery['postcode'];
$pcode = preg_replace('/\s\s*/', '', $destination_postcode);The errors are only generated if a postcode has not been entered. Any help with this issue would be much appreciated.
Rick