Jump to content

How to stop automated backorder status


Recommended Posts

When a customer places an order for an item that is out of stock the system is automatically putting the order into the status "on backorder" and then it puts it into "payment received".

 

This means that the customer gets an email saying that their order is out of stock before I have processed it.

 

Then when I process the order and find that it is out of stock I need to put the order back into the "on backorder" status. But this sends a second email to the customer.

 

Is it possible to prevent the order from automatically going into "on backorder" status when the order is placed?

 

Prestashop v 1.4.8

Link to comment
Share on other sites

Thanks for the reply. I do still want people to be able to order things that are out of stock. I just don't want the system to automatically put the order in "backorder" status before it puts it into "payment received" status. Is this possible?

Link to comment
Share on other sites

Hi - I'm not sure how to stop the status from automatically going into "backorder", but you can stop your customers from receiving the email by going Orders -> Statuses, select backorder and then uncheck "Send e-mail to customer when order is changed to this status".

 

If you still want them to receive the email when you manually change it to "backorder" then you could create a new status called something like "Temporarily out of stock", check "Send e-mail to customer when order is changed to this status" and select the outofstock template.

 

Hope this makes sense and helps!

Link to comment
Share on other sites

  • 2 years later...
  • 4 months later...

I'm also interested for this. We're using custom statuses so it's really important if we create an order from the back-office to have it "locked" to our status, without automatically switching to "backorder" if the product is out of stock.

maybe you can try to modify /classes/PaymentModule.php

i just added a condition on it ("else" code instead the default one), so it won't overwrite your out of stock status but lock on it.

here's mine:

 

foreach ($this->context->cart->getProducts() as $product)

                        if ($order_status->logable)

                            ProductSale::addProductSale((int)$product['id_product'], (int)$product['cart_quantity']);

 

                    if (Configuration::get('PS_STOCK_MANAGEMENT') && $order_detail->getStockState())

                    {

                        $history = new OrderHistory();

                        $history->id_order = (int)$order->id;

                        $history->changeIdOrderState(Configuration::get('PS_OS_OUTOFSTOCK'), $order, true);

                        $history->addWithemail();

                    }

                    else

                    {

                    $history = new OrderHistory();

                    $history->id_order = (int)$order->id;

                    $history->changeIdOrderState((int)$id_order_state, $order, true);

                    $history->addWithemail(true, $extra_vars);

                    unset($order_detail);

 

                    // Order is reloaded because the status just changed

                    $order = new Order($order->id);

                    }

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...