How To Maintain Scroll Position during Postback in AbleCommerce 7

by Joe Payne 19. May 2011 14:23

If you've ever spent hours writing a page only to have it jump all over the place during any postback, this tip will make your day.  With one simple command in Page_Load() you can make the page stay exactly where it was before the postback fired.

In your Page_Load() routine, add this line:

this.Page.MaintainScrollPositionOnPostBack = true;

 

Now some will say "I can already do that in the .ASPX file."  That's swell, but in AbleCommerce-Land you rarely work with the original .ASPX file.  In AbleCommerce-Land the vast majority of your work will be inside User Controls, so you don't have direct access to the page declaration.

Using this technique works great in a user control and you don't have to worry about modifications to a .ASPX file conflicting with other controls that use the same .ASPX file.

Nifty!  Winking smile

Tags: , ,

AC7 Articles | Personal | Tech Support

AbleCommerce 7.0.5 Bug using Edit Addresses from Order Details page

by Joe Payne 18. May 2011 09:25

When using the Edit Addresses button from the Order Details page in AbleCommerce 7.0.5, there is bug when multiple shipments are involved. If you click Save to store any changes made, all the shipment addresses will get set to the address that is shown on the first shipment. This blows away the address details of shipments beyond Shipment #1.

The fix is simple. Edit the /Admin/Orders/EditAddresses.aspx.cs file. Locate the following code:

 

protected void SaveButton_Click(object sender, EventArgs e)
{
    _Order.BillToFirstName = BillToFirstName.Text;
    _Order.BillToLastName = BillToLastName.Text ;
    _Order.BillToCompany = BillToCompany.Text ;
    _Order.BillToAddress1 = BillToAddress1.Text;
    _Order.BillToAddress2  =BillToAddress2.Text;
    _Order.BillToCity = BillToCity.Text;
    _Order.BillToProvince = BillToProvince.Text;
    _Order.BillToPostalCode = BillToPostalCode.Text;
    _Order.BillToCountryCode = BillToCountryCode.Items[BillToCountryCode.SelectedIndex].Value;
    _Order.BillToPhone = BillToPhone.Text;
    int index = 0;
    foreach (OrderShipment shipment in _Order.Shipments)
    {
        RepeaterItem item = ShipmentRepeater.Items[index];
        shipment.ShipToFirstName = GetControlValue(item, "ShipToFirstName");
        shipment.ShipToLastName = GetControlValue(item, "ShipToLastName");
        shipment.ShipToCompany = GetControlValue(item, "ShipToCompany");
        shipment.ShipToAddress1 = GetControlValue(item, "ShipToAddress1");
        shipment.ShipToAddress2 = GetControlValue(item, "ShipToAddress2");
        shipment.ShipToCity = GetControlValue(item, "ShipToCity");
        shipment.ShipToProvince = GetControlValue(item, "ShipToProvince");
        shipment.ShipToPostalCode = GetControlValue(item, "ShipToPostalCode");
        shipment.ShipToCountryCode = GetControlValue(item, "ShipToCountryCode");
        shipment.ShipToPhone = GetControlValue(item, "ShipToPhone");
    }
    _Order.Save();
    SavedMessage.Text = string.Format(SavedMessage.Text, DateTime.UtcNow.ToLocalTime());
    SavedMessage.Visible = true;
    EditAddressAjax.Update();
}



And replace it with this code:

protected void SaveButton_Click(object sender, EventArgs e)
{
    _Order.BillToFirstName = BillToFirstName.Text;
    _Order.BillToLastName = BillToLastName.Text ;
    _Order.BillToCompany = BillToCompany.Text ;
    _Order.BillToAddress1 = BillToAddress1.Text;
    _Order.BillToAddress2  =BillToAddress2.Text;
    _Order.BillToCity = BillToCity.Text;
    _Order.BillToProvince = BillToProvince.Text;
    _Order.BillToPostalCode = BillToPostalCode.Text;
    _Order.BillToCountryCode = BillToCountryCode.Items[BillToCountryCode.SelectedIndex].Value;
    _Order.BillToPhone = BillToPhone.Text;
    int index = 0;
    foreach (OrderShipment shipment in _Order.Shipments)
    {
        RepeaterItem item = ShipmentRepeater.Items[index];
        shipment.ShipToFirstName = GetControlValue(item, "ShipToFirstName");
        shipment.ShipToLastName = GetControlValue(item, "ShipToLastName");
        shipment.ShipToCompany = GetControlValue(item, "ShipToCompany");
        shipment.ShipToAddress1 = GetControlValue(item, "ShipToAddress1");
        shipment.ShipToAddress2 = GetControlValue(item, "ShipToAddress2");
        shipment.ShipToCity = GetControlValue(item, "ShipToCity");
        shipment.ShipToProvince = GetControlValue(item, "ShipToProvince");
        shipment.ShipToPostalCode = GetControlValue(item, "ShipToPostalCode");
        shipment.ShipToCountryCode = GetControlValue(item, "ShipToCountryCode");
        shipment.ShipToPhone = GetControlValue(item, "ShipToPhone");
        // BEGIN MOD: AbleMods.com
        // 5/18/2011
        // bug-fix in AC705
        index++;
        // END MOD: AbleMods.com
    }
    _Order.Save();
    SavedMessage.Text = string.Format(SavedMessage.Text, DateTime.UtcNow.ToLocalTime());
    SavedMessage.Visible = true;
    EditAddressAjax.Update();
}


