Reputation: 3
How to remove opencart Advertisement in admin panel.
Here you see the Adverisement:
Upvotes: 0
Views: 1755
Reputation: 5
Perhaps better yet if your're going the edit route like I did:
<?php
class ControllerExtensionExtensionPromotion extends Controller {
public function index() {
// MOD Eliminate Admin promotions - just return nothing.
// we don't need to curl anything and might make site a touch faster
return '';
}
}
Upvotes: 0
Reputation: 780
Dmitriy Zhuk's answer is the easiest to apply. An alternative if you want the change as a mod is to use something like this:
<?xml version="1.0" encoding="utf-8"?>
<modification>
<name>Hide promotions in admin panel</name>
<code>skippromotion</code>
<version>3.0x</version>
<author>TH</author>
<link>https://stackoverflow.com/questions/55702884</link>
<file path="admin/controller/extension/extension/*.php">
<!-- Remove the 'promotions' feature -->
<operation error="log">
<search><![CDATA[$data['promotion'] = $this->load->controller('extension/extension/promotion');]]></search>
<add position="replace"><![CDATA[
$data['promotion'] = '';
]]></add>
</operation>
</file>
</modification>
Save it as 'install.xml', zip it up as 'skippromotion.ocmod.zip' and upload it using the 'Installer' in the admin panel - then go to 'Modifications', enable the mod and refresh your mod cache. The ads should disappear from the admin panel.
Note that this mod works in a different way to Dmitriy Zhuk's answer, it's replacing every call to admin/controller/extension/extension/promotion.php rather than the value that script returns.
Obviously you'll need to disable the mod and change OPENCART_SERVER in your config if you ever start your own farm of OpenCart installations and want to advertise to your users.
Upvotes: 0
Reputation: 767
In your OpenCart installation go to file
/admin/controller/extension/extension/promotion.php
and add replace this code on line 18
return $response;
with this
return '';
This will remove any promotion you see in your OpenCart admin panel.
Enjoy!
Upvotes: 3