Third Party Custom Handler Script and AbleCommerce GOLD

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
JaminLeather
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 27
Joined: Fri Feb 05, 2010 9:37 am
Location: Myrtle Beach, South Carolina
Contact:

Third Party Custom Handler Script and AbleCommerce GOLD

Post by JaminLeather » Mon Oct 21, 2013 12:09 pm

Our local order processing system interfaces with AbleCommerce through a custom handler which (in version 7.x) resides in the ClientAPI directory. This integration script allows for order downloads, inventory management and other tasks through HTML GET requests.

This integration script will not work in AbleCommerce GOLD unless it is placed in Mobile directory. If it resides in any other locations (including the original ClientAPI directory), AbleCommerce rewrites the raw HTML header, removing all GET data and changing the URL to the mobile directory. For example:

www.siteroot.com/ClientAPI/scriptname.a ... othervalue
becomes:
www.siteroot.com/Mobile/scriptname.ashx

I am assuming the default handler for AbleCommerce GOLD is responsible for changing the URL. When the script resides in the Mobile directory, it URL is left alone and the script works normally.

This isn't a huge deal, but I would prefer to keep third party integration scripts separated from normal AbleCommerce code. It doesn't make sense to have this script sitting in the Mobile directory.

Is there a way I can tell AbleCommerce GOLD's default handler to ignore this script?

Thank you for your help!
Jamin' Leather Catalog Outlet
http://www.jaminleather.com

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

Re: Third Party Custom Handler Script and AbleCommerce GOLD

Post by ForumsAdmin » Fri Oct 25, 2013 5:12 am

It appears that AbleCommerce detects the calling client as a mobile device. One thing you can do to avoid getting redirected is to add a query parameter FSIntent=true to the URL.

JaminLeather
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 27
Joined: Fri Feb 05, 2010 9:37 am
Location: Myrtle Beach, South Carolina
Contact:

Re: Third Party Custom Handler Script and AbleCommerce GOLD

Post by JaminLeather » Fri Oct 25, 2013 9:00 am

ForumsAdmin wrote:It appears that AbleCommerce detects the calling client as a mobile device. One thing you can do to avoid getting redirected is to add a query parameter FSIntent=true to the URL.
Thank you for the reply. That is good to know! Unfortunately I can not modify the query parameters as they are sent by the client software. Is there any other way to instruct AbleCommerce to avoid redirecting the url? Perhaps something in the ablecommerce.config file or something bit of code I can add to the script? Which file is controlling this redirection? Maybe I could modify it?

Thank you again for your help!
Jamin' Leather Catalog Outlet
http://www.jaminleather.com

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Third Party Custom Handler Script and AbleCommerce GOLD

Post by jmestep » Mon Oct 28, 2013 2:38 am

You could try changing this in the App_Code/PageHelper.cs

Code: Select all

 public static bool IsInMobileContext(HttpRequest request)
        {
            return request.AppRelativeCurrentExecutionFilePath.ToLower()
                .StartsWith("~/mobile/");
        }
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

JaminLeather
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 27
Joined: Fri Feb 05, 2010 9:37 am
Location: Myrtle Beach, South Carolina
Contact:

Re: Third Party Custom Handler Script and AbleCommerce GOLD

Post by JaminLeather » Tue Oct 29, 2013 7:51 am

jmestep wrote:You could try changing this in the App_Code/PageHelper.cs

Code: Select all

 public static bool IsInMobileContext(HttpRequest request)
        {
            return request.AppRelativeCurrentExecutionFilePath.ToLower()
                .StartsWith("~/mobile/");
        }
Thanks for the reply! Not sure it helps for preventing the header modification of this one particular third party script, but it points me in a direction to look. I appreciate all the help :-)
Jamin' Leather Catalog Outlet
http://www.jaminleather.com

Post Reply