Beluga Posted October 14, 2013 Share Posted October 14, 2013 (edited) I adapted the code below from the Paypal module's install file, but installing my module throws this: I "Property OrderState->name is not valid". It creates the status, but with no name. Why is that? public function install() { if (!parent::install() || !$this->registerHook('payment') || !$this->registerHook('paymentReturn')) return false; Configuration::updateValue('CHECKOUTFI_PASSWORD', "SAIPPUAKAUPPIAS"); Configuration::updateValue('CHECKOUTFI_MERCHANT', 375917); if (!Configuration::get('PS_OS_DELAYED')) { $orderState = new OrderState(); $orderState->name = array(); foreach (Language::getLanguages() as $language) { if (strtolower($language['iso_code']) == 'fi') $orderState->name[$language['id_lang']] = 'Checkout.fi-maksun tila viivästetty'; else $orderState->name[$language['id_lang']] = 'Checkout.fi payment state: delayed'; } $orderState->send_email = false; $orderState->color = '#DDEEFF'; $orderState->hidden = false; $orderState->delivery = false; $orderState->logable = true; $orderState->invoice = false; if ($orderState->add()) { $source = dirname(__FILE__).'/logo.gif'; $destination = dirname(__FILE__).'/../../img/os/'.(int)$orderState->id.'.gif'; copy($source, $destination); } Configuration::updateValue('PS_OS_DELAYED', (int)$orderState->id); } return true; } Edited October 14, 2013 by Beluga (see edit history) Link to comment Share on other sites More sharing options...
Beluga Posted October 14, 2013 Author Share Posted October 14, 2013 Wow, just found this and it works great: http://www.prestashop.com/forums/topic/7643-how-to-change-default-order-status-for-some-payment-module/?view=findpost&p=1304944 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now