How To Grab IP Addresses of Review Spammers for Interspire Shopping Cart

Open /includes/classes/class.review.php, look for:

// Save the review in the database
$newReview = array(
  "revproductid" => (int)$reviewPostData['product_id'],
  "revfromname" => $reviewPostData['revfromname'],
  "revdate" => time(),
  "revrating" => max(1, min(5, $reviewPostData['revrating'])),
  "revtext" => $reviewPostData['revtext'],
  "revtitle" => $reviewPostData['revtitle'],
  "revstatus" => $status
);

Change to:

// Save the review in the database
$newReview = array(
  "revproductid" => (int)$reviewPostData['product_id'],
  "revfromname" => $reviewPostData['revfromname'],
  "revdate" => time(),
  "revrating" => max(1, min(5, $reviewPostData['revrating'])),
  "revtext" => $reviewPostData['revtext'],
  "revtitle" => $reviewPostData['revtitle'],
  "revstatus" => $status,
  "reviewip" => getIp()
);

Then in your database, alter the isc_reviews table to include a column called ‘reviewip’. You can now check who is spamming you before deleting their nonsense and banning them from accessing your site.

To display IP address in Admin view:

Open /admin/includes/classes/class.review.php, look for:

if ($row['revfromname'] != "") {
	$GLOBALS['PostedBy'] = isc_html_escape($row['revfromname']);
} else {
	$GLOBALS['PostedBy'] = GetLang('NA');
}

Change to:

if ($row['revfromname'] != "") {
	$GLOBALS['PostedBy'] = isc_html_escape($row['revfromname']);
} else {
	$GLOBALS['PostedBy'] = GetLang('NA');
}

if ($row['reviewip'] != "") {
	$GLOBALS['ReviewIP'] = "(".$row['reviewip'].")";
} else {
	$GLOBALS['ReviewIP'] = "";
}

Open /public_html/admin/templates/reviews.manage.row.tpl, look for:

	{{ PostedBy|safe }}

Change to:

	{{ PostedBy|safe }}
	{{ ReviewIP|safe }}

Optimized .htaccess for Interspire Shopping Cart

php_flag magic_quotes_gpc Off
Options -MultiViews +FollowSymlinks +Indexes
IndexIgnore *
ErrorDocument 401 "Unauthorized access"

<IfModule mod_security.c>
	SecFilterEngine Off
	SecFilterScanPOST Off
</IfModule>

<IfModule mod_rewrite.c>
	RewriteEngine On

	RewriteCond %{HTTPS} !=on [NC]
	RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

	RewriteCond %{REQUEST_FILENAME} robots.txt
	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteRule robots.txt robots_default.txt [L]

	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteRule . index.php
	<IfModule mod_env.c>
		SetEnv SEO_SUPPORT 1
	</IfModule>
</IfModule>

<IfModule mod_deflate.c>
	AddOutputFilterByType DEFLATE text/html text/xml text/css text/plain
	AddOutputFilterByType DEFLATE image/svg+xml application/xhtml+xml application/xml
	AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml
	AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript application/json
	AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-otf
	AddOutputFilterByType DEFLATE font/truetype font/opentype
</IfModule>

<ifModule mod_expires.c>
	ExpiresActive On
	ExpiresByType image/x-icon "access plus 1 month"
	ExpiresByType image/jpeg "access plus 1 month"
	ExpiresByType image/png "access plus 1 month"
	ExpiresByType image/gif "access plus 1 month"
	ExpiresByType text/css "access plus 1 month"
	ExpiresByType text/javascript "access plus 1 month"
	ExpiresByType application/javascript "access plus 1 month"
	ExpiresByType application/x-javascript "access plus 1 month"
	ExpiresByType text/html "access plus 30 minutes"
	ExpiresByType application/xhtml+xml "access plus 30 minutes"
</ifModule>

<ifModule mod_headers.c>
	Header always set Strict-Transport-Security "max-age=31536000" env=HTTPS
	Header unset ETag
	Header append Vary User-Agent
	FileETag None

  <filesMatch "\.(ico|jpe?g|png|gif|swf)$">
    Header set Cache-Control "public"
  </filesMatch>
  <filesMatch "\.(css)$">
    Header set Cache-Control "public"
  </filesMatch>
  <filesMatch "\.(js)$">
    Header set Cache-Control "private"
  </filesMatch>
  <filesMatch "\.(x?html?|php)$">
    Header set Cache-Control "private, must-revalidate"
  </filesMatch>
