本文整理汇总了PHP中OrderState::add方法的典型用法代码示例。如果您正苦于以下问题:PHP OrderState::add方法的具体用法?PHP OrderState::add怎么用?PHP OrderState::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OrderState
的用法示例。
在下文中一共展示了OrderState::add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create_states
public function create_states()
{
$this->order_state = array(1 => array('ccfbff', '00100', 'PagSeguro - Aguardando Pagto', ''), 2 => array('fcffcf', '00100', 'PagSeguro - Em análise', ''), 3 => array('ffffff', '10100', 'PagSeguro - Aprovado', ''), 4 => array('c9fecd', '11110', 'PagSeguro - Completo', 'payment'), 5 => array('c9fecd', '11110', 'PagSeguro - Em Disputa', 'order_canceled'), 6 => array('d6d6d6', '00100', 'PagSeguro - Em Aberto', ''), 7 => array('fec9c9', '11110', 'PagSeguro - Cancelado', 'order_canceled'));
/** INSTALANDO STATUS PagSeguro * */
foreach ($this->order_state as $key => $value) {
$orderState = new OrderState();
$orderState->name = array();
foreach (Language::getLanguages() as $language) {
$orderState->name[$language['id_lang']] = $value[2];
}
$orderState->send_email = (int) $value[1][1];
$orderState->color = '#' . $value[0];
$orderState->hidden = false;
$orderState->delivery = (int) $value[1][4];
$orderState->logable = (int) $value[1][3];
$orderState->invoice = (int) $value[1][0];
if ($orderState->add()) {
/** COPIANDO O ICONE ATUAL * */
$file = dirname(__FILE__) . "/icons/{$key}.gif";
$newfile = dirname(dirname(dirname(__FILE__))) . "/img/os/{$orderState->id}.gif";
if (!copy($file, $newfile)) {
return false;
}
}
/** GRAVA AS CONFIGURAÇÕES * */
Configuration::updateValue("PAGSEGURO_STATUS_{$key}", (int) $orderState->id);
}
return true;
}
示例2: setPaytmOrderState
public function setPaytmOrderState($var_name, $status, $color)
{
$orderState = new OrderState();
$orderState->name = array();
foreach (Language::getLanguages() as $language) {
$orderState->name[$language['id_lang']] = $status;
}
$orderState->send_email = false;
$orderState->color = $color;
$orderState->hidden = false;
$orderState->delivery = false;
$orderState->logable = true;
$orderState->invoice = true;
if ($orderState->add()) {
Configuration::updateValue($var_name, (int) $orderState->id);
}
return true;
}
示例3: install
public function install()
{
if (!parent::install() || !$this->registerHook('displayPayment') || !$this->registerHook('paymentReturn') || !$this->registerHook('displayTop') || !$this->registerHook('displayFooter') || !$this->registerHook('displayHeader') || !$this->registerHook('ModuleRoutes') || !$this->registerHook('displayOrderConfirmation') || !$this->registerHook('displayBackOfficeHeader') || !$this->registerHook('displayAdminOrder') || !$this->registerHook('actionOrderStatusUpdate')) {
return false;
}
$status = array('DELIVERY' => array('name' => 'YA Ждёт отправки', 'color' => '#8A2BE2', 'id' => 900, 'paid' => true, 'shipped' => false, 'logable' => true, 'delivery' => true), 'CANCELLED' => array('name' => 'YA Отменен', 'color' => '#b70038', 'id' => 901, 'paid' => false, 'shipped' => false, 'logable' => true, 'delivery' => false), 'PICKUP' => array('name' => 'YA В пункте самовывоза', 'color' => '#cd98ff', 'id' => 902, 'paid' => true, 'shipped' => true, 'logable' => true, 'delivery' => true), 'PROCESSING' => array('name' => 'YA В процессе подготовки', 'color' => '#FF8C00', 'id' => 903, 'paid' => true, 'shipped' => false, 'logable' => false, 'delivery' => true), 'DELIVERED' => array('name' => 'YA Доставлен', 'color' => '#108510', 'id' => 904, 'paid' => true, 'shipped' => true, 'logable' => true, 'delivery' => true), 'UNPAID' => array('name' => 'YA Не оплачен', 'color' => '#ff1c30', 'id' => 905, 'paid' => false, 'shipped' => false, 'logable' => false, 'delivery' => false), 'RESERVATION_EXPIRED' => array('name' => 'YA Резерв отменён', 'color' => '#ff2110', 'id' => 906, 'paid' => false, 'shipped' => false, 'logable' => false, 'delivery' => false), 'RESERVATION' => array('name' => 'YA Резерв', 'color' => '#0f00d3', 'id' => 907, 'paid' => false, 'shipped' => false, 'logable' => false, 'delivery' => false));
foreach ($status as $k => $s) {
$os = new OrderState((int) $s['id']);
$os->id = $s['id'];
$os->force_id = true;
$os->name = $this->multiLangField($s['name']);
$os->color = $s['color'];
$os->module_name = $this->name;
$os->paid = $s['paid'];
$os->logable = $s['logable'];
$os->shipped = $s['shipped'];
$os->delivery = $s['delivery'];
$os->add();
$data[$k] = $os->id;
}
$sql = 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'pokupki_orders`
(
`id_order` int(10) NOT NULL,
`id_market_order` varchar(100) NOT NULL,
`currency` varchar(100) NOT NULL,
`ptype` varchar(100) NOT NULL,
`home` varchar(100) NOT NULL,
`pmethod` varchar(100) NOT NULL,
`outlet` varchar(100) NOT NULL,
PRIMARY KEY (`id_order`,`id_market_order`)
) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci';
Db::getInstance()->execute($sql);
$customer = new Customer();
$customer->firstname = 'YA POKUPKI Not Delete';
$customer->lastname = 'YA POKUPKI Not Delete';
$customer->email = 'support@supp.com';
$customer->passwd = Tools::encrypt('OPC123456dmo');
$customer->newsletter = 1;
$customer->optin = 1;
$customer->active = 0;
$customer->add();
Configuration::updateValue('YA_POKUPKI_CUSTOMER', $customer->id);
return true;
}
示例4: setOrderState
public static function setOrderState()
{
$tab_os = array();
$tab_os[] = array('key' => 'PS_OS_SYSPAY_AUTHORIZED', 'fr' => 'Paiement authorisé', 'en' => 'Authorized Payment');
$tab_os[] = array('key' => 'PS_OS_SYSPAY_CB', 'fr' => 'Chargebacked', 'en' => 'Chargebacked');
$tab_os[] = array('key' => 'PS_OS_SYSPAY_CB_DELIVERED', 'fr' => 'Chargeback et livré', 'en' => 'Chargebacked and delivered');
$tab_os[] = array('key' => 'PS_OS_SYSPAY_CB_PIP', 'fr' => 'Chargeback et préparation en cours', 'en' => 'Chargebacked and preparation in progress');
$tab_os[] = array('key' => 'PS_OS_SYSPAY_CB_SHIPPED', 'fr' => 'Chargebacked et en cours de livraison', 'en' => 'Chargebacked and shipped');
$tab_os[] = array('key' => 'PS_OS_SYSPAY_REFUND_DELIVERED', 'fr' => 'Livré et remboursé partiellement', 'en' => 'Delivered and partially refunded');
$tab_os[] = array('key' => 'PS_OS_SYSPAY_REFUND_PIP', 'fr' => 'Préparation en cours et remboursé partiellement', 'en' => 'Preparation in progress and partially refunded');
$tab_os[] = array('key' => 'PS_OS_SYSPAY_REFUND_SHIPPED', 'fr' => 'En cours de livraison et remboursé partiellement', 'en' => 'Shipped and partially refunded');
foreach ($tab_os as $t) {
if (!Configuration::get($t['key'])) {
$order_state = new OrderState();
$order_state->name = array();
foreach (Language::getLanguages() as $language) {
if ($language['iso_code'] == 'fr') {
$order_state->name[$language['id_lang']] = $t['fr'];
} else {
$order_state->name[$language['id_lang']] = $t['en'];
}
}
$order_state->send_email = false;
$order_state->color = '#7DB3E2';
$order_state->unremovable = false;
$order_state->hidden = false;
$order_state->delivery = false;
$order_state->logable = false;
$order_state->invoice = false;
if ($order_state->add()) {
Configuration::updateValue($t['key'], (int) $order_state->id);
$source = dirname(__FILE__) . '/../img/syspay_os.gif';
$destination = dirname(__FILE__) . '/../../../img/os/' . (int) $order_state->id . '.gif';
copy($source, $destination);
} else {
return false;
}
}
}
return true;
}
示例5: installOrderState
public function installOrderState()
{
if (Configuration::get('PS_OS_MYMOD_PAYMENT') < 1) {
$order_state = new OrderState();
$order_state->send_email = true;
$order_state->module_name = $this->name;
$order_state->invoice = false;
$order_state->color = '#98c3ff';
$order_state->logable = true;
$order_state->shipped = false;
$order_state->unremovable = false;
$order_state->delivery = false;
$order_state->hidden = false;
$order_state->paid = false;
$order_state->deleted = false;
$order_state->name = array((int) Configuration::get('PS_LANG_DEFAULT') => pSQL($this->l('MyMod Payment - Awaiting confirmation')));
$order_state->template = array();
foreach (LanguageCore::getLanguages() as $l) {
$order_state->template[$l['id_lang']] = 'mymodpayment';
}
// We copy the mails templates in mail directory
foreach (LanguageCore::getLanguages() as $l) {
$module_path = dirname(__FILE__) . '/views/templates/mails/' . $l['iso_code'] . '/';
$application_path = dirname(__FILE__) . '/../../mails/' . $l['iso_code'] . '/';
if (!copy($module_path . 'mymodpayment.txt', $application_path . 'mymodpayment.txt') || !copy($module_path . 'mymodpayment.html', $application_path . 'mymodpayment.html')) {
return false;
}
}
if ($order_state->add()) {
// We save the order State ID in Configuration database
Configuration::updateValue('PS_OS_MYMOD_PAYMENT', $order_state->id);
// We copy the module logo in order state logo directory
copy(dirname(__FILE__) . '/logo.gif', dirname(__FILE__) . '/../../img/os/' . $order_state->id . '.gif');
copy(dirname(__FILE__) . '/logo.gif', dirname(__FILE__) . '/../../img/tmp/order_state_mini_' . $order_state->id . '.gif');
} else {
return false;
}
}
return true;
}
示例6: createOrderState
private function createOrderState()
{
if (!Configuration::get('PS_OS_DEBITNOTE')) {
$order_state = new OrderState();
$order_state->name = array();
foreach (Language::getLanguages() as $language) {
if (Tools::strtolower($language['iso_code']) == 'fr') {
$order_state->name[$language['id_lang']] = 'Paiement par prélèvement automatique';
} elseif (Tools::strtolower($language['iso_code']) == 'de') {
$order_state->name[$language['id_lang']] = 'Zahlung per Lastschrift';
} elseif (Tools::strtolower($language['iso_code']) == 'it') {
$order_state->name[$language['id_lang']] = 'Il pagamento tramite addebito diretto';
} elseif (Tools::strtolower($language['iso_code']) == 'es') {
$order_state->name[$language['id_lang']] = 'El pago mediante domiciliación bancaria';
} elseif (Tools::strtolower($language['iso_code']) == 'br') {
$order_state->name[$language['id_lang']] = 'O pagamento por débito directo';
} else {
$order_state->name[$language['id_lang']] = 'Payment by direct debit';
}
}
$order_state->send_email = true;
$order_state->color = '#10c8f6';
$order_state->hidden = false;
$order_state->delivery = false;
$order_state->logable = true;
$order_state->invoice = false;
$order_state->template = 'debitnote';
if ($order_state->add()) {
$source = dirname(__FILE__) . '/logo2.gif';
$destination = dirname(__FILE__) . '/../../img/os/' . (int) $order_state->id . '.gif';
copy($source, $destination);
$sourcemail = dirname(__FILE__) . '/mails/';
$destinationmail = dirname(__FILE__) . '/../../mails/';
$this->CopyMailFolder($sourcemail, $destinationmail);
}
Configuration::updateValue('PS_OS_DEBITNOTE', (int) $order_state->id);
}
}
示例7: createStates
public function createStates()
{
$order_states = array(array('#ccfbff', $this->l('Transaction in Process'), 'in_process', '010010000'), array('#c9fecd', $this->l('Transaction Finished'), 'payment', '110010010'), array('#fec9c9', $this->l('Transaction Cancelled'), 'order_canceled', '010010000'), array('#fec9c9', $this->l('Transaction Rejected'), 'payment_error', '010010000'), array('#ffeddb', $this->l('Transaction Refunded'), 'refund', '110010000'), array('#c28566', $this->l('Transaction Chargedback'), 'charged_back', '010010000'), array('#b280b2', $this->l('Transaction in Mediation'), 'in_mediation', '010010000'), array('#fffb96', $this->l('Transaction Pending'), 'pending', '010010000'));
$languages = Language::getLanguages();
foreach ($order_states as $key => $value) {
$order_state = new OrderState();
$order_state->invoice = $value[3][0];
$order_state->send_email = $value[3][1];
$order_state->module_name = 'mercadopago';
$order_state->color = $value[0];
$order_state->unremovable = $value[3][2];
$order_state->hidden = $value[3][3];
$order_state->logable = $value[3][4];
$order_state->delivery = $value[3][5];
$order_state->shipped = $value[3][6];
$order_state->paid = $value[3][7];
$order_state->deleted = $value[3][8];
$order_state->name = array();
$order_state->template = array();
foreach (Language::getLanguages(false) as $language) {
$order_state->name[(int) $language['id_lang']] = $value[1];
$order_state->template[$language['id_lang']] = $value[2];
if ($value[2] == 'in_process' || $value[2] == 'pending' || $value[2] == 'charged_back' || $value[2] == 'in_mediation') {
$this->populateEmail($language['iso_code'], $value[2], 'html');
$this->populateEmail($language['iso_code'], $value[2], 'txt');
}
}
if (!$order_state->add()) {
return false;
}
$file = _PS_ROOT_DIR_ . '/img/os/' . (int) $order_state->id . '.gif';
copy(dirname(__FILE__) . '/views/img/mp_icon.gif', $file);
Configuration::updateValue('MERCADOPAGO_STATUS_' . $key, $order_state->id);
}
return true;
}
示例8: _createAuthorizationOrderState
private function _createAuthorizationOrderState()
{
if (!Configuration::get('HIPAY_AUTHORIZATION_OS')) {
$os = new OrderState();
$os->name = array();
foreach (Language::getLanguages(false) as $language) {
if (Tools::strtolower($language['iso_code']) == 'fr') {
$os->name[(int) $language['id_lang']] = 'Autorisation acceptée par HiPay';
} else {
$os->name[(int) $language['id_lang']] = 'Authorization accepted by HiPay';
}
}
$os->color = '#4169E1';
$os->hidden = false;
$os->send_email = false;
$os->delivery = false;
$os->logable = false;
$os->invoice = false;
if ($os->add()) {
Configuration::updateValue('HIPAY_AUTHORIZATION_OS', $os->id);
copy(dirname(__FILE__) . '/logo.gif', dirname(__FILE__) . '/../../img/os/' . (int) $os->id . '.gif');
} else {
return false;
}
}
if (!Configuration::get('HIPAY_WAITINGPAYMENT_OS')) {
$os = new OrderState();
$os->name = array();
foreach (Language::getLanguages(false) as $language) {
if (Tools::strtolower($language['iso_code']) == 'fr') {
$os->name[(int) $language['id_lang']] = 'En attente de paiement HiPay';
} else {
$os->name[(int) $language['id_lang']] = 'En attente de paiement HiPay';
}
}
$os->color = '#FAAC58';
$os->hidden = false;
$os->send_email = false;
$os->delivery = false;
$os->logable = false;
$os->invoice = false;
if ($os->add()) {
Configuration::updateValue('HIPAY_WAITINGPAYMENT_OS', $os->id);
copy(dirname(__FILE__) . '/logo.gif', dirname(__FILE__) . '/../../img/os/' . (int) $os->id . '.gif');
} else {
$object->upgrade_detail['1.6.9'][] = 'Erreur sur la mise à jour du statut de commande - En attente de paiement HiPay.';
return false;
}
}
if (!Configuration::get('HIPAY_VERSION')) {
Configuration::updateValue('HIPAY_VERSION', '1.6.9');
}
return true;
}
示例9: _checkAndUpdateFromOldVersion
private function _checkAndUpdateFromOldVersion($install = false)
{
if (!Configuration::get('PAYPAL_NEW') and ($this->active or $install)) {
$ok = true;
/* Check PayPal API */
if (file_exists(_PS_ROOT_DIR_ . '/modules/paypalapi/paypalapi.php')) {
$confs = Configuration::getMultiple(array('PAYPAL_HEADER', 'PAYPAL_SANDBOX', 'PAYPAL_API_USER', 'PAYPAL_API_PASSWORD', 'PAYPAL_API_SIGNATURE', 'PAYPAL_EXPRESS_CHECKOUT'));
include_once _PS_ROOT_DIR_ . '/modules/paypalapi/paypalapi.php';
$paypalapi = new PayPalAPI();
if ($paypalapi->active) {
if (Configuration::get('PAYPAL_INTEGRAL') == 1) {
Configuration::updateValue('PAYPAL_PAYMENT_METHOD', _PAYPAL_INTEGRAL_);
} elseif (Configuration::get('PAYPAL_INTEGRAL') == 0) {
Configuration::updateValue('PAYPAL_PAYMENT_METHOD', _PAYPAL_OPTION_PLUS_);
}
$paypalapi->uninstall();
Configuration::loadConfiguration();
foreach ($confs as $key => $value) {
Configuration::updateValue($key, $value);
}
}
}
/* Create Table */
if (!Db::getInstance()->Execute('
CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'paypal_order` (
`id_order` int(10) unsigned NOT NULL auto_increment,
`id_transaction` varchar(255) NOT NULL,
PRIMARY KEY (`id_order`)
) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8')) {
$ok = false;
}
if (!Db::getInstance()->Execute('
ALTER TABLE `' . _DB_PREFIX_ . 'paypal_order` ADD `payment_method` INT NOT NULL,
ADD `payment_status` VARCHAR(255) NOT NULL,
ADD `capture` INT NOT NULL')) {
$ok = false;
}
/* Hook */
$this->registerHook('cancelProduct');
$this->registerHook('adminOrder');
/* Create OrderState */
if (!Configuration::get('PAYPAL_OS_AUTHORIZATION')) {
$orderState = new OrderState();
$orderState->name = array();
foreach (Language::getLanguages() as $language) {
if (strtolower($language['iso_code']) == 'fr') {
$orderState->name[$language['id_lang']] = 'Autorisation acceptée par PayPal';
} else {
$orderState->name[$language['id_lang']] = 'Authorization accepted from PayPal';
}
}
$orderState->send_email = false;
$orderState->color = '#DDEEFF';
$orderState->hidden = false;
$orderState->delivery = false;
$orderState->logable = true;
$orderState->invoice = true;
if ($orderState->add()) {
@copy(_PS_ROOT_DIR_ . '/img/os/' . Configuration::get('PS_OS_PAYPAL') . '.gif', _PS_ROOT_DIR_ . '/img/os/' . (int) $orderState->id . '.gif');
}
Configuration::updateValue('PAYPAL_OS_AUTHORIZATION', (int) $orderState->id);
}
/* Delete unseless configuration */
Configuration::deleteByName('PAYPAL_INTEGRAL');
/* Add new Configurations */
if (!Configuration::get('PAYPAL_PAYMENT_METHOD')) {
Configuration::updateValue('PAYPAL_PAYMENT_METHOD', _PAYPAL_INTEGRAL_);
}
Configuration::updateValue('PAYPAL_CAPTURE', 0);
Configuration::updateValue('PAYPAL_TEMPLATE', 'A');
if ($ok) {
Configuration::updateValue('PAYPAL_NEW', 1);
}
return $ok;
}
return false;
}
示例10: addOrderState
protected function addOrderState($key, $color, $names, $defaultName)
{
if (!Configuration::get($key)) {
$os = new OrderState();
$os->name = array();
foreach (Language::getLanguages(false) as $language) {
$code = Tools::strtolower($language['iso_code']);
$os->name[(int) $language['id_lang']] = isset($names[$code]) ? $names[$code] : $defaultName;
}
$os->color = $color;
$os->hidden = false;
$os->send_email = false;
$os->delivery = false;
$os->logable = false;
$os->invoice = false;
$os->module_name = $this->name;
if ($os->add()) {
Configuration::updateValue($key, $os->id);
copy(dirname(__FILE__) . '/logo.gif', getcwd() . '/../img/os/' . (int) $os->id . '.gif');
return true;
} else {
return false;
}
} else {
return true;
}
}
示例11: _addStatus
private function _addStatus($setting_name, $name, $template = false)
{
if (Configuration::get($setting_name)) {
return true;
}
$status = new OrderState();
$status->send_email = $template ? 1 : 0;
$status->invoice = 0;
$status->logable = 0;
$status->delivery = 0;
$status->hidden = 0;
$lngs = Language::getLanguages();
foreach ($lngs as $lng) {
$status->name[$lng['id_lang']] = $name;
if ($template) {
$status->template[$lng['id_lang']] = $template;
}
}
if ($status->add()) {
Configuration::updateValue($setting_name, $status->id);
return true;
}
return false;
}
示例12: addState
private function addState($en, $color)
{
$orderState = new OrderState();
$orderState->name = array();
foreach (Language::getLanguages() as $language) {
/*if (strtolower($language['iso_code']) == 'en')
$orderState->name[$language['id_lang']] = $fr;
else*/
$orderState->name[$language['id_lang']] = $en;
}
$orderState->send_email = false;
$orderState->color = $color;
$orderState->hidden = false;
$orderState->delivery = false;
$orderState->logable = false;
if ($orderState->add()) {
copy(dirname(__FILE__) . '/logo.gif', dirname(__FILE__) . '/../../img/os/' . (int) $orderState->id . '.gif');
}
return $orderState->id;
}
示例13: createNewOrderStates
public function createNewOrderStates()
{
$order_states = $this->getMediafinanzOrderStates();
//check shop for custom order states
foreach ($order_states as $order_state_key => $order_state) {
$create_os = false;
$create_os_id = 0;
if ((int) Configuration::get($order_state_key) > 0) {
$os = new OrderState((int) Configuration::get($order_state_key));
if (!Validate::isLoadedObject($os)) {
$create_os = true;
$create_os_id = (int) Configuration::get($order_state_key);
}
} else {
$create_os = true;
}
if ($create_os == true) {
$os = new OrderState();
if ($create_os_id > 0) {
$os->id = $create_os_id;
}
$langs = Language::getLanguages();
foreach ($langs as $lang) {
$os->name[$lang['id_lang']] = $order_state['name'];
$os->template[$lang['id_lang']] = $order_state['template'];
}
$os->color = $order_state['color'];
$os->send_email = $order_state['send_email'];
$os->unremovable = 1;
$os->hidden = 0;
$os->logable = 0;
$os->delivery = 0;
$os->shipped = 0;
$os->paid = 0;
$os->pdf_invoice = 1;
$os->module_name = $this->name;
if ($os->add()) {
$source = dirname(__FILE__) . '/../../img/os/' . Configuration::get('PS_OS_CHEQUE') . '.gif';
$destination = dirname(__FILE__) . '/../../img/os/' . (int) $os->id . '.gif';
Tools::copy($source, $destination);
}
Configuration::updateValue($order_state_key, $os->id);
}
}
return true;
}
示例14: installOrderState
/**
* Register a specific order status for CashWay
*/
public function installOrderState()
{
if ($order_state_id = Configuration::get('PS_OS_CASHWAY')) {
$this->setOrderStateIcon($order_state_id);
return true;
}
$order_state = new OrderState();
$order_state->name = array();
foreach (Language::getLanguages() as $language) {
$order_state->name[$language['id_lang']] = 'En attente de paiement via CashWay';
}
$order_state->module_name = 'cashway';
$order_state->send_email = false;
$order_state->color = 'RoyalBlue';
$order_state->invoice = false;
$order_state->unremovable = false;
$order_state->hidden = false;
$order_state->logable = false;
$order_state->delivery = false;
$order_state->shipped = false;
$order_state->paid = false;
$order_state->deleted = false;
if ($order_state->add()) {
Configuration::updateValue('PS_OS_CASHWAY', $order_state->id);
$this->setOrderStateIcon($order_state->id);
return true;
}
return false;
}
示例15: createOrderStates
private function createOrderStates()
{
if (!Configuration::get(self::OS_AWAITING)) {
$os = new OrderState();
$os->name = array();
foreach (Language::getLanguages(false) as $language) {
$os->name[(int) $language['id_lang']] = 'Awaiting pilibaba payment';
}
$os->color = '#4169E1';
$os->hidden = false;
$os->send_email = false;
$os->delivery = false;
$os->logable = false;
$os->invoice = false;
$os->paid = false;
if ($os->add()) {
Configuration::updateValue(self::OS_AWAITING, $os->id);
copy(dirname(__FILE__) . '/logo.png', dirname(__FILE__) . '/../../img/os/' . (int) $os->id . '.png');
} else {
return false;
}
}
return true;
}