0

I'm facing some issues with orders placed by bots.

enter image description here

I noticed that all orders are made by a specific phone number and also by a specific street. So I looked for a way to block orders that are made with that phone number or this street.

I found the following link https://www.ashsmith.io/2012/12/making-use-of-observers-in-magento/.
I followed the steps to create an observer with the event sales_order_place_before, to compare the parameters sent in the order to the parameters that I want to block.

  1. I created the file Blockbots_Observer.xml on /html/app/etc/modules;
  2. I created the file Config.xml on /html/app/code/local/Blockbots/Observer/etc;
  3. Finally, I created the file Observer.php on /html/app/code/local/Blockbots/Observer/Model;

After all these steps, the implementation did not work (I am still receiving orders from bots).

Here is the code on files:

Blockbots_observer.xml: enter image description here

Config.xml: enter image description here

Observer.php: enter image description here

What could be wrong with implementation? Any idea how I can fix it?

Aasim Goriya
5,4622 gold badges30 silver badges54 bronze badges
asked Jul 15, 2019 at 22:28
2
  • Use Webfirewall that is the best solution.You have to prevent the bot at network level, not Application Level Commented Jul 16, 2019 at 14:12
  • This is not a suitable fix, as bots often come in swarms with each having its own address. We have the same issue, bot swarms 'tasting' credit cards on our store, always using the same address but each having a different IP. Commented Mar 16, 2020 at 13:28

1 Answer 1

0

block the bot ip Address range from accessing your website.

in .htaccess file:

order allow,deny
deny from yourparticularip

or you can do it in your index.php

$banned = array('xx.xxx.x.x');
if(in_array($_SERVER['REMOTE_ADDR'], $banned))
{
exit();
}

here is the reference:https://bobcares.com/blog/magento-block-ip-address/

answered Jul 15, 2019 at 23:19
1
  • This is not a suitable response to this issue, as bots usually come from many different IP addresses. Block the street, zip, or phone number of an individual scammer is the easiest way to block them. Commented Mar 16, 2020 at 13:29

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.