Announcement

Collapse
No announcement yet.

How do I allow a customer to still order a product that is out of stock?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How do I allow a customer to still order a product that is out of stock?

    It could be that you would like your customers to still be able to place an order even when the 'Out of Stock' message is displayed to customers.

    In order to this, you need to edit the condition that controls whether the add to cart button is shown or not.

    To do this

    1. Go to 'Design | Library | Conditions' and expand the 'Product' group.

    2. The fourth one in the list is called 'IsAddToCartButtonShown'.

    3. Double-click on this file to edit it.

    4. Remove the following part of the condition:

    AND (IsInStock == TRUE)

    5. Click 'OK' to save the condition and then close the library.


    If your 'Shopping Mode' is set to 'Quantity on Product Page' then you will also have to do the following:

    1. Locate your product layout(s) (either via the 'Design | Library' or via the 'Design' tab).

    2. Search for:

    <!-- This code is used when the quantity box is visible to all customers -->

    3. Above it you should see two 'Block if' statements, double-click on the first one to edit it.

    4. Remove the following part of the condition:

    AND (IsOutOfStockShown == FALSE)

    5. Click 'OK' and 'Apply' the change to the layout.

    Finally, you need to make a change to one of the perl scripts:

    1. Browse to your site folder and locate the 'ActinicOrder.pm' file (take a backup).

    2. Open this file in a text editor such as notepad.

    3. Search for:

    # Check is out of stock

    4. You should see:

    #
    # Check is out of stock
    #
    if ($$pProduct{'OUT_OF_STOCK'})
    {
    $sMessage .= ACTINIC::GetPhrase(-1, 297, $$pProduct{'NAME'}) . "<P>\n";
    $nFailure = 1;
    $nBadQuantity = $nQuantity;
    }
    return ($nFailure, $nBadQuantity, $sMessage);

    5. Comment these lines out by putting a '#' at the beginning of them, so it will look like:

    #
    # Check is out of stock
    #
    #if ($$pProduct{'OUT_OF_STOCK'})
    # {
    # $sMessage .= ACTINIC::GetPhrase(-1, 297, $$pProduct{'NAME'}) . "<P>\n";
    # $nFailure = 1;
    # $nBadQuantity = $nQuantity;
    # }
    #return ($nFailure, $nBadQuantity, $sMessage);

    Note - do not comment out the '}' that is after this code

    6. Close and save the file and update your site.

    Your customers will now be able to add products to the cart even though they are out of stock.

    SellerDeck is not able to provide any detailed support for script changes made. If you find that there is a problem, an original copy of the script can be found within the 'Original' folder in your installation. Copy this into your site folder.
Working...
X