Hi, I hope someone can help me, as I'm pulling my hair out trying to fix this and getting nowhere.
I installed a shipping add-on for UK Postal Rates (Royal Mail Complete Module, amongst many other add-ons which are all running fine) and copied/edited it for more shipping options and these work fine. I also modified one of the shipping file sets to make a shipping option for Europe. This set up fine in admin and looked OK, but when a customer from one of those countries (Italy in this case, which has been added to this option) recently tried to purchase something, as soon as they clicked on checkout, they got this error:
Fatal error: Cannot use string offset as an array in /home/expanxen/public_html/includes/classes/shipping.php on line 99
I've since set up a dummy customer from Italy and tried it myself and get the same error every time, whereas UK customers have no problem at all.
As far as I know, the code in this file has not been modified (I've copy/pasted this bit back in from a backed-up original file just in case, with no change) and I can't figure out what is causing the error, as I'm very new to php. I've searched the forums and although I have found similar problems, I have not found this exact one and can't figure out what is going on.
The add-on was for a single zone, but I've changed it for multiple zones (this was a simple option already in the code), so maybe I haven't got my Admin setup quite right and it might not be the code at all, though I think I've tried everything I can!
I'm using oscom 2.2rc2a on a Linux 2.6.31.6-grsec-VISION server with Apache, php5.2.6 (Zend: 2.2.0) and MySQL 5.0.91-community. Everything else seems to be running OK.
The snippet of the code the error is referring to is below (line 99 is in blue):
function cheapest() {
if (is_array($this->modules)) {
$rates = array();
reset($this->modules);
while (list(, $value) = each($this->modules)) {
$class = substr($value, 0, strrpos($value, '.'));
if ($GLOBALS[$class]->enabled) {
$quotes = $GLOBALS[$class]->quotes;
for ($i=0, $n=sizeof($quotes['methods']); $i<$n; $i++) {
if (isset($quotes['methods'][$i]['cost']) && tep_not_null($quotes['methods'][$i]['cost'])) {
$rates[] = array('id' => $quotes['id'] . '_' . $quotes['methods'][$i]['id'],
'title' => $quotes['module'] . ' (' . $quotes['methods'][$i]['title'] . ')',
'cost' => $quotes['methods'][$i]['cost']);
}
}
}
}
Any help would be much appreciated.