7.0.5 stock message not displayed if allow backorder checked

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

7.0.5 stock message not displayed if allow backorder checked

Post by AbleMods » Fri Sep 03, 2010 10:15 am

When a product is set to track inventory AND allow-backorder is checked, the stock message is not displayed on the product display page.

The stock message should be displayed regardless of whether the allow-backorder flag is set or not.

Two simple changes are all that is needed to make stock values show regardless of whether you accept backorders or not for the product. Simply edit the /ConLib/BuyProductDialog.ascx.cs file with your favorite text editor. As always, make a backup copy of the original file before making these changes.

For the first change, find this section of code in the UpdateInventoryDetails() function:

Code: Select all

    private void UpdateInventoryDetails(InventoryManagerData inv)
    {
        if ((inv.InventoryMode == InventoryMode.None) || (inv.AllowBackorder)) return;
        if (inv.InStock > 0)
        {
and change it to look like this:

Code: Select all

    private void UpdateInventoryDetails(InventoryManagerData inv)
    {
        if ((inv.InventoryMode == InventoryMode.None)) return;// || (inv.AllowBackorder)) return;
        if (inv.InStock > 0)
        {
For the second change, find this code in the Page_PreRender() function:

Code: Select all

        CommerceBuilder.Stores.Store store = Token.Instance.Store;

        if (store.EnableInventory && store.Settings.InventoryDisplayDetails
            && (_Product.InventoryMode != InventoryMode.None) && (!_Product.AllowBackorder))
        {
and change it to look like this:

Code: Select all

        CommerceBuilder.Stores.Store store = Token.Instance.Store;

        if (store.EnableInventory && store.Settings.InventoryDisplayDetails
            && (_Product.InventoryMode != InventoryMode.None)) // && (!_Product.AllowBackorder))
        {
Now stock messages will be displayed regardless of the allow-backorder flag on the product.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

plugables
Captain (CAPT)
Captain (CAPT)
Posts: 276
Joined: Sat Aug 15, 2009 4:04 am
Contact:

Re: 7.0.5 stock message not displayed if allow backorder checked

Post by plugables » Thu Sep 16, 2010 8:26 am

A good reference post. Should be moved to 'Good Reference Posts' forum.

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: 7.0.5 stock message not displayed if allow backorder checked

Post by JaminLeather » Wed Sep 10, 2014 1:16 pm

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

Post Reply