I have written a solution! Create a database table by running following sql
Code:
CREATE TABLE `bannedIPS` (
`id` int(11) NOT NULL,
`banip` varchar(16) NOT NULL DEFAULT ''
);
then in includes/templates/YOUR_TEMPLATE/common/html_header.php
just below the lines
Code:
$zco_notifier->notify('NOTIFY_HTML_HEAD_START', $current_page_base, $template_dir);
// Prevent clickjacking risks by setting X-Frame-Options:SAMEORIGIN
header('X-Frame-Options:SAMEORIGIN');
add
Code:
//BOF Bot Cart Builder Stopper
$visitorIP = $_SERVER['REMOTE_ADDR'];
if(sizeof($_SESSION['cart']->get_products()) > 50){
$db->Execute("INSERT INTO bannedIPS (banip) VALUES ('" . $visitorIP . "')");
}
$bannedIPLQ = $db->Execute("SELECT * FROM bannedIPS");
$bannedIPS = array();
while(!$bannedIPLQ->EOF){
$bannedIPS[] = trim($bannedIPLQ->fields['banip']);
$bannedIPLQ->MoveNext();
}
if(in_array($visitorIP, $bannedIPS)){
header('location:https://www.google.com');
}
//EOF Bot Cart Builder Stopper
The number 50 can be changed to whatever suits your site best. This is the count of the total number of different products currently in the visitors cart. They can still have 100 of an individual product, but can't have more than 50 different products. We have (in 10 years) never had a customer purchase 50 different products at one time, but I know that each business is different.
Thanks, John
Bookmarks