本文整理汇总了PHP中OrderState::getOrderStates方法的典型用法代码示例。如果您正苦于以下问题:PHP OrderState::getOrderStates方法的具体用法?PHP OrderState::getOrderStates怎么用?PHP OrderState::getOrderStates使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OrderState
的用法示例。
在下文中一共展示了OrderState::getOrderStates方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: hookAdminStatsModules
public function hookAdminStatsModules($params)
{
global $cookie;
$result = Db::getInstance()->getRow('
SELECT COUNT(o.`id_order`) as total
FROM `' . _DB_PREFIX_ . 'orders` o
WHERE o.`date_add` BETWEEN ' . ModuleGraph::getDateBetween() . '
' . (intval(Tools::getValue('id_order_state')) ? 'AND (SELECT oh.id_order_state FROM `' . _DB_PREFIX_ . 'order_history` oh WHERE o.id_order = oh.id_order ORDER BY oh.date_add DESC, oh.id_order_history DESC LIMIT 1) = ' . intval(Tools::getValue('id_order_state')) : ''));
$states = OrderState::getOrderStates(intval($cookie->id_lang));
$this->_html = '
<fieldset class="width3"><legend><img src="../modules/' . $this->name . '/logo.gif" /> ' . $this->displayName . '</legend>
<form action="' . $_SERVER['REQUEST_URI'] . '" method="post" style="float: right;">
<select name="id_order_state">
<option value="0"' . (!Tools::getValue('id_order_state') ? ' selected="selected"' : '') . '>' . $this->l('All') . '</option>';
foreach ($states as $state) {
$this->_html .= '<option value="' . $state['id_order_state'] . '"' . ($state['id_order_state'] == Tools::getValue('id_order_state') ? ' selected="selected"' : '') . '>' . $state['name'] . '</option>';
}
$this->_html .= '</select>
<input type="submit" name="submitState" value="' . $this->l('Filter') . '" class="button" />
</form>
<p><img src="../img/admin/down.gif" />' . $this->l('This graph represents the carrier distribution for your orders. You can also limit it to one order state.') . '</p>
' . ($result['total'] ? ModuleGraph::engine(array('type' => 'pie', 'option' => Tools::getValue('id_order_state'))) : $this->l('No valid orders for this period.')) . '
</fieldset>';
return $this->_html;
}
示例2: hookAdminStatsModules
public function hookAdminStatsModules($params)
{
$sql = 'SELECT COUNT(o.`id_order`) as total
FROM `' . _DB_PREFIX_ . 'orders` o
WHERE o.`date_add` BETWEEN ' . ModuleGraph::getDateBetween() . '
' . Shop::addSqlRestriction(Shop::SHARE_ORDER, 'o') . '
' . ((int) Tools::getValue('id_order_state') ? 'AND (SELECT oh.id_order_state FROM `' . _DB_PREFIX_ . 'order_history` oh WHERE o.id_order = oh.id_order ORDER BY oh.date_add DESC, oh.id_order_history DESC LIMIT 1) = ' . (int) Tools::getValue('id_order_state') : '');
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql);
$states = OrderState::getOrderStates($this->context->language->id);
if (Tools::getValue('export')) {
$this->csvExport(array('type' => 'pie', 'option' => Tools::getValue('id_order_state')));
}
$this->_html = '
<div class="blocStats"><h2 class="icon-' . $this->name . '"><span></span>' . $this->displayName . '</h2>
<form action="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '" method="post" style="float: right;">
<select name="id_order_state">
<option value="0"' . (!Tools::getValue('id_order_state') ? ' selected="selected"' : '') . '>' . $this->l('All') . '</option>';
foreach ($states as $state) {
$this->_html .= '<option value="' . $state['id_order_state'] . '"' . ($state['id_order_state'] == Tools::getValue('id_order_state') ? ' selected="selected"' : '') . '>' . $state['name'] . '</option>';
}
$this->_html .= '</select>
<input type="submit" name="submitState" value="' . $this->l('Filter') . '" class="button" />
</form>
<p><img src="../img/admin/down.gif" />' . $this->l('This graph represents the carrier distribution for your orders. You can also limit it to orders in one state.') . '</p>
' . ($result['total'] ? $this->engine(array('type' => 'pie', 'option' => Tools::getValue('id_order_state'))) . '<br /><br /> <a href="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '&export=1&exportType=language"><img src="../img/admin/asterisk.gif" />' . $this->l('CSV Export') . '</a>' : $this->l('No valid orders for this period.')) . '
</div>';
return $this->_html;
}
示例3: getDevices
function getDevices()
{
$devices_obj = new DbQuery();
$devices_obj->select('
mpn.`id`,
mpn.`new_order`,
mpn.`new_customer`,
mpn.`order_statuses`,
mpn.`id_shop`,
mpn.`app_connection_id`,
mpn.`status`,
mpn.`device_unique_id`,
md.`account_email`,
md.`device_name`,
md.`last_activity`,
c.`iso_code` AS currency_iso
');
$devices_obj->from('mobassistantconnector_push_notifications', 'mpn');
$devices_obj->leftJoin('mobassistantconnector_devices', 'md', 'md.`device_unique_id` = mpn.`device_unique_id`');
$devices_obj->leftJoin('currency', 'c', 'c.`id_currency` = mpn.`currency_code`');
$devices_sql = $devices_obj->build();
$devices = Db::getInstance()->executeS($devices_sql);
if (!$devices) {
$devices = array();
}
$devices = replaceNull($devices);
$statuses_db = OrderState::getOrderStates(Configuration::get('PS_LANG_DEFAULT'));
$count_statuses = count($statuses_db);
$statuses = array();
for ($i = 0; $i < $count_statuses; $i++) {
$statuses[$statuses_db[$i]['id_order_state']] = $statuses_db[$i]['name'];
}
$devices = formDevices($devices, $statuses);
return Tools::jsonEncode($devices);
}
示例4: initFormByStatus
public function initFormByStatus()
{
$this->fields_form = array('legend' => array('title' => $this->l('By order status'), 'image' => '../img/admin/pdf.gif'), 'input' => array(array('type' => 'checkboxStatuses', 'label' => $this->l('Statuses:'), 'name' => 'id_order_state', 'values' => array('query' => OrderState::getOrderStates($this->context->language->id), 'id' => 'id_order_state', 'name' => 'name'), 'desc' => $this->l('You can also export orders which have not been charged yet.') . ' (<img src="../img/admin/charged_ko.gif" alt="" />).')), 'submit' => array('title' => $this->l('Generate PDF file by status.'), 'class' => 'button', 'id' => 'submitPrint2'));
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
SELECT COUNT(o.id_order) as nbOrders, (
SELECT oh.id_order_state
FROM ' . _DB_PREFIX_ . 'order_history oh
WHERE oh.id_order = oi.id_order
ORDER BY oh.date_add DESC, oh.id_order_history DESC
LIMIT 1
) id_order_state
FROM ' . _DB_PREFIX_ . 'order_invoice oi
LEFT JOIN ' . _DB_PREFIX_ . 'orders o ON (oi.id_order = o.id_order)
WHERE o.id_shop IN(' . implode(', ', Shop::getContextListShopID()) . ')
GROUP BY id_order_state
');
$status_stats = array();
foreach ($result as $row) {
$status_stats[$row['id_order_state']] = $row['nbOrders'];
}
$this->tpl_form_vars = array('statusStats' => $status_stats, 'style' => '');
$this->table = 'invoice_status';
$this->show_toolbar = false;
return parent::renderForm();
}
示例5: displaySettings
public function displaySettings($post_action)
{
$curr_order_state = new OrderState((int) $this->mondialrelay->account_shop['MR_ORDER_STATE']);
$order_state = array('id_order_state' => $this->mondialrelay->account_shop['MR_ORDER_STATE'], 'name' => $curr_order_state->name[$this->context->language->id]);
$this->context->smarty->assign(array('MR_token_admin_mondialrelay' => Tools::getAdminToken('AdminMondialRelay' . (int) Tab::getIdFromClassName('AdminMondialRelay') . (int) $this->context->employee->id), 'MR_account_set' => MondialRelay::isAccountSet(), 'MR_order_state' => $order_state, 'MR_orders_states_list' => OrderState::getOrderStates($this->context->language->id), 'MR_form_action' => $post_action, 'MR_error_list' => $this->post_errors));
echo $this->mondialrelay->fetchTemplate('/tpl/admintab/', 'settings');
}
示例6: __construct
public function __construct()
{
$this->bootstrap = true;
$this->table = 'order';
$this->className = 'Order';
$this->lang = false;
//$this->addRowAction('view');
$this->explicitSelect = true;
$this->allow_export = false;
//$this->lite_display=true;
$this->deleted = false;
$this->context = Context::getContext();
$this->bulk_actions = array('exportU' => array('text' => $this->l('export Ulozenka'), 'icon' => 'icon-refresh'));
$this->_select = '
a.id_currency,
a.id_order AS id_pdf,
cr.iso_code AS currency,
CONCAT(LEFT(c.`firstname`, 1), \'. \', c.`lastname`) AS `customer`,
osl.`name` AS `osname`,
os.`color`,
u.`dobirka`, u.`exported`, u.`id_ulozenka`, u.`pobocka_name`, u.`date_exp`,
IF((SELECT COUNT(so.id_order) FROM `' . _DB_PREFIX_ . 'orders` so WHERE so.id_customer = a.id_customer) > 1, 0, 1) as new';
$this->_join = '
LEFT JOIN `' . _DB_PREFIX_ . 'currency` cr ON a.`id_currency` = cr.`id_currency`
LEFT JOIN `' . _DB_PREFIX_ . 'customer` c ON (c.`id_customer` = a.`id_customer`)
LEFT JOIN `' . _DB_PREFIX_ . 'ulozenka` u ON (u.`id_order` = a.`id_order`)
LEFT JOIN `' . _DB_PREFIX_ . 'order_state` os ON (os.`id_order_state` = a.`current_state`)
LEFT JOIN `' . _DB_PREFIX_ . 'order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = ' . (int) $this->context->language->id . ')';
$this->_where .= 'AND u.`id_order` > 0';
$this->_orderBy = 'id_order';
$this->_orderWay = 'DESC';
$statuses_array = array();
$statuses = OrderState::getOrderStates((int) $this->context->language->id);
foreach ($statuses as $status) {
$statuses_array[$status['id_order_state']] = $status['name'];
}
$this->fields_list = array('id_order' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'reference' => array('title' => $this->l('Označení'), 'align' => 'center', 'width' => 65), 'id_ulozenka' => array('title' => $this->l('id uloženka'), 'align' => 'center', 'width' => 25), 'customer' => array('title' => $this->l('Zákazník'), 'havingFilter' => true), 'total_paid_tax_incl' => array('title' => $this->l('Celkem'), 'width' => 70, 'align' => 'center', 'prefix' => '<b>', 'suffix' => '</b>', 'type' => 'float'), 'currency' => array('title' => $this->l('Měna'), 'width' => 50, 'prefix' => '<b>', 'suffix' => '</b>', 'align' => 'center', 'filter_key' => 'currency'), 'payment' => array('title' => $this->l('Platba: '), 'width' => 100), 'osname' => array('title' => $this->l('Stav'), 'color' => 'color', 'width' => 100, 'type' => 'select', 'list' => $statuses_array, 'filter_key' => 'os!id_order_state', 'filter_type' => 'int', 'order_key' => 'osname'), 'pobocka_name' => array('title' => $this->l('Pobočka'), 'width' => 150, 'align' => 'right', 'filter_key' => 'pobocka_name'), 'date_add' => array('title' => $this->l('Datum objednávky'), 'width' => 130, 'align' => 'right', 'type' => 'datetime', 'filter_key' => 'a!date_add'), 'date_exp' => array('title' => $this->l('Datum exportu'), 'width' => 130, 'align' => 'right', 'type' => 'datetime', 'filter_key' => 'date_exp'), 'exported' => array('title' => $this->l('Exportováno'), 'width' => 70, 'align' => 'center', 'type' => 'bool', 'active' => 'exported', 'filter_key' => 'exported'), 'dobirka' => array('title' => $this->l('Dobírka'), 'width' => 70, 'align' => 'center', 'type' => 'bool', 'active' => 'dobirka', 'filter_key' => 'dobirka'));
$this->shopLinkType = 'shop';
$this->shopShareDatas = Shop::SHARE_ORDER;
if (Tools::isSubmit('id_order')) {
// Save context (in order to apply cart rule)
$order = new Order((int) Tools::getValue('id_order'));
if (!Validate::isLoadedObject($order)) {
throw new PrestaShopException('Cannot load Order object');
}
$this->context->cart = new Cart($order->id_cart);
$this->context->customer = new Customer($order->id_customer);
}
parent::__construct();
}
示例7: hookAdminStatsModules
public function hookAdminStatsModules($params)
{
$sql = 'SELECT COUNT(o.`id_order`) as total
FROM `' . _DB_PREFIX_ . 'orders` o
WHERE o.`date_add` BETWEEN ' . ModuleGraph::getDateBetween() . '
' . Shop::addSqlRestriction(Shop::SHARE_ORDER, 'o') . '
' . ((int) Tools::getValue('id_order_state') ? 'AND (SELECT oh.id_order_state FROM `' . _DB_PREFIX_ . 'order_history` oh WHERE o.id_order = oh.id_order ORDER BY oh.date_add DESC, oh.id_order_history DESC LIMIT 1) = ' . (int) Tools::getValue('id_order_state') : '');
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql);
$states = OrderState::getOrderStates($this->context->language->id);
if (Tools::getValue('export')) {
$this->csvExport(array('type' => 'pie', 'option' => Tools::getValue('id_order_state')));
}
$this->html = '
<div class="panel-heading">
' . $this->displayName . '
</div>
<form action="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '" method="post" class="form-horizontal alert">
<div class="row">
<div class="col-lg-5 col-lg-offset-6">
<select name="id_order_state">
<option value="0"' . (!Tools::getValue('id_order_state') ? ' selected="selected"' : '') . '>' . $this->l('All') . '</option>';
foreach ($states as $state) {
$this->html .= '<option value="' . $state['id_order_state'] . '"' . ($state['id_order_state'] == Tools::getValue('id_order_state') ? ' selected="selected"' : '') . '>' . $state['name'] . '</option>';
}
$this->html .= '</select>
</div>
<div class="col-lg-1">
<input type="submit" name="submitState" value="' . $this->l('Filter') . '" class="btn btn-default pull-right" />
</div>
</div>
</form>
<div class="alert alert-info">
' . $this->l('This graph represents the carrier distribution for your orders. You can also narrow the focus of the graph to display distribution for a particular order status.') . '
</div>
<div class="row row-margin-bottom">
<div class="col-lg-12">
<div class="col-lg-8">
' . ($result['total'] ? $this->engine(array('type' => 'pie', 'option' => Tools::getValue('id_order_state'))) . '
</div>
<div class="col-lg-4">
<a href="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '&export=1&exportType=language" class="btn btn-default">
<i class="icon-cloud-upload"></i> ' . $this->l('CSV Export') . '
</a>' : $this->l('No valid orders have been received for this period.')) . '
</div>
</div>
</div>';
return $this->html;
}
示例8: getFormYaPokupki
public function getFormYaPokupki()
{
$state = OrderState::getOrderStates(Context::getContext()->language->id);
$dir = _PS_ADMIN_DIR_;
$dir = explode('/', $dir);
$dir = base64_encode(end($dir) . '_' . Context::getContext()->cookie->id_employee . '_pokupki');
$extend = array();
$carriers = Carrier::getCarriers(Context::getContext()->language->id, true, false, false, null, 5);
$type = array(array('name' => 'POST', 'id' => 'POST'), array('name' => 'PICKUP', 'id' => 'PICKUP'), array('name' => 'DELIVERY', 'id' => 'DELIVERY'));
$out = array('form' => array('legend' => array('title' => $this->l('Настройки модуля Заказы на маркете'), 'icon' => 'icon-cogs'), 'input' => array(array('col' => 4, 'class' => 't', 'type' => 'text', 'desc' => $this->l('Токен для доступа к API Яндекс.Маркет'), 'name' => 'YA_POKUPKI_TOKEN', 'label' => $this->l('Авторизационный токен Яндекс.Маркет')), array('type' => 'checkbox', 'label' => $this->l('Предоплата'), 'name' => 'YA_POKUPKI_PREDOPLATA', 'values' => array('query' => array(array('id' => 'YANDEX', 'name' => $this->l('Оплата при оформлении (только в России)'), 'val' => 1), array('id' => 'SHOP_PREPAID', 'name' => $this->l('Напрямую магазину (только для Украины)'), 'val' => 1)), 'id' => 'id', 'name' => 'name')), array('type' => 'checkbox', 'label' => $this->l('Постоплата'), 'name' => 'YA_POKUPKI_POSTOPLATA', 'values' => array('query' => array(array('id' => 'CASH_ON_DELIVERY', 'name' => $this->l('Наличный расчёт при получении товара'), 'val' => 1), array('id' => 'CARD_ON_DELIVERY', 'name' => $this->l('Оплата банковской картой при получении заказа'), 'val' => 1)), 'id' => 'id', 'name' => 'name')), array('type' => 'checkbox', 'label' => $this->l('Настройки'), 'name' => 'YA_POKUPKI_SET', 'values' => array('query' => array(array('id' => 'CHANGEC', 'name' => $this->l('Включить смену доставок'), 'val' => 1)), 'id' => 'id', 'name' => 'name')), array('col' => 4, 'class' => 't', 'type' => 'text', 'desc' => $this->l('Ссылка на https://api.partner.market.yandex.ru/v2/'), 'name' => 'YA_POKUPKI_APIURL', 'label' => $this->l('URL партнёрского API Яндекс.Маркет')), array('col' => 4, 'class' => 't', 'type' => 'text', 'desc' => $this->l('Номер Кампании'), 'name' => 'YA_POKUPKI_NC', 'label' => $this->l('Номер Кампании')), array('col' => 4, 'class' => 't', 'type' => 'text', 'desc' => $this->l('Логин пользователя в системе Яндекс.Маркет'), 'name' => 'YA_POKUPKI_LOGIN', 'label' => $this->l('Логин пользователя в системе Яндекс.Маркет')), array('col' => 4, 'class' => 't', 'type' => 'text', 'desc' => $this->l('ID приложения'), 'name' => 'YA_POKUPKI_ID', 'label' => $this->l('ID приложения')), array('col' => 4, 'class' => 't', 'type' => 'text', 'desc' => $this->l('Пароль приложениюж'), 'name' => 'YA_POKUPKI_PW', 'label' => $this->l('Пароль приложения')), array('col' => 4, 'class' => 't', 'type' => 'text', 'desc' => '<a href="https://oauth.yandex.ru/authorize?response_type=code&display=popup&state=' . $dir . '&client_id=' . Configuration::get('YA_POKUPKI_ID') . "&device_id=" . md5(Configuration::get('YA_POKUPKI_ID')) . '">' . $this->l('Получить токен для доступа к Yandex.Покупки') . '</a>', 'name' => 'YA_POKUPKI_YATOKEN', 'label' => $this->l('Авторизационный токен'), 'disabled' => true), array('col' => 6, 'class' => 't', 'type' => 'text', 'desc' => $this->l('Номер пункта самовывоза'), 'name' => 'YA_POKUPKI_PUNKT', 'label' => $this->l('Идентификатор пункта самовывоза')), array('col' => 6, 'class' => 't', 'type' => 'text', 'name' => 'YA_MARKET_REDIRECT', 'desc' => $this->l('Callback Url для OAuth-приложения'), 'label' => $this->l('Ссылка для приложения')), array('col' => 6, 'class' => 't', 'type' => 'text', 'desc' => $this->l('URL API для заполнения в настройках магазина на Яндекс.Маркет'), 'name' => 'YA_POKUPKI_APISHOP', 'label' => $this->l('Ссылка для обращения к Вашему магазину'))), 'submit' => array('title' => $this->l('Сохранить'))));
foreach ($carriers as $a) {
$out['form']['input'][] = array('type' => 'select', 'label' => $this->l('Тип доставки') . ' ' . $a['name'], 'name' => 'YA_POKUPKI_DELIVERY_' . $a['id_carrier'], 'desc' => $this->l('POST - Почта, DELIVERY - Курьерская доставка, PICKUP - Самовывоз'), 'options' => array('query' => $type, 'name' => 'name', 'id' => 'id'), 'class' => 't');
}
return $out;
}
示例9: assignOrderStates
public static function assignOrderStates()
{
$context = Context::getContext();
$order_states = OrderState::getOrderStates($context->cookie->id_lang);
$states_list = array(Configuration::get('PS_OS_BANKWIRE'), Configuration::get('PS_OS_CANCELED'), Configuration::get('PS_OS_CHEQUE'), Configuration::get('PS_OS_ERROR'), Configuration::get('PS_OS_OUTOFSTOCK'), Configuration::get('PS_OS_PAYPAL'), Configuration::get('PS_OS_REFUND'), Configuration::get('PS_OS_SYSPAY'), Configuration::get('PS_OS_SYSPAY_AUTHORIZED'), Configuration::get('PS_OS_SYSPAY_CB'), Configuration::get('PAYPAL_OS_AUTHORIZATION'), Configuration::get('PS_OS_WS_PAYMENT'));
$states = array();
foreach ($order_states as $os) {
if (!in_array($os['id_order_state'], $states_list)) {
$states[] = $os;
}
}
if ($states) {
$context->smarty->assign('states', $states);
}
}
示例10: getContent
function getContent()
{
// Loading config currency
$config_currency = new Currency((int) $this->ebay_profile->getConfiguration('EBAY_CURRENCY'));
$url_vars = array('id_tab' => '1', 'section' => 'parameters');
if (version_compare(_PS_VERSION_, '1.5', '>')) {
$url_vars['controller'] = Tools::getValue('controller');
} else {
$url_vars['tab'] = Tools::getValue('tab');
}
$url = $this->_getUrl($url_vars);
$ebayShop = $this->ebay_profile->getConfiguration('EBAY_SHOP') ? $this->ebay_profile->getConfiguration('EBAY_SHOP') : $this->ebay->StoreName;
$ebayShopValue = Tools::getValue('ebay_shop', $ebayShop);
$ebay_country = EbayCountrySpec::getInstanceByKey($this->ebay_profile->getConfiguration('EBAY_COUNTRY_DEFAULT'));
$createShopUrl = 'http://cgi3.ebay.' . $ebay_country->getSiteExtension() . '/ws/eBayISAPI.dll?CreateProductSubscription&&productId=3&guest=1';
$ebay_request = new EbayRequest();
$ebay_sign_in_url = $ebay_request->getLoginUrl() . '?SignIn&runame=' . $ebay_request->runame . '&SessID=' . $this->context->cookie->eBaySession;
$returns_policy_configuration = $this->ebay_profile->getReturnsPolicyConfiguration();
$returnsConditionAccepted = Tools::getValue('ebay_returns_accepted_option', Configuration::get('EBAY_RETURNS_ACCEPTED_OPTION'));
$ebay_paypal_email = Tools::getValue('ebay_paypal_email', $this->ebay_profile->getConfiguration('EBAY_PAYPAL_EMAIL'));
$shopPostalCode = Tools::getValue('ebay_shop_postalcode', $this->ebay_profile->getConfiguration('EBAY_SHOP_POSTALCODE'));
$shopCountry = Tools::getValue('ebay_shop_country', $this->ebay_profile->getConfiguration('EBAY_SHOP_COUNTRY'));
$ebayListingDuration = $this->ebay_profile->getConfiguration('EBAY_LISTING_DURATION') ? $this->ebay_profile->getConfiguration('EBAY_LISTING_DURATION') : 'GTC';
$user_profile = $ebay_request->getUserProfile($this->ebay_profile->ebay_user_identifier);
$is_multishop = version_compare(_PS_VERSION_, '1.5', '>') && Shop::isFeatureActive();
$order_states = OrderState::getOrderStates($this->ebay_profile->id_lang);
$current_order_state = $this->ebay_profile->getConfiguration('EBAY_SHIPPED_ORDER_STATE');
if ($current_order_state === null) {
foreach ($order_states as $order_state) {
if ($order_state['template'] === 'shipped') {
// NDRArbuz: is this the best way to find it with no doubt?
$current_order_state = $order_state['id_order_state'];
break;
}
}
}
$smarty_vars = array('url' => $url, 'ebay_sign_in_url' => $ebay_sign_in_url, 'ebay_token' => Configuration::get('EBAY_SECURITY_TOKEN'), 'configCurrencysign' => $config_currency->sign, 'policies' => EbayReturnsPolicy::getReturnsPolicies(), 'catLoaded' => !Configuration::get('EBAY_CATEGORY_LOADED_' . $this->ebay_profile->ebay_site_id), 'createShopUrl' => $createShopUrl, 'ebayCountry' => EbayCountrySpec::getInstanceByKey($this->ebay_profile->getConfiguration('EBAY_COUNTRY_DEFAULT')), 'ebayReturns' => preg_replace('#<br\\s*?/?>#i', "\n", $this->ebay_profile->getReturnsPolicyConfiguration()->ebay_returns_description), 'ebayShopValue' => $ebayShopValue, 'shopPostalCode' => Tools::getValue('ebay_shop_postalcode', $this->ebay_profile->getConfiguration('EBAY_SHOP_POSTALCODE')), 'listingDurations' => $this->_getListingDurations(), 'ebayShop' => $this->ebay_profile->getConfiguration('EBAY_SHOP'), 'ebay_paypal_email' => Tools::getValue('ebay_paypal_email', $this->ebay_profile->getConfiguration('EBAY_PAYPAL_EMAIL')), 'returnsConditionAccepted' => Tools::getValue('ebay_returns_accepted_option', $returns_policy_configuration->ebay_returns_accepted_option), 'automaticallyRelist' => $this->ebay_profile->getConfiguration('EBAY_AUTOMATICALLY_RELIST'), 'ebay_paypal_email' => $ebay_paypal_email, 'returnsConditionAccepted' => $returnsConditionAccepted, 'ebayListingDuration' => $ebayListingDuration, 'automaticallyRelist' => Configuration::get('EBAY_AUTOMATICALLY_RELIST'), 'is_multishop' => $is_multishop, 'within_values' => unserialize(Configuration::get('EBAY_RETURNS_WITHIN_VALUES')), 'within' => $returns_policy_configuration->ebay_returns_within, 'whopays_values' => unserialize(Configuration::get('EBAY_RETURNS_WHO_PAYS_VALUES')), 'whopays' => $returns_policy_configuration->ebay_returns_who_pays, 'activate_mails' => Configuration::get('EBAY_ACTIVATE_MAILS'), 'hasEbayBoutique' => isset($user_profile['StoreUrl']) && !empty($user_profile['StoreUrl']) ? true : false, 'currencies' => TotCompatibility::getCurrenciesByIdShop($this->ebay_profile->id_shop), 'current_currency' => (int) $this->ebay_profile->getConfiguration('EBAY_CURRENCY'), 'ebay_shop_countries' => EbayCountrySpec::getCountries(false), 'current_ebay_shop_country' => $shopCountry, 'send_tracking_code' => (bool) $this->ebay_profile->getConfiguration('EBAY_SEND_TRACKING_CODE'), 'order_states' => $order_states, 'current_order_state' => $current_order_state, 'immediate_payment' => (bool) $this->ebay_profile->getConfiguration('EBAY_IMMEDIATE_PAYMENT'));
if (Tools::getValue('relogin')) {
$this->ebay->login();
$smarty_vars = array_merge($smarty_vars, array('relogin' => true, 'redirect_url' => $ebay_request->getLoginUrl() . '?SignIn&runame=' . $ebay_request->runame . '&SessID=' . $this->context->cookie->eBaySession));
} else {
$smarty_vars['relogin'] = false;
}
if (Tools::getValue('action') == 'regenerate_token') {
$smarty_vars['check_token_tpl'] = $this->ebay->_displayCheckToken();
}
return $this->display('formParameters.tpl', $smarty_vars);
}
示例11: getContent
public function getContent()
{
$html = '';
if (Tools::isSubmit('submitModule')) {
Configuration::updateValue('PAYNETZ_API_MERCHANT_URL', Tools::getvalue('api_merchant_url'));
Configuration::updateValue('PAYNETZ_API_SERVER_PORT', Tools::getvalue('api_server_port'));
Configuration::updateValue('PAYNETZ_API_LOGIN_ID', Tools::getvalue('api_login_id'));
Configuration::updateValue('PAYNETZ_API_PASSWORD', Tools::getvalue('api_password'));
Configuration::updateValue('PAYNETZ_API_PRODUCT_ID', Tools::getvalue('api_product_id'));
$html .= $this->displayConfirmation($this->l('Configuration updated'));
}
// For "Hold for Review" order status
$currencies = Currency::getCurrencies(false, true);
$order_states = OrderState::getOrderStates((int) $this->context->cookie->id_lang);
$this->context->smarty->assign(array('available_currencies' => $this->aim_available_currencies, 'currencies' => $currencies, 'module_dir' => $this->_path, 'order_states' => $order_states, 'PAYNETZ_API_MERCHANT_URL' => Configuration::get('PAYNETZ_API_MERCHANT_URL'), 'PAYNETZ_API_SERVER_PORT' => Configuration::get('PAYNETZ_API_SERVER_PORT'), 'PAYNETZ_API_LOGIN_ID' => Configuration::get('PAYNETZ_API_LOGIN_ID'), 'PAYNETZ_API_PASSWORD' => Configuration::get('PAYNETZ_API_PASSWORD'), 'PAYNETZ_API_PRODUCT_ID' => Configuration::get('PAYNETZ_API_PRODUCT_ID')));
return $this->context->smarty->fetch($this->local_path . 'views/templates/admin/configuration.tpl');
}
示例12: __construct
public function __construct()
{
foreach (Language::getLanguages(false) as $language) {
if (strcmp($language["iso_code"], 'br') == 0) {
$this->idLang = $language["id_lang"];
} else {
if (strcmp($language["iso_code"], 'en') == 0) {
$this->idLang = $language["id_lang"];
}
}
}
$order_state = OrderState::getOrderStates($this->idLang);
foreach ($order_state as $value) {
if (strcmp($value["name"], Util::getStatusCMS(0)) == 0) {
$this->idInitiatedState = $value["id_order_state"];
}
}
}
示例13: __construct
public function __construct()
{
global $cookie;
$evgmwedmihr = "statuses_array";
${"GLOBALS"}["ynkpdchxy"] = "statuses";
$this->bootstrap = true;
$this->table = "order_detail";
$this->identifier = "id_order_detail";
$uabfcuorovz = "status";
$this->className = "OrderDetail";
$tjctkjkrs = "status";
$this->addRowAction("");
$vbvfygz = "statuses_array";
parent::__construct();
${"GLOBALS"}["xeuytgig"] = "statuses";
${$evgmwedmihr} = array();
${${"GLOBALS"}["ynkpdchxy"]} = OrderState::getOrderStates((int) $this->context->language->id);
foreach (${${"GLOBALS"}["xeuytgig"]} as ${$uabfcuorovz}) {
${$vbvfygz}[${$tjctkjkrs}["id_order_state"]] = ${${"GLOBALS"}["apjhrgl"]}["name"];
}
$this->fields_list = array("id_order_detail" => array("title" => $this->l('ID'), "align" => "center", "width" => 50), "id_order" => array("title" => $this->l('Order ID'), "align" => "center", "width" => 50, "filter_key" => "a!id_order"), "id_owner" => array("title" => $this->l('Seller ID'), "align" => "center", "width" => 50), "seller" => array("title" => $this->l('Seller'), "havingFilter" => true), "product_name" => array("title" => $this->l('Product Name'), "width" => 180, "align" => "left"), "product_price" => array("title" => $this->l('Price'), "width" => 70, "align" => "right", "prefix" => "<b>", "suffix" => "</b>", "type" => "price", "currency" => true), "product_quantity" => array("title" => $this->l('Quantity'), "align" => "center", "havingFilter" => true), "osname" => array("title" => $this->l('Status'), "color" => "color", "width" => 280, "type" => "select", "list" => ${${"GLOBALS"}["inermslrwox"]}, "filter_key" => "os!id_order_state", "filter_type" => "int"), "date_add" => array("title" => $this->l('Date'), "width" => 130, "align" => "right", "type" => "datetime", "filter_key" => "o!date_add"));
$this->_isSeller = intval($cookie->profile) == Configuration::get("AGILE_MS_PROFILE_ID");
$this->_join = $this->_join . "\n LEFT JOIN `" . _DB_PREFIX_ . "orders` o ON (a.`id_order`=o.id_order)\n LEFT JOIN `" . _DB_PREFIX_ . "order_owner` oo ON (a.`id_order`=oo.`id_order`)\n LEFT JOIN `" . _DB_PREFIX_ . "sellerinfo` s ON (oo.`id_owner`=s.`id_seller`)\n LEFT JOIN `" . _DB_PREFIX_ . "sellerinfo_lang` sl ON (sl.`id_sellerinfo`=s.`id_sellerinfo` AND sl.id_lang=" . $cookie->id_lang . ")\n\t \t LEFT JOIN `" . _DB_PREFIX_ . "order_history` oh ON (oh.`id_order` = a.`id_order`)\n\t\t LEFT JOIN `" . _DB_PREFIX_ . "order_state` os ON (os.`id_order_state` = oh.`id_order_state`)\n\t\t LEFT JOIN `" . _DB_PREFIX_ . "order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = " . (int) $cookie->id_lang . ")\n\t\t ";
$this->_select = $this->_select . "\n o.date_add, oo.id_owner, o.id_currency as id_currency,a.product_name, sl.company as seller\n\t\t\t ,osl.`name` AS `osname`, os.`color`\n ";
$this->_where = " AND oh.`id_order_history` = (SELECT MAX(`id_order_history`) FROM `" . _DB_PREFIX_ . "order_history` moh WHERE moh.`id_order` = a.`id_order` GROUP BY moh.`id_order`)";
if ($this->_isSeller) {
$this->_where = $this->_where . " AND oo.id_owner=" . intval($cookie->id_employee);
} else {
$this->fieldsDisplay["seller"] = array("title" => $this->l('Seller'), "filter_key" => "sl!company");
}
if (isset($_GET["updateorder_detail"]) and isset($_GET["id_order_detail"]) and (int) $_GET["id_order_detail"] > 0) {
$vpjipovr = "orderdetail";
${${"GLOBALS"}["kwzmtwdwu"]} = Tools::getValue("id_order_detail");
$zcisptfo = "newtoekn";
$crgspgj = "newtoekn";
$gygsuy = "tabid";
$whumnqj = "id_order_detail";
${$vpjipovr} = new OrderDetail(${$whumnqj});
${$gygsuy} = Tab::getIdFromClassName("AdminOrders");
${$crgspgj} = Tools::getAdminToken("AdminOrders" . intval(${${"GLOBALS"}["aaiesey"]}) . intval($cookie->id_employee));
${${"GLOBALS"}["epfgdop"]} = "./index.php?controller=adminorders&id_order=" . $orderdetail->id_order . "&vieworder&token=" . ${$zcisptfo};
Tools::redirectAdmin(${${"GLOBALS"}["epfgdop"]});
}
}
示例14: initFormByStatus
public function initFormByStatus()
{
$this->fields_form = array('legend' => array('title' => $this->l('By order status'), 'icon' => 'icon-time'), 'input' => array(array('type' => 'checkboxStatuses', 'label' => $this->l('Statuses'), 'name' => 'id_order_state', 'values' => array('query' => OrderState::getOrderStates($this->context->language->id), 'id' => 'id_order_state', 'name' => 'name'), 'hint' => $this->l('You can also export orders which have not been charged yet.'))), 'submit' => array('title' => $this->l('Generate PDF file by status'), 'id' => 'submitPrint2', 'icon' => 'process-icon-download-alt'));
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
SELECT COUNT( o.id_order ) AS nbOrders, o.current_state as id_order_state
FROM `' . _DB_PREFIX_ . 'order_invoice` oi
LEFT JOIN `' . _DB_PREFIX_ . 'orders` o ON oi.id_order = o.id_order
WHERE o.id_shop IN(' . implode(', ', Shop::getContextListShopID()) . ')
GROUP BY o.current_state
');
$status_stats = array();
foreach ($result as $row) {
$status_stats[$row['id_order_state']] = $row['nbOrders'];
}
$this->tpl_form_vars = array('statusStats' => $status_stats, 'style' => '');
$this->table = 'invoice_status';
$this->show_toolbar = false;
return parent::renderForm();
}
示例15: getFormConfigurationController
public function getFormConfigurationController()
{
// get all status
$advanced_order_status = Configuration::get(self::getControllerStatusName('AdminAdvancedOrder'));
$fields_form = array();
// configure stock gap
$fields_form[2]['form'] = array('legend' => array('title' => $this->l('General settings'), 'image' => '../img/admin/cog.gif'), 'input' => array(array('type' => 'radio', 'label' => $this->l('Disable original menus of PrestaShop'), 'name' => 'erp_disable_original_menus', 'required' => true, 'br' => true, 'class' => 't', 'default_value' => '1', 'values' => array(array('id' => 'erp_disable_original_menus' . _PS_SMARTY_NO_COMPILE_, 'value' => '1', 'label' => $this->l('Yes')), array('id' => 'erp_disable_original_menus' . _PS_SMARTY_CHECK_COMPILE_, 'value' => '0', 'label' => $this->l('No'))), 'desc' => $this->l('This option allows you to disable the menus : orders, supply order and supplier'))), 'submit' => array('title' => $this->l('Save'), 'class' => $this->is_1_6 ? null : 'button', 'name' => 'submitGeneralSettings'));
// Get activate module table
$features = ErpFeature::getFeaturesWithToken($this->context->language->iso_code);
//Display controller parameters if activ and good state
foreach ($features as $feature) {
//INVENTORY
if ($feature['active'] && $feature['controller'] == 'AdminInventory' && Configuration::get(self::getControllerStatusName('AdminInventory'))) {
// configure stock gap
$fields_form[3]['form'] = array('legend' => array('title' => sprintf($this->l('%s settings'), $feature['name']), 'image' => '../modules/erpillicopresta/img/features/inventory.png'), 'input' => array(array('type' => 'text', 'label' => $this->l('Maximum authorized stock gap'), 'name' => 'erp_gap_stock', 'size' => 20, 'required' => true, 'desc' => $this->l('If the difference between the found quantity and the expected quantity is greater than this value, an alert will be generated. (0 to disable)'))), 'submit' => array('title' => $this->l('Save'), 'class' => $this->is_1_6 ? null : 'button', 'name' => 'submitInventorySettings'));
}
//ORDER
if ($feature['active'] && $feature['controller'] == 'AdminAdvancedOrder' && $advanced_order_status != STATUS0 && $advanced_order_status != STATUS1) {
// Get default Language
$states = OrderState::getOrderStates((int) Configuration::get('PS_LANG_DEFAULT'));
$fields_form[4]['form'] = array('legend' => array('title' => sprintf($this->l('%s settings'), $feature['name']), 'image' => '../modules/erpillicopresta/img/features/order.png'), 'input' => array(array('type' => 'text', 'label' => $this->l('Stock level - ALERT'), 'name' => 'erp_level_stock_alert', 'desc' => $this->l('Please indicate the stock quantity above which an alert will notify you : from 1 to [X]'), 'size' => 4), array('type' => 'text', 'label' => $this->l('Stock level - NORMAL'), 'name' => 'erp_level_stock_normal', 'desc' => $this->l('Please indicate the stock quantity corresponding to a normal stock level : from ALERT to [X]'), 'size' => 4), array('type' => 'checkbox', 'label' => $this->l('Order status to notify'), 'name' => 'erp_status_warning_stock', 'required' => true, 'values' => array('query' => $states, 'id' => 'id_order_state', 'name' => 'name'), 'desc' => $this->l('Select all status which are concerned by stock warnings'))), 'submit' => array('title' => $this->l('Save'), 'class' => $this->is_1_6 ? null : 'button', 'name' => 'submitAdvancedOrderSettings'));
}
//SUPPLIER ORDER
if ($feature['active'] && $feature['controller'] == 'AdminAdvancedSupplyOrder') {
$fields_form[5]['form'] = array('legend' => array('title' => sprintf($this->l('%s settings'), $feature['name']), 'image' => '../modules/erpillicopresta/img/features/supply_order.png'), 'input' => array(array('type' => 'text', 'label' => $this->l('References prefix'), 'name' => 'erp_prefix_reference', 'desc' => $this->l('References prefixes for the supplier order: maximum of two characters. Default prefix is SO.'), 'size' => 2, 'maxlength' => 2, 'required' => true), array('type' => 'radio', 'label' => $this->l('Activate email sending to suppliers'), 'name' => 'erp_enable_sending_mail_supplier', 'required' => true, 'br' => true, 'class' => 't', 'default_value' => '0', 'values' => array(array('id' => 'erp_enable_sending_mail_supplier' . _PS_SMARTY_NO_COMPILE_, 'value' => '1', 'label' => $this->l('Yes')), array('id' => 'erp_enable_sending_mail_supplier' . _PS_SMARTY_CHECK_COMPILE_, 'value' => '0', 'label' => $this->l('No'))), 'desc' => $this->l('If you select this option, please define the default status to be considered.')), array('type' => 'select', 'label' => $this->l('Status of supplier orders that activates an email sending'), 'name' => 'erp_so_state_to_send_mail', 'desc' => $this->l('In the selected status, an email will be sent to the supplier. Default : 2 - Order validated.'), 'required' => true, 'options' => array('query' => SupplyOrderState::getStates(), 'id' => 'id_supply_order_state', 'name' => 'name'))), 'submit' => array('title' => $this->l('Save'), 'class' => $this->is_1_6 ? null : 'button', 'name' => 'submitAdvancedSupplyOrderSettings'));
if (Configuration::get(self::getControllerStatusName('AdminAdvancedSupplyOrder'))) {
// configure stock gap
$fields_form[5]['form']['input'][] = array('type' => 'select', 'label' => $this->l('Status of customer orders that generates supplier orders'), 'name' => 'erp_generate_order_state', 'desc' => $this->l('Please choose here the status of customer orders that will generate an automatic supplier order.'), 'required' => true, 'options' => array('query' => OrderState::getOrderStates((int) $this->context->language->id), 'id' => 'id_order_state', 'name' => 'name'));
$fields_form[5]['form']['input'][] = array('type' => 'select', 'label' => $this->l('Status of customer orders after generation of supplier orders'), 'name' => 'erp_generate_order_state_to', 'desc' => $this->l('Select the state to apply to customer orders after the automatic generation of supplier orders occured.'), 'required' => true, 'options' => array('query' => OrderState::getOrderStates((int) $this->context->language->id), 'id' => 'id_order_state', 'name' => 'name'));
// configure stock gap
$fields_form[5]['form']['input'][] = array('type' => 'text', 'label' => $this->l('Number of rolling months'), 'name' => 'erp_rolling_months_nb_so', 'size' => 20, 'required' => true, 'desc' => $this->l('Used to display the quantities sold for x rolling months.'));
$fields_form[5]['form']['input'][] = array('type' => 'select', 'label' => $this->l('Status of customer orders that count for the product sales statistic'), 'name' => 'erp_so_state_to_product_sales', 'desc' => $this->l('In the selected status, the products of the order will be counted in the product sales statistic.'), 'required' => true, 'options' => array('query' => OrderState::getOrderStates((int) $this->context->language->id), 'id' => 'id_order_state', 'name' => 'name'));
$fields_form[5]['form']['input'][] = array('type' => 'radio', 'label' => $this->l('Sales forecast type'), 'name' => 'erp_sales_forecast_choice', 'br' => true, 'class' => 't', 'values' => array(array('id' => 'none', 'value' => 0, 'label' => $this->l('No projected sales')), array('id' => 'forecast_six_last_month', 'value' => 1, 'label' => $this->l('Weighted average sales on the six last rolling months')), array('id' => 'forecast_period', 'value' => 2, 'label' => $this->l('Sales forecast by period'))), 'desc' => $this->l('Sales forecast will be calculated during supplier orders.') . '</br>' . $this->l('The "Sales forecast by period" method calculates ') . $this->l('the sales growth factor based on the comparison between ') . $this->l('x rolling months of the current year ') . $this->l('and the same x rolling months of the previous year at the same date. ') . $this->l('Sales for the choosen projection period are then estimated by multiplying ') . $this->l('this sales growth factor by the sales performed during that period on the previous year.'));
$fields_form[5]['form']['input'][] = array('type' => 'text', 'label' => $this->l('Weighting coefficients'), 'name' => 'erp_coefficients', 'desc' => $this->l('Coefficients that will be used to calculate the "Weighted average sales on the six last rolling months". Positive numbers expected.') . '<br/>' . $this->l('Syntax : M-1;M-2;M-3;M-4;M-5;M-6 (coefficient of the month M-1; etc.)'), 'size' => 20);
$fields_form[5]['form']['input'][] = array('type' => 'text', 'label' => $this->l('Projection period'), 'name' => 'erp_projected_period', 'suffix' => $this->l('days'), 'desc' => $this->l('The "Sales forecast by period" method will return the total sales estimation for the filled out period.'), 'size' => 20);
$fields_form[5]['form']['input'][] = array('type' => 'text', 'label' => $this->l('Comparison period for the growth factor calculation'), 'name' => 'erp_comparison_period', 'suffix' => $this->l('month'), 'desc' => $this->l('Number of months preceding the current date that will be used to calculate the sales growth factor in the "Sales forecast by period" method.'), 'size' => 20);
$fields_form[5]['form']['input'][] = array('type' => 'text', 'label' => $this->l('Exceptional sales threshold'), 'name' => 'erp_exceptional_order_limit', 'desc' => $this->l('Above this value, a sale will be considered exceptional and will not be taken into account in forecasts. 0 if non applicable.'), 'size' => 20, 'required' => true);
}
}
}
return $fields_form;
}