Jump to content

how to add new order status using php coding


Steve05

Recommended Posts

Hi , I`m new to prestashop here. May i know how do i add new order status to using php coding. im currently trying to develop a plugin. 

the order status mean "Pending" , "complete". in the history.

 

im using prestashop 1.6.1.24

 

Link to comment
Share on other sites

Hi..
This is code create new status 

$orderStateObj = new OrderState();
$orderStateObj->send_email = 0;
$orderStateObj->module_name = $this->name;
$orderStateObj->invoice = 0;
$orderStateObj->color = '#4169E1';
$orderStateObj->logable = 0;
$orderStateObj->shipped = 0;
$orderStateObj->unremovable = 1;
$orderStateObj->delivery = 0;
$orderStateObj->hidden = 0;
$orderStateObj->paid = 0;
$orderStateObj->pdf_delivery = 0;
$orderStateObj->pdf_invoice = 0;
$orderStateObj->deleted = 0;
foreach ($this->languages as $language) {
    $orderStateObj->name[$language['id_lang']] = 'Your order status';
}
$orderStateObj->add();

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...