HI , I have a problem with adding and delete order state during install and uninstall module.
I have something like this in install method:
$order_state = new OrderState();
$order_state->send_email = false;
$order_state->color = '#151400';
$order_state->hidden = true;
$order_state->delivery = false;
$order_state->logable = false;
$order_state->invoice = false;
$order_state->name = 'MY_CUSTOM_NAME';
if ($order_state->add()) {
Configuration::updateValue('MODULE_MY_CUSTOM_NAME', $order_state->id);
}
and this in uninstall:
$order_state = new OrderState(Configuration::get('MODULE_MY_CUSTOM_NAME'));
if ($order_state->existsInDatabase(Configuration::get('MODULE_MY_CUSTOM_NAME'), 'order_state')) {
$order_state->delete();
}
but i got error 500 during installation if I don't comment this;)
Any help ? suggestion ?