Jump to content
Steve05

how to add new order status using php coding

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

 

Share this post


Link to post
Share on other sites

You can directly insert into 2 tables in database

ps1_order_state 

ps1_order_state_lang

Share this post


Link to post
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();

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More