I checked AbleCommerce 7.0.7 and the code appears correct, not sure if 7.0.6 has it though.

Tags: , , ,

AC7 Articles | Tech Support

HP Proliant DL360 G3 Red Health Light and Interlock LED amber

by Joe Payne 16. May 2011 22:13

Well it just goes to show you are never done learning in the IT business.

A few weeks ago I decided to deploy my backup web server as the primary was showing odd hardware errors in Server 2003.  However I couldn’t even get the backup to show me a POST boot.  In fact, it just stared at me with a red health LED on the front and nothing more.  The power supplies didn’t even light their green LEDs despite hearing the fans spin inside.  Inside the server showed only an amber Interlock light. 

So I cold-booted the primary and brought it back online.  I pulled the backup DL 360 G3 and brought it home for the usual kitchen-table bench testing.  Yes, the wife just loves it when I do that.

But nothing I did resolved the seemingly dead server.  I reseated CPU’s, CPU power boards, RAM, power supplies and anything else that remotely looked removable.  Nothing.

I finally got around to ordering another backup DL 360 G3 last week off eBay.  It arrived today.  Finally, my anxiety of running live sites on a single box with no backup would soon be a thing of the past.  I unbox the new backup DL 360 G3, throw it too on the kitchen table and ………. nothing.  The EXACT same symptoms as the previous backup server.

So by the general laws of armchair logic, I knew this was no longer a problem with the hardware.  There has to be something else.  I hopped on Google, did the usual searches and spent a good 30 minutes reading post-after-post.  Finally, I found the answer.  Within 10 seconds I had both servers running great.

The problem is the recycler companies that buy these units up and sell them on eBay.  They don’t know HP units as well as they advertise.  And they DO NOT “test” them to ensure they boot.  At least they don’t AFTER they install two power supplies in a system specifically configured for a single power supply.

That’s right, the problem was the motherboard has a configuration switch (SW2 on DL360 G3) with 4 positions.  The 4th position specifically tells the system whether there are two power supplies or just one.  It’s not automatic in the G3 series. 

The recyclers clearly acquired these units as single power supply, tested them, then loaded up the additional power supply under the assumption it would be auto-detected.  This isn’t true in the G3 series if the 4th switch on SW2 is not set correctly.  Toggling the 4th SW2 switch on the motherboard immediately eliminated the problem on both servers.

Now the power LED on each power supply lights up.  The Interlock light no longer lights up.  And the servers proceed to POST boot without a problem.

Hopefully this blog post will save somebody the headache and expense I’ve endured for such a painfully simple solution.

Tags: , , , ,

Personal | Tech Support

FogBugz and Beanstalk integration setup

by Joe Payne 13. May 2011 09:30

Yesterday I decided it was time to tie my case management software FogBugz into my source code control system Beanstalk (SVN).

Beanstalk offers a FogBugz integration, but I couldn’t get it to work.  Every time I set it to my FogBugz URL, Beanstalk would respond with some sort of “Unable to connect to host” message.

The solution was that the Beanstalk integration to FogBugz does not support sub-domain URLs for the FogBugz path.  In other words, you can’t do http:// www. ablemods. com/ support/.  However, if you move your FogBugz path to the root of a site URL like http://support.ablemods.com/ then the integration works flawlessly.

FogBugz has a nice instruction page that details how to move the install from a sub-domain URL (subdirectory) to a root web site URL.  The instructions are located here:  http://fogbugz.stackexchange.com/questions/6722/moving-self-hosted-fogbugz-and-kiln-from-fogbugz-to

FogBugz technical support was fantastic.  Quick and informative responses really make your day Smile

Tags:

Free Email Customers by SKU page on AbleCommerce forums

by Joe Payne 12. May 2011 20:54

I posted a free page I wrote a while back for my site.  It lets you pull in the emails for customers who bought a particular SKU within a particular timeframe.  Then you can choose any email template to send them.  Works great when you have a recall notice or other advisory you need to send to shoppers who bought something within a certain timeframe.

 

You can find here in the AbleCommerce forums:  http://forums.ablecommerce.com/viewtopic.php?f=47&t=15301

Enjoy !

Tags: , ,

AC7 Articles | General News | New Products

Month List