Site Disclaimer Redirect Issues

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
aboc
Ensign (ENS)
Ensign (ENS)
Posts: 2
Joined: Sat May 31, 2014 12:04 pm

Site Disclaimer Redirect Issues

Post by aboc » Sat May 31, 2014 12:50 pm

I want all the search bots to be able to index all my pages but they get redirected because of the disclaimer. Is there a way to disable the Site Disclaimer redirect solely for bots?

User avatar
ForumsAdmin
AbleCommerce Moderator
AbleCommerce Moderator
Posts: 399
Joined: Wed Mar 13, 2013 7:19 am

Re: Site Disclaimer Redirect Issues

Post by ForumsAdmin » Mon Jun 02, 2014 1:40 am

The site disclaimer redirection takes place in backend code (PageTracker service). If you do not have the source code available it will not be easy to make this customization.

One way to bypass this without having source could be to write your own page tracking service and hook it up instead of the standard page tracking service. Check this to see how default services can be overridden by custom services. http://wiki.ablecommerce.com/index.php/ ... or_AC_Gold

In the custom page tracking service you can simply extend from the standard service and in your Track() method to do something like

Code: Select all

public override void Track(HttpApplication application, HttpContext context)
{
   // your custom code to detect if this is a bot request
   bool isBot = x ; // what you figured out
   
   if(isBot)
   {
        StoreSettingsManager settings = AbleContext.Current.Store.Settings;
        // temporarily clear the site disclaimer message
        string dsMessage = settings.SiteDisclaimerMessage;
        settings.SiteDisclaimerMessage = string.Empty;
        base.Track(application, context);
        // set back the disclaimer message 
        settings.SiteDisclaimerMessage = dsMessage ;
   }
   else
   {
        base.Track(application, context);
   }
}

aboc
Ensign (ENS)
Ensign (ENS)
Posts: 2
Joined: Sat May 31, 2014 12:04 pm

Re: Site Disclaimer Redirect Issues

Post by aboc » Mon Jun 02, 2014 5:55 am

I will look into that just for curiosity stakes but I decided to implement a jQuery UI dialog box that loads on the page with the disclaimer instead of doing the store redirection for site disclaimer. Thank you for the quick reply.

Post Reply