Post by 63BeetleSmurf » Sat Jul 08, 2017 6:46 am


I am setting up a new site using OpenCart and I'm having some trouble with the modifications.

When I upload my modification I keep getting the error "Unique code is required for modification XML!".

I am putting my install.xml file in a zip called "" and my XML code is as follows;

<?xml version="1.0" encoding="utf-8"?>
<name>Header Links In Menu</name>
<author>Murphys Place</author>
<file path="catalog/controller/common/menu.php">
<search><![CDATA[return $this->load->view('common/menu', $data);]]></search>
<add position="before"><![CDATA[if ($this->customer->isLogged()) {

$data['text_wishlist'] = sprintf($this->language->get('text_wishlist'), $this->model_account_wishlist->getTotalWishlist());
} else {
$data['text_wishlist'] = sprintf($this->language->get('text_wishlist'), (isset($this->session->data['wishlist']) ? count($this->session->data['wishlist']) : 0));

$data['wishlist'] = $this->url->link('account/wishlist', '', true);
$data['account'] = $this->url->link('account/account', '', true);
$data['register'] = $this->url->link('account/register', '', true);
$data['login'] = $this->url->link('account/login', '', true);
$data['checkout'] = $this->url->link('checkout/checkout', '', true);

$data['currency'] = $this->load->controller('common/currency');]]></add>

I have moved the account, wish list and checkout links down into the menu and everything works great editing the original controller file to add the required variables, but obviously I don't want to edit core files so I'm trying to do it with a modification file.

Last edited by straightlight on Thu Jan 30, 2020 9:21 pm, edited 2 times in total.
Reason: Code tags don't seem to work with XML file headers.



Thu Jul 06, 2017 4:58 am

Post by Johnathan » Sat Jul 08, 2017 11:33 pm

You need a <code> tag after the <name> tag. It's not specified in the documentation, because that hasn't been updated for a long time, but it should be. For example:


Image Image Image Image Image

User avatar


Fri Dec 18, 2009 3:08 am

Who is online

Users browsing this forum: No registered users and 0 guests