Magento Observer to block spam orders not workingcustom checkout_submit_all_after observer not workingMagento observer is not viewing product detailsMagento product view observer not raisedObserver not firing - adminhtml_block_html_beforeMagento 1.9 custom configuration is not visible in admin panelMy custom observer not workingMagento 1.7 - Export New Orders in Observerupdate price Observer is not working on cart pageObserver method is not getting calledMagento 1.9 - automatically add comment with module / observer
How to sort and filter a constantly changing list of data?
How can I tell if there was a power cut while I was out?
How did C64 games handle music during gameplay?
Is the apartment I want to rent a scam?
Sextortion with actual password not found in leaks
Spoken encryption
Why are angular mometum and angular velocity not necessarily parallel, but linear momentum and linear velocity are always parallel?
How can I make sure my players' decisions have consequences?
Can I paint a load center cover?
Should I describe a character deeply before killing it?
how to add 1 milliseconds on a datetime string?
What was the rationale behind 36 bit computer architectures?
Memory capability and powers of 2
What do teaching faculty do during semester breaks?
Grid/table with lots of buttons
Why are off grid solar setups only 12, 24, 48 VDC?
What is the meaning of "a thinly disguised price"?
Why keep the bed heated after initial layer(s) with PLA (or PETG)?
Using "Kollege" as "university friend"?
What should I say when a company asks you why someone (a friend) who was fired left?
Why is a dedicated QA team member necessary?
Why did NASA use U.S customary units?
Is a normal-sized rug with the Animate Objects spell cast on it able to carry a person and fly?
kids pooling money for Lego League and taxes
Magento Observer to block spam orders not working
custom checkout_submit_all_after observer not workingMagento observer is not viewing product detailsMagento product view observer not raisedObserver not firing - adminhtml_block_html_beforeMagento 1.9 custom configuration is not visible in admin panelMy custom observer not workingMagento 1.7 - Export New Orders in Observerupdate price Observer is not working on cart pageObserver method is not getting calledMagento 1.9 - automatically add comment with module / observer
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm facing some issues with orders placed by bots.

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.
- I created the file Blockbots_Observer.xml on /html/app/etc/modules;
- I created the file Config.xml on /html/app/code/local/Blockbots/Observer/etc;
- 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:
Config.xml:
Observer.php:
What could be wrong with implementation? Any idea how I can fix it?
magento-1.9 module orders event-observer
add a comment |
I'm facing some issues with orders placed by bots.

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.
- I created the file Blockbots_Observer.xml on /html/app/etc/modules;
- I created the file Config.xml on /html/app/code/local/Blockbots/Observer/etc;
- 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:
Config.xml:
Observer.php:
What could be wrong with implementation? Any idea how I can fix it?
magento-1.9 module orders event-observer
Use Webfirewall that is the best solution.You have to prevent the bot at network level, not Application Level
– Amit Bera♦
Jul 16 at 14:12
add a comment |
I'm facing some issues with orders placed by bots.

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.
- I created the file Blockbots_Observer.xml on /html/app/etc/modules;
- I created the file Config.xml on /html/app/code/local/Blockbots/Observer/etc;
- 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:
Config.xml:
Observer.php:
What could be wrong with implementation? Any idea how I can fix it?
magento-1.9 module orders event-observer
I'm facing some issues with orders placed by bots.

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.
- I created the file Blockbots_Observer.xml on /html/app/etc/modules;
- I created the file Config.xml on /html/app/code/local/Blockbots/Observer/etc;
- 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:
Config.xml:
Observer.php:
What could be wrong with implementation? Any idea how I can fix it?
magento-1.9 module orders event-observer
magento-1.9 module orders event-observer
edited Jul 16 at 8:36
Aasim Goriya
3,2961 gold badge12 silver badges43 bronze badges
3,2961 gold badge12 silver badges43 bronze badges
asked Jul 15 at 22:28
Pedro_DouradoPedro_Dourado
11 bronze badge
11 bronze badge
Use Webfirewall that is the best solution.You have to prevent the bot at network level, not Application Level
– Amit Bera♦
Jul 16 at 14:12
add a comment |
Use Webfirewall that is the best solution.You have to prevent the bot at network level, not Application Level
– Amit Bera♦
Jul 16 at 14:12
Use Webfirewall that is the best solution.You have to prevent the bot at network level, not Application Level
– Amit Bera♦
Jul 16 at 14:12
Use Webfirewall that is the best solution.You have to prevent the bot at network level, not Application Level
– Amit Bera♦
Jul 16 at 14:12
add a comment |
1 Answer
1
active
oldest
votes
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/
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f282163%2fmagento-observer-to-block-spam-orders-not-working%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
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/
add a comment |
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/
add a comment |
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/
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 at 23:19
NickoolNickool
6873 gold badges14 silver badges37 bronze badges
6873 gold badges14 silver badges37 bronze badges
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f282163%2fmagento-observer-to-block-spam-orders-not-working%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Use Webfirewall that is the best solution.You have to prevent the bot at network level, not Application Level
– Amit Bera♦
Jul 16 at 14:12