</ifModule>

Optimized Apache/PHP Modules for Interspire Shopping Cart

Based on Apache 2.4.23 / PHP 5.3.29

Apache

Deflate
Expires
Headers
MPM Prefork
Proxy
UniqueId
Mod Security 2.9.0
Suhosin 0.9.33 for PHP
XCache 3.2.0 for PHP

PHP

CGI
Calendar
CurlSSL
FTP
GD
Iconv
Imap
MBstring
Mcrypt
Mysql
MySQL "Improved" extension
OpenSSL
PDO
PDO MySQL
POSIX
Pear
Phar
Pspell
SOAP
SQLite3
Sockets
Zlib

HowTo Change Interspire Shopping Cart Order of Payment Methods

Payment methods are sorted alphabetically. So to change the rank of a particular payment method you simply change the name of the payment method so that it starts with the letter where you want it to appear in your list.

File

/modules/checkout/(name of payment method)/lang/en/language.ini

Edit line 2

Name = "new name"

HowTo Fix Interspire Shopping Cart Hiding Shipping Methods for Free Shipping Items

Bug

All shipping methods are hidden for “Free Shipping” items

Fix

Open:

includes/classes/class.quote.address.shipping.php

Find:

      // Free shipping method
      if ($this->allowsFreeShipping()) {
         $shippingQuotes[] = array(
            'description'   => getLang('FreeShipping'),
            'price'         => 0,
            'methodId'      => -1,
            'module'      => '',
            'handling'      => $zoneHandlingFee,
         );

         if (empty($shippingQuoteItems)) {
            return $shippingQuotes;
         }
      }

Replace with:

      // Free shipping method
      if ($this->allowsFreeShipping()) {
         $shippingQuotes[] = array(
            'description'   => getLang('FreeShipping'),
            'price'         => 0,
            'methodId'      => -1,
            'module'      => '',
            'handling'      => $zoneHandlingFee,
         );
//MOD Allow other shipping method options
/*
         if (empty($shippingQuoteItems)) {
            return $shippingQuotes;
         }
*/
//MOD END
      }

HowTo Fix Interspire Shopping Cart “View Order Details” Error

URL

account.php?action=view_order&order_id=12345&x=a&y=b

Bug

The associated SQL query will pull down all the rows from the order_products table including those from other orders so if you have a lot of orders PHP will eventually run out of memory to pull the full query down so it can come out of left field.

Fix

Open:

/includes/classes/class.account.php

Find:

         $query = "
            SELECT
               
               o.*,
               op.*,
               oa.address_1,
               oa.address_2,
               oa.city,
               oa.zip,
               oa.country,
               oa.state,
               p.productid,
               p.prodpreorder,
               p.prodreleasedate,
               p.prodpreordermessage
            FROM
               [|PREFIX|]orders o
               LEFT JOIN [|PREFIX|]order_products op ON op.orderorderid
               LEFT JOIN [|PREFIX|]products p ON p.productid = op.ordprodid
               LEFT JOIN [|PREFIX|]order_addresses oa ON oa.`id` = op.order_address_id
            WHERE
               o.orderid = ". (int)$order['orderid'] ."
            ORDER BY
               op.order_address_id";

Replace with:

         $query = "
            SELECT
               
               o.*,
               op.*,
               oa.address_1,
               oa.address_2,
               oa.city,
               oa.zip,
               oa.country,
               oa.state,
               p.productid,
               p.prodpreorder,
               p.prodreleasedate,
               p.prodpreordermessage
            FROM
               [|PREFIX|]orders o
               LEFT JOIN [|PREFIX|]order_products op ON op.orderorderid
               LEFT JOIN [|PREFIX|]products p ON p.productid = op.ordprodid
               LEFT JOIN [|PREFIX|]order_addresses oa ON oa.`id` = op.order_address_id
            WHERE
               o.orderid = ". (int)$order['orderid'] ."
               AND op.orderorderid = ". (int)$order['orderid'] ."
            ORDER BY
               op.order_address_id";