本文整理汇总了PHP中Gateway::updateConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP Gateway::updateConfig方法的具体用法?PHP Gateway::updateConfig怎么用?PHP Gateway::updateConfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gateway
的用法示例。
在下文中一共展示了Gateway::updateConfig方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getContent
public function getContent()
{
$this->html = '';
if (Tools::isSubmit('submitNetEven')) {
if (Tools::getValue('NETEVEN_LOGIN') && Tools::getValue('NETEVEN_PASSWORD')) {
Gateway::updateConfig('NETEVEN_LOGIN', Tools::getValue('NETEVEN_LOGIN'));
Gateway::updateConfig('NETEVEN_PASSWORD', Tools::getValue('NETEVEN_PASSWORD'));
Gateway::updateConfig('COMMENT', Tools::getValue('COMMENT'));
Gateway::updateConfig('DEFAULT_BRAND', Tools::getValue('DEFAULT_BRAND'));
Gateway::updateConfig('IMAGE_TYPE_NAME', Tools::getValue('IMAGE_TYPE_NAME'));
Gateway::updateConfig('SYNCHRONISATION_ORDER', (int) Tools::getValue('SYNCHRONISATION_ORDER'));
Gateway::updateConfig('SYNCHRONISATION_PRODUCT', (int) Tools::getValue('SYNCHRONISATION_PRODUCT'));
Gateway::updateConfig('TYPE_SKU', (string) Tools::getValue('TYPE_SKU'));
$this->html .= $this->displayConfirmation($this->l('Les paramètres ont bien été mis à jour'));
} else {
$this->html .= $this->displayError($this->l('Les login et mot de passe NetEven sont obligatoire'));
}
} elseif (Tools::isSubmit('submitNetEvenShipping')) {
Gateway::updateConfig('SHIPPING_DELAY', Tools::getValue('SHIPPING_DELAY'));
Gateway::updateConfig('SHIPPING_PRICE_LOCAL', Tools::getValue('SHIPPING_PRICE_LOCAL'));
Gateway::updateConfig('SHIPPING_PRICE_INTERNATIONAL', Tools::getValue('SHIPPING_PRICE_INTERNATIONAL'));
Gateway::updateConfig('SHIPPING_BY_PRODUCT', (int) Tools::getValue('SHIPPING_BY_PRODUCT'));
Gateway::updateConfig('SHIPPING_BY_PRODUCT_FIELDNAME', Tools::getValue('SHIPPING_BY_PRODUCT_FIELDNAME'));
Gateway::updateConfig('SHIPPING_CARRIER_FRANCE', Tools::getValue('SHIPPING_CARRIER_FRANCE'));
Gateway::updateConfig('SHIPPING_ZONE_FRANCE', Tools::getValue('SHIPPING_ZONE_FRANCE'));
Gateway::updateConfig('SHIPPING_CARRIER_INTERNATIONAL', Tools::getValue('SHIPPING_CARRIER_INTERNATIONAL'));
Gateway::updateConfig('SHIPPING_ZONE_INTERNATIONAL', Tools::getValue('SHIPPING_ZONE_INTERNATIONAL'));
$this->html .= $this->displayConfirmation($this->l('Les paramètres de livraison ont bien été mis à jour'));
} elseif (Tools::isSubmit('submitDev')) {
Gateway::updateConfig('NETEVEN_URL', Tools::getValue('NETEVEN_URL'));
Gateway::updateConfig('NETEVEN_NS', Tools::getValue('NETEVEN_NS'));
Gateway::updateConfig('MAIL_LIST_ALERT', Tools::getValue('MAIL_LIST_ALERT'));
Gateway::updateConfig('DEBUG', (int) Tools::getValue('DEBUG'));
Gateway::updateConfig('SEND_REQUEST_BY_EMAIL', (int) Tools::getValue('SEND_REQUEST_BY_EMAIL'));
$this->html .= $this->displayConfirmation($this->l('Les paramètres de maintenance ont bien été mis à jour'));
} elseif (Tools::isSubmit('submitCustomizableFeilds')) {
$customizable_field_name = Tools::getValue('customizable_field_name');
$customizable_field_value = Tools::getValue('customizable_field_value');
$customizable_string = '';
foreach ($customizable_field_name as $key => $value) {
if (!$customizable_field_name[$key] || !$customizable_field_value[$key]) {
continue;
}
if ($customizable_string) {
$customizable_string .= '¤';
}
$customizable_string .= $customizable_field_name[$key] . '|' . $customizable_field_value[$key];
}
Gateway::updateConfig('CUSTOMIZABLE_FIELDS', $customizable_string);
}
// Lists of order status
$order_states = OrderState::getOrderStates((int) $this->context->cookie->id_lang);
// Lists of features
$features = Feature::getFeatures((int) $this->context->cookie->id_lang);
// Lists of attribute groups
$attribute_groups = AttributeGroup::getAttributesGroups((int) $this->context->cookie->id_lang);
$neteven_features = Db::getInstance()->ExecuteS('SELECT * FROM `' . _DB_PREFIX_ . 'orders_gateway_feature`');
$neteven_feature_categories = array();
foreach ($neteven_features as $neteven_feature) {
if (!isset($neteven_feature_categories[$neteven_feature['category']])) {
$neteven_feature_categories[$neteven_feature['category']] = array();
}
$neteven_feature_categories[$neteven_feature['category']][] = $neteven_feature;
}
if ($this->getSOAP()) {
$this->html .= $this->displayForm($order_states, $features, $attribute_groups, $neteven_feature_categories);
} else {
$this->html .= $this->displayError($this->l('This module requires the SOAP extension to run'));
}
return $this->html;
}
示例2: array_unique
}
if ($position != count($order_states) - 1) {
$temp = $order_states[$position];
$order_states[$position] = $order_states[$position + 1];
$order_states[$position + 1] = $temp;
}
}
$order_states = array_unique($order_states);
foreach ($order_states as $key => $id_state) {
if (empty($id_state) || !Db::getInstance()->getRow('SELECT `id_order_state`
FROM `' . _DB_PREFIX_ . 'order_state`
WHERE `id_order_state` = ' . (int) $id_state)) {
unset($order_states[$key]);
}
}
Gateway::updateConfig($field, implode(':', $order_states));
}
/* affichage des state en tableau. */
if (count($order_states) > 0) {
foreach ($order_states as $state) {
$state_infos = Db::getInstance()->getRow('SELECT `id_order_state`, `name`
FROM `' . _DB_PREFIX_ . 'order_state_lang`
WHERE `id_lang` = ' . (int) $cookie->id_lang . '
AND `id_order_state` = ' . (int) $state . '
');
if ($state_infos) {
$id_order_state = $state_infos['id_order_state'];
$order_state_name = $state_infos['name'];
echo '<li id="state_' . (int) $id_order_state . '" data="' . (int) $id_order_state . '" class="order_state_line">
<span class="delete_' . ($field == 'ORDER_STATE_BEFORE' ? 'before' : 'after') . '" style="cursor:pointer;">
<img src="../img/admin/disabled.gif" alt="X" />