本文整理汇总了PHP中Category::getSimpleCategories方法的典型用法代码示例。如果您正苦于以下问题:PHP Category::getSimpleCategories方法的具体用法?PHP Category::getSimpleCategories怎么用?PHP Category::getSimpleCategories使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Category
的用法示例。
在下文中一共展示了Category::getSimpleCategories方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderForm
public function renderForm()
{
if (!$this->object->id) {
$this->object->price = -1;
}
$this->fields_form = array('legend' => array('title' => $this->l('Catalog price rules'), 'icon' => 'icon-dollar'), 'input' => array(array('type' => 'text', 'label' => $this->l('Name'), 'name' => 'name', 'maxlength' => 32, 'required' => true, 'hint' => $this->l('Forbidden characters') . ' <>;=#{}'), array('type' => 'select', 'label' => $this->l('Shop'), 'name' => 'shop_id', 'options' => array('query' => Shop::getShops(), 'id' => 'id_shop', 'name' => 'name'), 'condition' => Shop::isFeatureActive(), 'default_value' => Shop::getContextShopID()), array('type' => 'select', 'label' => $this->l('Currency'), 'name' => 'id_currency', 'options' => array('query' => array_merge(array(0 => array('id_currency' => 0, 'name' => $this->l('All currencies'))), Currency::getCurrencies()), 'id' => 'id_currency', 'name' => 'name')), array('type' => 'select', 'label' => $this->l('Country'), 'name' => 'id_country', 'options' => array('query' => array_merge(array(0 => array('id_country' => 0, 'name' => $this->l('All countries'))), Country::getCountries((int) $this->context->language->id)), 'id' => 'id_country', 'name' => 'name')), array('type' => 'select', 'label' => $this->l('Group'), 'name' => 'id_group', 'options' => array('query' => array_merge(array(0 => array('id_group' => 0, 'name' => $this->l('All groups'))), Group::getGroups((int) $this->context->language->id)), 'id' => 'id_group', 'name' => 'name')), array('type' => 'text', 'label' => $this->l('From quantity'), 'name' => 'from_quantity', 'maxlength' => 10, 'required' => true), array('type' => 'text', 'label' => $this->l('Price (tax excl.)'), 'name' => 'price', 'disabled' => $this->object->price == -1 ? 1 : 0, 'maxlength' => 10, 'suffix' => $this->context->currency->getSign('right')), array('type' => 'checkbox', 'name' => 'leave_bprice', 'values' => array('query' => array(array('id' => 'on', 'name' => $this->l('Leave base price'), 'val' => '1', 'checked' => '1')), 'id' => 'id', 'name' => 'name')), array('type' => 'datetime', 'label' => $this->l('From'), 'name' => 'from'), array('type' => 'datetime', 'label' => $this->l('To'), 'name' => 'to'), array('type' => 'select', 'label' => $this->l('Reduction type'), 'name' => 'reduction_type', 'options' => array('query' => array(array('reduction_type' => 'amount', 'name' => $this->l('Amount')), array('reduction_type' => 'percentage', 'name' => $this->l('Percentage'))), 'id' => 'reduction_type', 'name' => 'name')), array('type' => 'select', 'label' => $this->l('Reduction with or without taxes'), 'name' => 'reduction_tax', 'align' => 'center', 'options' => array('query' => array(array('lab' => $this->l('Tax included'), 'val' => 1), array('lab' => $this->l('Tax excluded'), 'val' => 0)), 'id' => 'val', 'name' => 'lab')), array('type' => 'text', 'label' => $this->l('Reduction'), 'name' => 'reduction', 'required' => true)), 'submit' => array('title' => $this->l('Save')));
if (($value = $this->getFieldValue($this->object, 'price')) != -1) {
$price = number_format($value, 6);
} else {
$price = '';
}
$this->fields_value = array('price' => $price, 'from_quantity' => ($value = $this->getFieldValue($this->object, 'from_quantity')) ? $value : 1, 'reduction' => number_format(($value = $this->getFieldValue($this->object, 'reduction')) ? $value : 0, 6), 'leave_bprice_on' => $price ? 0 : 1);
$attribute_groups = array();
$attributes = Attribute::getAttributes((int) $this->context->language->id);
foreach ($attributes as $attribute) {
if (!isset($attribute_groups[$attribute['id_attribute_group']])) {
$attribute_groups[$attribute['id_attribute_group']] = array('id_attribute_group' => $attribute['id_attribute_group'], 'name' => $attribute['attribute_group']);
}
$attribute_groups[$attribute['id_attribute_group']]['attributes'][] = array('id_attribute' => $attribute['id_attribute'], 'name' => $attribute['name']);
}
$features = Feature::getFeatures((int) $this->context->language->id);
foreach ($features as &$feature) {
$feature['values'] = FeatureValue::getFeatureValuesWithLang((int) $this->context->language->id, $feature['id_feature'], true);
}
$this->tpl_form_vars = array('manufacturers' => Manufacturer::getManufacturers(), 'suppliers' => Supplier::getSuppliers(), 'attributes_group' => $attribute_groups, 'features' => $features, 'categories' => Category::getSimpleCategories((int) $this->context->language->id), 'conditions' => $this->object->getConditions(), 'is_multishop' => Shop::isFeatureActive());
return parent::renderForm();
}
示例2: install
public function install()
{
include_once dirname(__FILE__) . '/LoyaltyStateModule.php';
if (!parent::install() || !$this->installDB() || !$this->registerHook('extraRight') || !$this->registerHook('updateOrderStatus') || !$this->registerHook('newOrder') || !$this->registerHook('adminCustomers') || !$this->registerHook('shoppingCart') || !$this->registerHook('orderReturn') || !$this->registerHook('cancelProduct') || !$this->registerHook('customerAccount') || !Configuration::updateValue('PS_LOYALTY_POINT_VALUE', '0.20') || !Configuration::updateValue('PS_LOYALTY_MINIMAL', 0) || !Configuration::updateValue('PS_LOYALTY_POINT_RATE', '10') || !Configuration::updateValue('PS_LOYALTY_NONE_AWARD', '1')) {
return false;
}
$defaultTranslations = array('en' => 'Loyalty reward', 'fr' => 'Récompense fidélité');
$conf = array((int) Configuration::get('PS_LANG_DEFAULT') => $this->l('Loyalty reward'));
foreach (Language::getLanguages() as $language) {
if (isset($defaultTranslations[$language['iso_code']])) {
$conf[(int) $language['id_lang']] = $defaultTranslations[$language['iso_code']];
}
}
Configuration::updateValue('PS_LOYALTY_VOUCHER_DETAILS', $conf);
$category_config = '';
$categories = Category::getSimpleCategories((int) Configuration::get('PS_LANG_DEFAULT'));
foreach ($categories as $category) {
$category_config .= (int) $category['id_category'] . ',';
}
$category_config = rtrim($category_config, ',');
Configuration::updateValue('PS_LOYALTY_VOUCHER_CATEGORY', $category_config);
/* This hook is optional */
$this->registerHook('displayMyAccountBlock');
if (!LoyaltyStateModule::insertDefaultData()) {
return false;
}
return true;
}
示例3: regenerate_level_depth
function regenerate_level_depth()
{
$category = new Category();
$cats = $category->getSimpleCategories((int) Configuration::get('PS_LANG_DEFAULT'));
foreach ($cats as $cat) {
$category = new Category((int) $cat['id_category']);
$catParent = new Category((int) $category->id_parent);
$category->level_depth = $catParent->level_depth + 1;
Db::getInstance()->Execute('UPDATE `' . _DB_PREFIX_ . 'category` SET `level_depth` = ' . (int) $category->level_depth . ' WHERE `id_category` = ' . (int) $category->id);
}
Category::regenerateEntireNtree();
}
示例4: update_module_loyalty
function update_module_loyalty()
{
if (Configuration::get('PS_LOYALTY_POINT_VALUE') !== false) {
$category_list = '';
foreach (Category::getSimpleCategories(Configuration::get('PS_LANG_DEFAULT')) as $category) {
$category_list .= $category['id_category'] . ',';
}
if (!empty($category_list)) {
$category_list = rtrim($category_list, ',');
Configuration::updateValue('PS_LOYALTY_VOUCHER_CATEGORY', $category_list);
}
}
}
示例5: renderForm
public function renderForm()
{
if (!($obj = $this->loadObject(true))) {
return;
}
$products = Product::getProducts((int) $this->context->language->id, 0, 0, 'id_product', 'ASC');
foreach ($products as $product) {
$productList[] = array('key' => $product['id_product'], 'name' => '(' . $product['id_product'] . ') ' . $product['name']);
}
$categories = Category::getSimpleCategories((int) $this->context->language->id);
foreach ($categories as $category) {
$categoryList[] = array('key' => $category['id_category'], 'name' => '(' . $category['id_category'] . ') ' . $category['name']);
}
$cmss = CMS::listCms();
foreach ($cmss as $cms) {
$cmsList[] = array('key' => $cms['id_cms'], 'name' => '(' . $cms['id_cms'] . ') ' . $cms['meta_title']);
}
$this->fields_form = array('tinymce' => true, 'legend' => array('title' => $this->l('Slideshow'), 'image' => '../img/admin/cog.gif'), 'input' => array(array('type' => 'text', 'lang' => true, 'label' => $this->l('Name:'), 'name' => 'name', 'size' => 40), array('type' => 'text', 'label' => $this->l('Width:'), 'name' => 'width', 'size' => 10, 'desc' => $this->l('If you change the width of the it will be necessary to upload images again')), array('type' => 'text', 'label' => $this->l('Height:'), 'name' => 'height', 'size' => 10, 'desc' => $this->l('If you change the height of the it will be necessary to upload images again')), array('type' => 'select', 'label' => $this->l('Effect:'), 'name' => 'effect', 'cast' => 'strval', 'identifier' => 'mode', 'options' => array('query' => array(array('key' => 0, 'name' => $this->l('random')), array('key' => 1, 'name' => $this->l('swirl')), array('key' => 2, 'name' => $this->l('rain')), array('key' => 3, 'name' => $this->l('straight'))), 'name' => 'name', 'id' => 'key')), array('type' => 'text', 'label' => $this->l('Squares per width:'), 'name' => 'spw', 'size' => 10, 'desc' => $this->l('large number can cause transitions problems, Example: 7')), array('type' => 'text', 'label' => $this->l('Squares per height:'), 'name' => 'sph', 'size' => 10, 'desc' => $this->l('large number can cause transitions problems, Example: 5')), array('type' => 'text', 'label' => $this->l('Delay:'), 'name' => 'delay', 'size' => 10, 'desc' => $this->l('delay between images in ms, Example: 3000')), array('type' => 'text', 'label' => $this->l('Square delay:'), 'name' => 'sDelay', 'size' => 10, 'desc' => $this->l('delay beetwen squares in ms. Example: 30')), array('type' => 'text', 'label' => $this->l('Opacity:'), 'name' => 'opacity', 'size' => 10, 'desc' => $this->l('opacity of title and navigation. Example: 0.7')), array('type' => 'text', 'label' => $this->l('Title speed:'), 'name' => 'titleSpeed', 'size' => 10, 'desc' => $this->l('speed of title appereance in ms. Example: 500')), array('type' => 'select', 'label' => $this->l('Navigation:'), 'name' => 'navigation', 'cast' => 'strval', 'identifier' => 'mode', 'options' => array('query' => array(array('key' => 0, 'name' => $this->l('no')), array('key' => 1, 'name' => $this->l('yes'))), 'name' => 'name', 'id' => 'key')), array('type' => 'select', 'label' => $this->l('Links:'), 'name' => 'links', 'desc' => $this->l('Enable links.'), 'cast' => 'strval', 'identifier' => 'mode', 'options' => array('query' => array(array('key' => 0, 'name' => $this->l('no')), array('key' => 1, 'name' => $this->l('yes'))), 'name' => 'name', 'id' => 'key')), array('type' => 'select', 'label' => $this->l('Hover pause:'), 'name' => 'hoverpause', 'desc' => $this->l('pause on hover.'), 'cast' => 'strval', 'identifier' => 'mode', 'options' => array('query' => array(array('key' => 0, 'name' => $this->l('no')), array('key' => 1, 'name' => $this->l('yes'))), 'name' => 'name', 'id' => 'key')), array('type' => 'select', 'label' => $this->l('Show on home:'), 'name' => 'home', 'cast' => 'strval', 'identifier' => 'mode', 'options' => array('query' => array(array('key' => 0, 'name' => $this->l('no')), array('key' => 1, 'name' => $this->l('yes'))), 'name' => 'name', 'id' => 'key')), array('type' => 'select', 'label' => $this->l('Show on all category:'), 'name' => 'showOnCat', 'cast' => 'strval', 'identifier' => 'mode', 'options' => array('query' => array(array('key' => 0, 'name' => $this->l('no')), array('key' => 1, 'name' => $this->l('yes'))), 'name' => 'name', 'id' => 'key')), array('type' => 'select', 'label' => $this->l('Categories:'), 'name' => 'categories[]', 'id' => 'categories', 'options' => array('query' => $categoryList, 'name' => 'name', 'id' => 'key'), 'multiple' => true, 'desc' => $this->l('Choose one or several category s page where the slideshow will be displayed.')), array('type' => 'select', 'label' => $this->l('Show on all product:'), 'name' => 'showOnProd', 'cast' => 'strval', 'identifier' => 'mode', 'options' => array('query' => array(array('key' => 0, 'name' => $this->l('no')), array('key' => 1, 'name' => $this->l('yes'))), 'name' => 'name', 'id' => 'key')), array('type' => 'select', 'label' => $this->l('Products:'), 'name' => 'products[]', 'id' => 'products', 'options' => array('query' => $productList, 'name' => 'name', 'id' => 'key'), 'multiple' => true, 'desc' => $this->l('Choose one or several product s page where the slideshow will be displayed.')), array('type' => 'select', 'label' => $this->l('Show on all cms page:'), 'name' => 'showOnCms', 'cast' => 'strval', 'identifier' => 'mode', 'options' => array('query' => array(array('key' => 0, 'name' => $this->l('no')), array('key' => 1, 'name' => $this->l('yes'))), 'name' => 'name', 'id' => 'key')), array('type' => 'select', 'label' => $this->l('Cms:'), 'name' => 'cms[]', 'id' => 'cms', 'options' => array('query' => $cmsList, 'name' => 'name', 'id' => 'key'), 'multiple' => true, 'desc' => $this->l('Choose one or several cms s page where the slideshow will be displayed.')), array('type' => 'select', 'label' => $this->l('Hook:'), 'name' => 'hook', 'cast' => 'strval', 'identifier' => 'mode', 'options' => array('query' => array(array('name' => 'displayTop'), array('name' => 'displayHome'), array('name' => 'displayLeftColumn'), array('name' => 'displayRightColumn'), array('name' => 'displayOpartSlideshowHook')), 'name' => 'name', 'id' => 'name'), 'desc' => $this->l('You must hook the module for display your slideshow on each position. Go to modules/positions menu for setup this')), array('type' => 'select', 'label' => $this->l('Statut:'), 'name' => 'active', 'cast' => 'strval', 'identifier' => 'mode', 'options' => array('query' => array(array('key' => 0, 'name' => $this->l('disable')), array('key' => 1, 'name' => $this->l('enable'))), 'name' => 'name', 'id' => 'key'))), 'submit' => array('title' => $this->l('Save'), 'class' => 'button'));
if (is_numeric($obj->id)) {
//products value
$sql = 'SELECT id_product FROM ' . _DB_PREFIX_ . 'opartslideshow_slideshow_product WHERE id_opartslideshow_slideshow = ' . $obj->id;
$array = Db::getInstance()->executeS($sql);
if (count($array)) {
foreach ($array as $row) {
$productValues[] = $row['id_product'];
}
$this->fields_value['products[]'] = $productValues;
}
//categories value
$sql = 'SELECT id_category FROM ' . _DB_PREFIX_ . 'opartslideshow_slideshow_category WHERE id_opartslideshow_slideshow = ' . $obj->id;
$array = Db::getInstance()->executeS($sql);
if (count($array)) {
foreach ($array as $row) {
$categoriesValues[] = $row['id_category'];
}
$this->fields_value['categories[]'] = $categoriesValues;
}
//cms value
$sql = 'SELECT id_cms FROM ' . _DB_PREFIX_ . 'opartslideshow_slideshow_cms WHERE id_opartslideshow_slideshow = ' . $obj->id;
$array = Db::getInstance()->executeS($sql);
if (count($array)) {
foreach ($array as $row) {
$cmsValues[] = $row['id_cms'];
}
$this->fields_value['cms[]'] = $cmsValues;
}
}
$html = $header = $this->context->smarty->fetch(parent::getTemplatePath() . 'header.tpl');
$html .= parent::renderForm();
return $html;
}
开发者ID:AmineBENCHEIKHBRAHIM,项目名称:LnsTech-Prestashop-WebSite,代码行数:51,代码来源:AdminSlideshowController.php
示例6: __construct
public function __construct()
{
$this->name = 'topshop';
$this->tab = 'smart_shopping';
$this->version = '1.7.7';
$this->author = 'Roman Prokofyev';
$this->need_instance = 1;
$this->display = 'view';
$this->bootstrap = true;
//$this->ps_versions_compliancy = array('min' => '1.5.0.0', 'max' => '1.6');
$this->module_key = '2149d8638f786d69c1a762f1fbfb8124';
$this->custom_attributes = array('YAMARKET_COMPANY_NAME', 'YAMARKET_DELIVERY_PRICE', 'YAMARKET_SALES_NOTES', 'YAMARKET_COUNTRY_OF_ORIGIN', 'YAMARKET_EXPORT_TYPE', 'YAMARKET_MODEL_NAME', 'YAMARKET_DESC_TYPE', 'YAMARKET_DELIVERY_DELIVERY', 'YAMARKET_DELIVERY_PICKUP', 'YAMARKET_DELIVERY_STORE');
$this->country_of_origin_attr = Configuration::get('YAMARKET_COUNTRY_OF_ORIGIN');
$this->model_name_attr = Configuration::get('YAMARKET_MODEL_NAME');
parent::__construct();
$this->displayName = $this->l('Yandex Market');
if ($this->id && !Configuration::get('YAMARKET_COMPANY_NAME')) {
$this->warning = $this->l('You have not yet set your Company Name');
}
$this->description = $this->l('Provides price list export to Yandex Market');
$this->confirmUninstall = $this->l('Are you sure you want to delete your details ?');
// Variables fro price list
$this->id_lang = (int) Configuration::get('PS_LANG_DEFAULT');
$this->proto_prefix = _PS_BASE_URL_;
// Get groups
$attribute_groups = AttributeGroup::getAttributesGroups($this->id_lang);
$this->attibute_groups = array();
foreach ($attribute_groups as $group) {
$this->attibute_groups[$group['id_attribute_group']] = $group['public_name'];
}
// Get categories
$this->excluded_cats = explode(',', Configuration::get('TOPSHOP_EXCLUDED_CATS'));
if (!$this->excluded_cats) {
$this->excluded_cats = array();
}
$all_cats = Category::getSimpleCategories($this->id_lang);
$this->selected_cats = array();
$this->all_cats = array();
foreach ($all_cats as $cat) {
$this->all_cats[] = $cat['id_category'];
if (!in_array($cat['id_category'], $this->excluded_cats)) {
$this->selected_cats[] = $cat['id_category'];
}
}
//determine image type
$this->image_type = 'large_default';
if (Tools::substr(_PS_VERSION_, 0, 5) == '1.5.0') {
$this->image_type = 'large';
}
}
示例7: renderForm
public function renderForm()
{
$id_lang = (int) Context::getContext()->language->id;
$categories = Category::getSimpleCategories($id_lang);
$array_day = $voucher_type = $array_hour = array();
for ($i = 1; $i < 32; $i++) {
$array_day[] = array('id_day' => $i, 'name' => $i . ' Days');
}
for ($i = 1; $i < 25; $i++) {
$array_hour[] = array('id_hour' => $i, 'name' => $i . ' Hours');
}
$voucher_type[] = array('voucher_type' => 'fixe', 'name' => 'Fixed');
$voucher_type[] = array('voucher_type' => 'percent', 'name' => 'Percent');
$this->fields_form = array('legend' => array('title' => $this->l('Create new campaign')), 'input' => array(array('type' => 'text', 'label' => $this->l('Campaign name : '), 'name' => 'name', 'required' => true, 'class' => 't', 'desc' => 'Also mail subject'), array('type' => 'select', 'label' => $this->l('After how many day(s) send campaign ? : '), 'name' => 'execution_time_day', 'required' => true, 'class' => 't', 'options' => array('query' => $array_day, 'id' => 'id_day', 'name' => 'name')), array('type' => 'select', 'label' => $this->l('After how many hour(s) send campaign ? : '), 'name' => 'execution_time_hour', 'required' => true, 'class' => 't', 'options' => array('query' => $array_hour, 'id' => 'id_hour', 'name' => 'name')), array('type' => 'textarea', 'label' => $this->l('Mail Template : '), 'name' => 'email_tpl', 'size' => 60, 'rows' => 10, 'cols' => 62, 'class' => 'rte', 'autoload_rte' => true, 'required' => true, 'desc' => $this->l('Available variables : {firstname} , {lastname} , {coupon_name} , {coupon_code} , {coupon_value} , {coupon_valid_to} , {campaign_name}, {cart_content} , {track_url} , {track_request}')), array('type' => 'radio', 'label' => $this->l('Include voucher'), 'name' => 'include_voucher', 'class' => 't include_voucher', 'is_bool' => true, 'values' => array(array('id' => 'include_voucher_enable', 'value' => 1, 'checked' => 'checked', 'label' => $this->l('Enabled')), array('id' => 'include_voucher_disable', 'value' => 0, 'label' => $this->l('Disabled')))), array('type' => 'text', 'label' => $this->l('Voucher prefix : '), 'name' => 'voucher_prefix', 'size' => 60, 'class' => 'voucher_mode', 'desc' => $this->l('Prefix for the voucher create')), array('type' => 'select', 'label' => $this->l('Voucher percent or fixed : '), 'name' => 'voucher_amount_type', 'desc' => $this->l('Is an percentage or fixe voucher?'), 'class' => 'voucher_mode', 'options' => array('query' => $voucher_type, 'id' => 'voucher_type', 'name' => 'name')), array('type' => 'text', 'label' => $this->l('Voucher value : '), 'name' => 'voucher_amount', 'class' => 'voucher_mode', 'size' => 60, 'desc' => $this->l('Voucher value ?')), array('type' => 'text', 'label' => $this->l('Voucher valid in day :'), 'name' => 'voucher_day', 'size' => 60, 'class' => 'voucher_mode', 'desc' => $this->l('How many days voucher will be valid? ')), array('type' => 'radio', 'label' => $this->l('Status'), 'name' => 'active', 'class' => 't', 'is_bool' => true, 'values' => array(array('id' => 'active', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'active', 'value' => 0, 'label' => $this->l('Disabled'))))), 'submit' => array('title' => $this->l('Save'), 'class' => 'button'));
if (Shop::isFeatureActive()) {
$this->fields_form['input'][] = array('type' => 'shop', 'label' => $this->l('Shop association:'), 'name' => 'checkBoxShopAsso');
}
if (!($BlogCategory = $this->loadObject(true))) {
return;
}
$this->fields_form['submit'] = array('title' => $this->l('Save '), 'class' => 'button');
//update way :
$extra = '';
if ($id_campaign = Tools::getValue('id_campaign')) {
$campaign = new Campaign($id_campaign);
// If no voucher disable voucher display only
if ($campaign->voucher_prefix == '') {
$extra = '<script> $( function()
{
$("#include_voucher_disable").attr("checked","checked");
$(".voucher_mode").parent().parent(".form-group").fadeOut();
} ); </script>';
}
}
return $extra . parent::renderForm();
}
示例8: dirname
}
include dirname(__FILE__) . '/../../header.php';
$orders = LoyaltyModule::getAllByIdCustomer((int) $cookie->id_customer, (int) $cookie->id_lang);
$displayorders = LoyaltyModule::getAllByIdCustomer((int) $cookie->id_customer, (int) $cookie->id_lang, false, true, (int) Tools::getValue('n') > 0 ? (int) Tools::getValue('n') : 10, (int) Tools::getValue('p') > 0 ? (int) Tools::getValue('p') : 1);
$smarty->assign(array('orders' => $orders, 'displayorders' => $displayorders, 'pagination_link' => __PS_BASE_URI__ . 'modules/loyalty/loyalty-program.php', 'totalPoints' => (int) $customerPoints, 'voucher' => LoyaltyModule::getVoucherValue($customerPoints, (int) $context->currency->id), 'validation_id' => LoyaltyStateModule::getValidationId(), 'transformation_allowed' => $customerPoints > 0, 'page' => (int) Tools::getValue('p') > 0 ? (int) Tools::getValue('p') : 1, 'nbpagination' => (int) (Tools::getValue('n') > 0) ? (int) Tools::getValue('n') : 10, 'nArray' => array(10, 20, 50), 'max_page' => floor(sizeof($orders) / ((int) (Tools::getValue('n') > 0) ? (int) Tools::getValue('n') : 10))));
/* Discounts */
$nbDiscounts = 0;
$discounts = array();
if ($ids_discount = LoyaltyModule::getDiscountByIdCustomer((int) $cookie->id_customer)) {
$nbDiscounts = count($ids_discount);
foreach ($ids_discount as $key => $discount) {
$discounts[$key] = new Discount((int) $discount['id_cart_rule'], (int) $cookie->id_lang);
$discounts[$key]->orders = LoyaltyModule::getOrdersByIdDiscount((int) $discount['id_cart_rule']);
}
}
$allCategories = Category::getSimpleCategories((int) $cookie->id_lang);
$voucherCategories = Configuration::get('PS_LOYALTY_VOUCHER_CATEGORY');
if ($voucherCategories != '' and $voucherCategories != 0) {
$voucherCategories = explode(',', Configuration::get('PS_LOYALTY_VOUCHER_CATEGORY'));
} else {
die(Tools::displayError());
}
if (sizeof($voucherCategories) == sizeof($allCategories)) {
$categoriesNames = null;
} else {
$categoriesNames = array();
foreach ($allCategories as $k => $allCategory) {
if (in_array($allCategory['id_category'], $voucherCategories)) {
$categoriesNames[$allCategory['id_category']] = trim($allCategory['name']);
}
}
示例9: getContent
public function getContent()
{
if (isset($_POST['submitSettings'])) {
$this->_postProcess();
}
$id_lang = Configuration::get('PS_LANG_DEFAULT');
$categories = Category::getSimpleCategories($id_lang);
$carriers = Carrier::getCarriers($id_lang);
$this->_html .= '
<fieldset><legend>FIA-NET - Système d\'Analyse des Commandes</legend>
<img src="../modules/' . $this->name . '/logo.jpg" style="float:right;margin:5px 10px 5px 0" />
FIA-NET, le leader français de la lutte contre la fraude à la carte bancaire sur internet !<br /><br />
Avec son réseau mutualisé de plus de 1 700 sites marchands, et sa base de données de 14 millions de cyber-acheteurs, le Système d’Analyse des Commandes vous offre une protection complète et unique contre le risque d’impayé.<br /><br />
Le logiciel expert (SAC) score vos transactions en quasi temps réel à partir de plus de 200 critères pour valider plus de 92 % de vos transactions.<br />
Le contrôle humain, prenant en charge les transactions les plus risqués, associé à l’assurance FIA-NET vous permet de valider et garantir jusqu’à 100 % de vos transactions.<br /><br />
Ne restez pas isolé face à l’explosion des réseaux de fraudeurs !
<p>' . $this->l('To sign in, check out: ') . ' <u><a href="https://www.fia-net.com/marchands/devispartenaire.php?p=185" target="_blank">' . $this->l('Fia-net Website') . '</a></u></p>
</fieldset><br />
<form action="' . Tools::htmlentitiesUTF8($_SERVER['REQUEST_URI']) . '" method="post">
<fieldset>
<legend><img src="' . $this->_path . 'logo.gif" alt="" title="" />' . $this->l('Settings') . '</legend>
<label>' . $this->l('Login') . '</label>
<div class="margin-form">
<input type="text" name="fianetfraud_login" value="' . Configuration::get('SAC_LOGIN') . '"/>
</div>
<label>' . $this->l('Password') . '</label>
<div class="margin-form">
<input type="text" name="fianetfraud_password" value="' . Configuration::get('SAC_PASSWORD') . '"/>
</div>
<label>' . $this->l('Site ID') . '</label>
<div class="margin-form">
<input type="text" name="fianetfraud_siteid" value="' . Configuration::get('SAC_SITEID') . '"/>
</div>
<label>' . $this->l('Production mode') . '</label>
<div class="margin-form">
<input type="checkbox" name="fianetfraud_production" id="activated_on" value="1" ' . (Configuration::get('SAC_PRODUCTION') == 1 ? 'checked="checked" ' : '') . '/>
</div>
<label>' . $this->l('Default Product Type') . '</label>
<div class="margin-form">
<select name="fianetfraud_product_type">
<option value="0">' . $this->l('-- Choose --') . '</option>';
foreach ($this->_product_type as $k => $product_type) {
$this->_html .= '<option value="' . $k . '"' . (Configuration::get('SAC_DEFAULT_PRODUCT_TYPE') == $k ? ' selected="selected"' : '') . '>' . $product_type . '</option>';
}
$this->_html .= '</select>
</div>
</fieldset><br />
<fieldset><legend><img src="' . $this->_path . 'logo.gif" alt="" title="" />' . $this->l('Category Detail') . '</legend>
<label>' . $this->l('Category Detail') . '</label>
<div class="margin-form">
<table cellspacing="0" cellpadding="0" class="table">
<thead><tr><th>' . $this->l('Category') . '</th><th>' . $this->l('Category Type') . '</th></tr></thead><tbody>';
foreach ($categories as $category) {
$this->_html .= '<tr><td>' . $category['name'] . '</td><td>
<select name="cat_' . $category['id_category'] . '" id="cat_' . $category['id_category'] . '">
<option value="0">' . $this->l('Choose a category...') . '</option>';
foreach ($this->_product_type as $id => $cat) {
$this->_html .= '<option value="' . $id . '" ' . (Configuration::get('SAC_CATEGORY_TYPE_' . $category['id_category']) == $id ? ' selected="true"' : '') . '>' . $cat . '</option>';
}
$this->_html .= '</select></td></tr>';
}
$this->_html .= '</tbody></table></div>
</fieldset>
<div class="clear"> </div>
<fieldset><legend><img src="' . $this->_path . 'logo.gif" alt="" title="" />' . $this->l('Carrier Configuration') . '</legend>
<label>' . $this->l('Carrier Detail') . '</label>
<div class="margin-form">
<table cellspacing="0" cellpadding="0" class="table">
<thead><tr><th>' . $this->l('Carrier') . '</th><th>' . $this->l('Carrier Type') . '</th></tr></thead><tbody>';
foreach ($carriers as $carrier) {
$this->_html .= '<tr><td>' . $carrier['name'] . '</td><td><select name="carrier_' . $carrier['id_carrier'] . '" id="cat_' . $carrier['id_carrier'] . '">
<option value="0">' . $this->l('Choose a carrier type...') . '</option>';
foreach ($this->_carrier_type as $id => $type) {
$this->_html .= '<option value="' . $id . '"' . (Configuration::get('SAC_CARRIER_TYPE_' . $carrier['id_carrier']) == $id ? ' selected="true"' : '') . '>' . $type . '</option>';
}
$this->_html .= '</select></td>';
}
$this->_html .= '</tbody></table></margin>
</div>
<div class="clear"> </div>
<label>' . $this->l('Default Carrier Type') . '</label>
<div class="margin-form">
<select name="fianetfraud_default_carrier">';
foreach ($this->_carrier_type as $k => $type) {
$this->_html .= '<option value="' . $k . '"' . ($k == Configuration::get('SAC_DEFAULT_CARRIER_TYPE') ? ' selected' : '') . '>' . $type . '</option>';
}
$this->_html .= '</select>
</div>
</fieldset><div class="clear"> </div>';
/* Get all modules then select only payment ones*/
$modules = Module::getModulesOnDisk();
$modules_is_fianet = explode(',', Configuration::get('SAC_PAYMENT_MODULE'));
$this->paymentModules = array();
foreach ($modules as $module) {
if (method_exists($module, 'hookPayment')) {
if ($module->id) {
$module->country = array();
$countries = DB::getInstance()->ExecuteS('SELECT id_country FROM ' . _DB_PREFIX_ . 'module_country WHERE id_module = ' . (int) $module->id);
foreach ($countries as $country) {
$module->country[] = $country['id_country'];
//.........这里部分代码省略.........
示例10: getContent
public function getContent()
{
global $cookie;
$html = '<h2>' . $this->displayName . '</h2>';
if (isset($_POST['submit_settings'])) {
if ((int) Tools::getValue('product_id') == (int) Tools::getValue('product_share_id')) {
$html .= $this->displayError($this->l('Product and share product are the same.'));
} else {
$res = self::getShareProductRules((int) Tools::getValue('product_id'));
if ($res) {
$res = self::updateShareProductRules(Tools::getValue('product_id'), Tools::getValue('product_share_id'), Tools::getValue('share_days'), Tools::getvalue('SHAREZBLOCK_SEP'), Tools::getvalue('SHAREZBLOCK_PROP'), Tools::getvalue('SHAREZBLOCK_PRICE'), Tools::getvalue('SHAREZBLOCK_DESCR'));
$html .= $res ? $this->displayConfirmation($this->l('Settings updated.')) : $this->displayError($this->l('Settings not updated.'));
} else {
$html .= $this->displayError($this->l('Supplement products are not set.'));
}
}
}
if (Tools::isSubmit('submit_bind')) {
if ((int) Tools::getValue('product_id') == (int) Tools::getValue('product_share_id')) {
$html .= $this->displayError($this->l('Product and share product are the same.'));
} else {
$res = self::getShareProductRules((int) Tools::getValue('product_id'));
if ($res) {
$res = self::updateShareProductRules((int) Tools::getValue('product_id'), (int) Tools::getValue('product_share_id'), (int) Tools::getValue('share_days'));
} else {
$res = self::bindProducts((int) Tools::getValue('product_id'), (int) Tools::getValue('product_share_id'), (int) Tools::getValue('share_days'));
}
}
$html .= $res ? $this->displayConfirmation($this->l('Settings updated.')) : $this->displayError($this->l('Settings not updated.'));
} elseif (Tools::isSubmit('submit_unbind')) {
$sql = 'DELETE FROM `' . _DB_PREFIX_ . 'share_product` WHERE id_product=' . (int) Tools::getValue('product_id') . ' AND id_share_product=' . (int) Tools::getValue('product_share_id');
$res = Db::getInstance()->Execute($sql);
$html .= $res ? $this->displayConfirmation($this->l('Settings updated.')) : $this->displayError($this->l('Settings not updated.'));
}
if (Tools::isSubmit('products_cat') || Tools::isSubmit('products_share_cat')) {
$product_cats = Product::getProducts((int) $cookie->id_lang, null, null, 'name', 'ASC', (int) Tools::getValue('products_cat'));
$product_share_cats = Product::getProducts((int) $cookie->id_lang, null, null, 'name', 'ASC', (int) Tools::getValue('products_share_cat'));
} else {
$product_cats = array(0 => array('id_product' => 0, 'name' => $this->l('No products in this category')));
$product_share_cats = array(0 => array('id_product' => 0, 'name' => $this->l('No products in this category')));
}
$html .= '
<script type="text/javascript">
// <![CDATA[
var sep_chk=false;
var price_chk=false;
function handleProductSelection(id_product)
{
$.ajax({
url: "' . $this->_path . 'controllers/admin/settings.php",
cache: false,
data: "select_field=1&id_product="+id_product,
success: function(html){
var a = html.split("_");
$("#product_share_id option[value="+a[0]+"]").attr("selected", "selected");
$("#product_share_id option[value!="+a[0]+"]").removeAttr("selected");
$("#share_days").val(a[1]);
$("#date").html(a[2]);
$("#SHAREZBLOCK_PROP").val(a[4]);
$("#SHAREZBLOCK_SEP").attr("checked", (parseInt(a[3])==1?"checked":""));
$("#SHAREZBLOCK_PRICE").val(a[5]);
$("#SHAREZBLOCK_PRICE_STAT").attr("checked", (parseFloat(a[5])>0?"checked":""));
$("#SHAREZBLOCK_DESCR").attr("checked", (parseInt(a[6])==1?"checked":""));
}
});
}
//]]>
</script>
<div>
<fieldset style="width: 868px">
<legend><img src="' . $this->_path . 'logo.gif" alt="" title="" />' . $this->l('Supplement products') . '</legend>
<form action="' . $_SERVER['REQUEST_URI'] . '" method="post" name="fm_submit">
<b>' . $this->l('Days number of the special offer:') . '</b>
<input type="text" id="share_days" name="share_days" value="' . (Tools::getValue('share_days') ? Tools::getValue('share_days') : 14) . '" size="3">
<span style="color:#7F7F7F; font-size:0.85em; font-weight: bold">(' . $this->l('start at:') . ' <span id="date"></span>)</span><br/><br/>
<b>' . $this->l('Select product from left column and bind it with special offer product from right column by clicking to the Bind button. The same should be done to unbind.') . '</b><br/><br/>
<div style="float: left;">
' . $this->l('Product category:') . '
<select name="products_cat" onchange="document.forms.fm_submit.submit()">';
$cats = Category::getSimpleCategories((int) $cookie->id_lang);
foreach ($cats as $k => $c) {
$html .= '<option value="' . $c['id_category'] . '" ' . (Tools::getValue('products_cat') == $c['id_category'] ? 'selected="selected"' : '') . '>' . $c['name'] . '</option>';
}
$html .= '
</select>
<br/><br/>
' . $this->l('Products') . '<br/>
<select name="product_id" size="30">';
foreach ($product_cats as $k => $p) {
$html .= '<option value="' . $p['id_product'] . '" onclick="handleProductSelection(\'' . $p['id_product'] . '\')">' . Tools::truncate($p['name'], 63) . '</option>';
}
$html .= '
</select>
</div>
<div style="float: left; margin-left: 10px">
' . $this->l('Special offer product category:') . '
<select name="products_share_cat" onchange="document.forms.fm_submit.submit()">';
//.........这里部分代码省略.........
示例11: displayForm
public function displayForm($isMainTab = true)
{
global $currentIndex, $cookie;
parent::displayForm();
if (!($obj = $this->loadObject(true))) {
return;
}
$groupReductions = $obj->id ? GroupReduction::getGroupReductions($obj->id, (int) $cookie->id_lang) : array();
$categories = Category::getSimpleCategories((int) $cookie->id_lang);
echo '
<form action="' . $currentIndex . '&submitAdd' . $this->table . '=1&token=' . $this->token . '" method="post">
' . ($obj->id ? '<input type="hidden" name="id_' . $this->table . '" value="' . $obj->id . '" />' : '') . '
<fieldset class="width3"><legend><img src="../img/admin/tab-groups.gif" alt="" />' . $this->l('Customer group') . '</legend>
<label>' . $this->l('Name:') . ' </label>
<div class="margin-form">';
foreach ($this->_languages as $language) {
echo '
<div id="name_' . $language['id_lang'] . '" style="display: ' . ($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none') . '; float: left;">
<input size="33" type="text" name="name_' . $language['id_lang'] . '" value="' . htmlentities($this->getFieldValue($obj, 'name', (int) $language['id_lang']), ENT_COMPAT, 'UTF-8') . '" /><sup> *</sup>
<span class="hint" name="help_box">' . $this->l('Invalid characters:') . ' 0-9!<>,;?=+()@#"�{}_$%:<span class="hint-pointer"> </span></span>
</div>';
}
$this->displayFlags($this->_languages, $this->_defaultFormLanguage, 'name', 'name');
$reduction = htmlentities($this->getFieldValue($obj, 'reduction'), ENT_COMPAT, 'UTF-8');
echo '
</div>
<div class="clear"> </div>
<label>' . $this->l('Discount:') . ' </label>
<div class="margin-form">
<input type="text" size="5" name="reduction" value="' . ($reduction ? $reduction : '0') . '" /> ' . $this->l('%') . '
<p>' . $this->l('Will automatically apply this value as a discount on ALL shop\'s products for this group\'s members.') . '</p>
</div>';
if ($obj->id) {
echo '
<label>' . $this->l('Current category discount:') . '</label>
<div class="margin-form">';
if ($groupReductions) {
echo '<table>
<tr>
<th>' . $this->l('Category') . '</th>
<th>' . $this->l('Value') . '</th>
<th>' . $this->l('Action') . '</th>
</tr>';
foreach ($groupReductions as $groupReduction) {
echo '
<tr>
<td>' . Tools::htmlentitiesUTF8($groupReduction['category_name']) . '</td>
<td><input type="hidden" name="gr_id_group_reduction[]" value="' . (int) $groupReduction['id_group_reduction'] . '" /><input type="text" name="gr_reduction[]" value="' . $groupReduction['reduction'] * 100 . '" /></td>
<td><a href="' . $currentIndex . '&deleteGroupReduction&id_group_reduction=' . (int) $groupReduction['id_group_reduction'] . '&id_group=' . (int) $obj->id . '&token=' . $this->token . '"><img src="" alt="' . $this->l('Delete') . '" /></a></td>
</tr>';
}
echo '</table>';
} else {
echo $this->l('No discount');
}
echo ' </div>';
}
echo '
<label>' . $this->l('Price display method:') . ' </label>
<div class="margin-form">
<select name="price_display_method">
<option value="' . PS_TAX_EXC . '"' . ((int) $this->getFieldValue($obj, 'price_display_method') == PS_TAX_EXC ? ' selected="selected"' : '') . '>' . $this->l('Tax excluded') . '</option>
<option value="' . PS_TAX_INC . '"' . ((int) $this->getFieldValue($obj, 'price_display_method') == PS_TAX_INC ? ' selected="selected"' : '') . '>' . $this->l('Tax included') . '</option>
</select>
<p>' . $this->l('How the prices are displayed on order summary for this customer group (tax included or excluded).') . '</p>
</div>
<div class="clear"> </div>
<div class="margin-form">
<input type="submit" value="' . $this->l(' Save ') . '" name="submitAdd' . $this->table . '" class="button" />
</div>
<div class="small"><sup>*</sup> ' . $this->l('Required field') . '</div>
</fieldset>
</form><br />';
if ($obj->id) {
echo '
<form action="' . $currentIndex . '&update' . $this->table . '&id_group=' . $obj->id . '&token=' . $this->token . '" method="post" class="width3">
<input type="hidden" name="id_' . $this->table . '" value="' . $obj->id . '" />
<fieldset><legend><img src="../img/admin/tab-groups.gif" />' . $this->l('New group discount') . '</legend>
<label>' . $this->l('Category:') . ' </label>
<div class="margin-form">
<select name="id_category">';
foreach ($categories as $category) {
echo ' <option value="' . (int) $category['id_category'] . '">' . Tools::htmlentitiesUTF8($category['name']) . '</option>';
}
echo ' </select><sup>*</sup>
<p>' . $this->l('Only products that have this category as default category will be affected') . '.</p>
</div>
<label>' . $this->l('Discount (in %):') . ' </label>
<div class="margin-form">
<input type="text" name="reductionByCategory" value="" /><sup>*</sup>
</div>
<div class="clear"> </div>
<div class="margin-form">
<input type="submit" value="' . $this->l(' Add ') . '" name="submitAddGroupReduction" class="button" />
</div>
<div class="small"><sup>*</sup> ' . $this->l('Required field') . '</div>
</fieldset>
</form>';
}
}
示例12: loadProductCategories
/**
* Load shop product categories
*
* @return type
*/
private function loadProductCategories()
{
$categories = Category::getSimpleCategories($this->context->language->id);
$shop_categories = array();
foreach ($categories as $category) {
$kwixo_type = Tools::isSubmit('kwixo_' . $category['id_category'] . '_product_type') ? Tools::getValue('kwixo_' . $category['id_category'] . '_product_type') : Configuration::get('KWIXO_PRODUCT_TYPE_' . $category['id_category'] . '');
$kwixo_delivery = Tools::isSubmit('kwixo_' . $category['id_category'] . '_product_type_delivery') ? Tools::getValue('kwixo_' . $category['id_category'] . '_product_type_delivery') : Configuration::get('KWIXO_PRODUCT_TYPE_DELIVERY_' . $category['id_category'] . '');
$shop_categories[$category['id_category']] = array('name' => $category['name'], 'kwixo_type' => $kwixo_type, 'kwixo_delivery' => $kwixo_delivery);
}
return $shop_categories;
}
示例13: _displayForm
//.........这里部分代码省略.........
$parentCmsCategory = new CMSCategory((int) $parentTemp->id_cms_category, $this->context->cookie->id_lang);
$this->_html .= '<option value="' . $parentTemp->id . '">' . $parentTemp->id . ' - ' . $parentCmsCategory->name . '</option>';
} elseif ($parentTemp->id_product != 0) {
$parentProduct = new Product((int) $parentTemp->id_product, false, $this->context->cookie->id_lang);
$this->_html .= '<option value="' . $parentTemp->id . '">' . $parentTemp->id . ' - ' . $parentProduct->name . '</option>';
} else {
$this->_html .= '<option value="' . $parentTemp->id . '">' . $parentTemp->id . ' - ' . $parentTemp->title . '</option>';
}
}
$this->_html .= '
</select>
<p class="clear">' . $this->l('Choose a parent link for your link and a dropdown will appear in the nav bar for the parent') . '.</p>
</div>
</div>
</div>';
// category ou non
$this->_html .= '
<div class="step-3">
<h3 class="' . (isset($responsiveLink) ? 'hidden' : '') . '">' . $this->l('Step 3 : Choose your link type') . '.</h3>
<div class="option ' . (isset($responsiveLink) ? 'hidden' : '') . '">
<label for="iscategory">' . $this->l('Is a category link?') . '</label>
<div class="margin-form">
<input type="radio" name="iscategory" class="link-choice" value="1" ' . (isset($category) ? 'checked="checked"' : '') . '>
<label class="t"> <img src="../img/admin/enabled.gif" alt="' . $this->l('Yes') . '" title="' . $this->l('Yes') . '"></label>
<input type="radio" name="iscategory" class="link-choice" value="0" ' . (isset($category) ? '' : 'checked="checked"') . '>
<label class="t"> <img src="../img/admin/disabled.gif" alt="' . $this->l('No') . '" title="' . $this->l('No') . '"></label>
</div>
</div>
<div class="option-block ' . (isset($category) ? 'active' : '') . '">
<label for="category">' . $this->l('Choose your category page :') . '</label>
<div class="margin-form">
<select name="category" id="category" size="5">';
foreach (Category::getSimpleCategories($this->context->cookie->id_lang) as $categoryTemp) {
$this->_html .= '
<option value="' . $categoryTemp['id_category'] . '" ' . (isset($category) && $category->id == $categoryTemp['id_category'] ? 'selected="selected"' : '') . '>' . $categoryTemp['name'] . '</option>';
}
$this->_html .= '
</select>
</div>
</div>';
// cms ou non
$this->_html .= '
<div class="option ' . (isset($responsiveLink) ? 'hidden' : '') . '">
<label for="iscms">' . $this->l('Is a CMS link?') . '</label>
<div class="margin-form">
<input type="radio" name="iscms" class="link-choice" value="1" ' . (isset($cms) ? 'checked="checked"' : '') . '>
<label class="t"> <img src="../img/admin/enabled.gif" alt="' . $this->l('Yes') . '" title="' . $this->l('Yes') . '"></label>
<input type="radio" name="iscms" class="link-choice" value="0" ' . (isset($cms) ? '' : 'checked="checked"') . '>
<label class="t"> <img src="../img/admin/disabled.gif" alt="' . $this->l('No') . '" title="' . $this->l('No') . '"></label>
</div>
</div>
<div class="option-block ' . (isset($cms) ? 'active' : '') . '">
<label for="cms">' . $this->l('Choose your CMS page :') . '</label>
<div class="margin-form">
<select name="cms" id="cms" size="5">';
foreach (CMS::listCms($this->context->cookie->id_lang) as $cmsTemp) {
$this->_html .= '
<option value="' . $cmsTemp['id_cms'] . '" ' . (isset($cms) && $cms->id == $cmsTemp['id_cms'] ? 'selected="selected"' : '') . '>' . $cmsTemp['meta_title'] . '</option>';
}
$this->_html .= '
</select>
</div>
</div>';
// cms category or not
示例14: loadProductCategories
/**
* returns the product categories list as an array indexed by category_id and containing the category name and the corresponding fia-net product family
*
* @return array
*/
private function loadProductCategories()
{
$categories = Category::getSimpleCategories($this->context->language->id);
if (_PS_VERSION_ < '1.5') {
$id_shop = 1;
} else {
$id_shop = Context::getContext()->shop->id;
}
$shop_categories = array();
foreach ($categories as $category) {
$fianetsceau_type = Tools::isSubmit('fianetsceau_' . $category['id_category'] . '_subcategory') ? Tools::getValue('fianetsceau_' . $category['id_category'] . '_subcategory') : $this->getFianetSubCategoryId($category['id_category'], $id_shop);
$parent_id = $this->getFianetCategoryId($fianetsceau_type);
$shop_categories[$category['id_category']] = array('name' => $category['name'], 'fianetsceau_type' => $fianetsceau_type, 'parent_id' => $parent_id);
}
return $shop_categories;
}
示例15: updateCat
private function updateCat()
{
$moduleName = Tools::getValue('moduleName');
Db::getInstance()->execute('UPDATE
' . _DB_PREFIX_ . 'category c
INNER JOIN
' . _DB_PREFIX_ . 'category c2
ON
c.id_parent = c2.`id_category_' . bqSQL($moduleName) . '`
SET
c.id_parent = c2.id_category
WHERE c.`id_category_' . bqSQL($moduleName) . '` != 0');
$category = new Category();
$cats = $category->getSimpleCategories((int) Configuration::get('PS_LANG_DEFAULT'));
foreach ($cats as $cat) {
$cat = new Category((int) $cat['id_category']);
$cat->level_depth = $cat->calcLevelDepth();
$cat->update();
}
}