You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

OpenCart 2.1.0.2完全禁用联盟模块求助:每日遭20-25个机器人账户注册

How to Fully Disable the Affiliate Module in OpenCart 2.1.0.2 to Block Bot Accounts

Hey there! I’ve dealt with this exact bot-spam issue on OpenCart 2.1.0.2 before, so let’s walk through all the steps to completely shut down the affiliate module and stop those unwanted bot accounts from being created.

Step 1: Disable the Affiliate Module & Registrations via Admin

Start with the core admin settings to turn off the module at its root:

  • Log into your OpenCart admin dashboard
  • Navigate to Extensions > Modules
  • Locate the "Affiliate" module and click the Disable button (it’ll gray out once turned off)
  • Next, go to System > Settings > Edit your store > Option tab
  • Scroll to the "Affiliate" section and set Allow Affiliate Registrations to No

Bots often target visible affiliate entry points, so clean up your theme files:

  • Access your store’s files via FTP or cPanel File Manager
  • Go to catalog/view/theme/[your-theme-name]/common/
  • Open header.tpl and footer.tpl (plus any other template files that might have affiliate links)
  • Find lines like <a href="<?php echo $affiliate; ?>">Affiliate</a> and either delete them or comment them out with <!-- ... -->

Step 3: Block Direct Access to Affiliate Pages

Even without frontend links, bots might try to hit affiliate URLs directly. Add safeguards to controller files:

  • Navigate to catalog/controller/affiliate/
  • Open account.php, register.php, login.php, and other affiliate-related controller files
  • At the top of the main index() method (or primary method) of each file, add this code snippet:
    // Redirect if affiliate module is disabled
    if (!$this->config->get('module_affiliate_status')) {
        $this->response->redirect($this->url->link('common/home'));
    }
    

This will send anyone trying to access these pages straight to your homepage.

Step 4: Clean Up Existing Bot Accounts

Don’t leave the spam accounts cluttering your system:

  • In your admin panel, go to Marketing > Affiliates
  • Use checkboxes to select all suspicious bot accounts (look for generic emails/usernames) and click Delete
  • For bulk cleanup, run this SQL query (back up your database first!):
    DELETE FROM oc_affiliate WHERE email LIKE '%bot%' OR username LIKE '%bot%';
    -- Replace `oc_` with your actual database table prefix if it’s different
    

Once you’ve completed all these steps, the affiliate module will be fully disabled, and bots won’t be able to create new accounts anymore.

内容的提问来源于stack exchange,提问作者Rajesh Kumar

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 06:24:16