I\'ll keep this simple.... on my product pages I need to remove the prototype.js file and replace it with the latest version of prototype. So far using local.xml I have successf
Ok here's my solution. First copy app\code\core\Mage\Page\Block\Html\head.php to app\code\local\Mage\Page\Block\Html\head.php
Then add this function to the file :
public function replaceItem($type, $name, $replace)
{
$newArray = array();
foreach($this->_data['items'] as $key => $value) {
if($key == $type.'/'.$name) {
$newArray[$type . '/'. $replace] = array(
'type' => $type,
'name' => $replace,
'params' => $value['params'],
'if' => $value['if'],
'cond' => $value['cond']);
} else {
$newArray[$key] = $value;
}
}
$this->_data['items'] = $newArray;
return $this;
}
Now in your .XML layout file include a line like this :
js prototype/prototype.js onestepcheckout/prototype/prototype.js
The parameters are exactly as for removeItem BUT now the replace file will be injected into the list in the same place as the original file. It will also inherit the same param, if and cond values. Please use this code carefully as I've only just written and done basic tests on it!