怎么去掉ceon_uri_mapping的链接中的cPath参数?

我安装了ceon_uri_mapping插件,为什么有部分的产品url后面带cPath呢?怎么去掉?
以下给出正确的方法:
在html_output.php中将

            if ($cpath_being_linked_to == zen_get_product_path($product_id)) {
改成
            if (!is_null($cpath_being_linked_to)) {

即可.
原始的必须判断当前产品的目录id等于cpath中的值才可,在有些情况下会不等.
大家试试

ZEN-CART Ceon URI Mapping(SEO)自定义页面静态化方法

ZEN-CART Ceon URI Mapping(SEO)提供了产品目录,产品以及ez-page的静态化方法及操作界面,虽然不能批量,但至少可以操作,但对于其它页面的静态化,就没有提供说明及操作示例,这里我给出方法,不过要操作数据库,最主要的是在CEON_URI_MAPPINGS数据库中将相应的资料,以about_us为例:
未静态化前是: www.***.com/index.php?mainpage=about_us
静态化后希望是: www.***.com/about-us
那么只要在CEON_URI_MAPPINGS和几个字段上分别插入以下内容:uri插入/about-us   , main_page插入  about_us, current_uri插入 1,language_id根据你的语言插入,正常是1.
通过以上方法,即可完成一个指定页面的静态化,如果有参数想静态化,可在query_string_parameters字段插入指定页面的查询参数,即可实现指定页面及参数的静态化

ZEN-CART Ceon URI Mapping(SEO)静态链接的自动批量生成

ZEN-CART Ceon URI Mapping(SEO)静态链接,按标准模块功能,是需要到目录、产品、ez-page模块中,逐个进行保存,才能生成ceon uri所需的链接,如果商品多的话,工作量非常大,有没自动批量生成这些链接的代码呢,找找,网上没有,据说要收费,没找到.
既然模块中代码能生成一个静态链接,那我就利用他的代码,批量生成,方法如下:
在admin/ceon_uri_mapping_config.php 代码的前部,require(‘includes/application_top.php’);之后,增加以下代码即可实现ZEN-CART Ceon URI Mapping(SEO)静态链接生成功能:

function zen_get_categories_name($who_am_i,$languageid) {

global $db;

$the_categories_name_query= “select categories_name from ” . TABLE_CATEGORIES_DESCRIPTION . ” where categories_id= ‘” . $who_am_i . “‘ and language_id= ‘” . $languageid . “‘”;

$the_categories_name = $db->Execute($the_categories_name_query);

return $the_categories_name->fields[‘categories_name’];

}

if(defined(CEON_URI_MAPPING_ENABLED) && CEON_URI_MAPPING_ENABLED==’1′) {

$languages = zen_get_languages();

$sql=”delete from “.TABLE_CEON_URI_MAPPINGS.” where main_page=’index’ and associated_db_id not in (select categories_id from “.TABLE_CATEGORIES.”)”;

$db->Execute($sql);

$sql=”select categories_id from “.TABLE_CATEGORIES.” where categories_id not in (select associated_db_id from “.TABLE_CEON_URI_MAPPINGS.” where main_page=’index’) and categories_status=1″;

$category_products = $db->Execute($sql);

while (!$category_products->EOF) {

// BEGIN CEON URI MAPPING 1 of 3

for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {

$uri_mapping = ceon_uri_mapping_autogen_category_or_product_uri($category_products->fields[‘categories_id’], ‘category’,

null, zen_get_categories_name($category_products->fields[‘categories_id’],$languages[$i][‘id’]),

$languages[$i][‘code’], $languages[$i][‘id’]);

if (strlen($uri_mapping) > 1) {

// Make sure URI mapping is relative to root of site and does not have more than one

// trailing slash or any illegal characters

$uri_mapping = ceon_uri_mapping_cleanup_uri_mapping($uri_mapping);

}

$sql_data_array = array(

‘uri’ => zen_db_prepare_input($uri_mapping),

‘language_id’ => (int) $languages[$i][‘id’],

‘current_uri’ => 1,

‘main_page’ => FILENAME_DEFAULT,

‘associated_db_id’ => (int) $category_products->fields[‘categories_id’],

‘date_added’ => date(‘Y-m-d H:i:s’)

);

zen_db_perform(TABLE_CEON_URI_MAPPINGS, $sql_data_array);

}

$category_products->MoveNext();

}

$languages = zen_get_languages();

$sql= “delete from “.TABLE_CEON_URI_MAPPINGS.” where main_page<>’index’ and main_page<>’page’ and associated_db_id not in (select products_id from “.TABLE_PRODUCTS.”)”;

$db->Execute($sql);

$sql=”select products_id from “.TABLE_PRODUCTS.” where products_id not in (select associated_db_id from “.TABLE_CEON_URI_MAPPINGS.” where main_page<>’index’ and main_page<>’page’) and products_status=1″;

$products_list = $db->Execute($sql);

// BEGIN CEON URI MAPPING 1 of 1

while (!$products_list->EOF) {

for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {

$uri_mapping = $uri_mapping = ceon_uri_mapping_autogen_category_or_product_uri(

$products_list->fields[‘products_id’], ‘product’, null, null, $languages[$i][‘code’],

$languages[$i][‘id’]);

if (strlen($uri_mapping) > 1) {

// Make sure URI mapping is relative to root of site and does not have more than one

// trailing slash or any illegal characters

$uri_mapping = ceon_uri_mapping_cleanup_uri_mapping($uri_mapping);

}

$product_type = zen_get_products_type($products_list->fields[‘products_id’]);

// Add the new URI mapping

$insert_sql_data = array(

‘main_page’ => $zc_products->get_handler($product_type) . ‘_info’,

‘associated_db_id’ => (int) $products_list->fields[‘products_id’],

‘language_id’ => (int) $languages[$i][‘id’],

‘uri’=>zen_db_prepare_input($uri_mapping),

‘current_uri’ => 1

);

$sql_data_array = $insert_sql_data;

zen_db_perform(TABLE_CEON_URI_MAPPINGS, $sql_data_array);

// Avoid possibility of old duplicate URI mappings for the same product

ceon_uri_mapping_remove_product_mapping_duplicates($uri_mapping, $products_list->fields[‘products_id’]);

// Now add the URI mappings for the review pages/tell-a-friend page for this product

if (substr($uri_mapping, -1) != ‘/’) {

$uri_mapping .= ‘/’;

}

$sql_data_array[‘uri’] = zen_db_prepare_input($uri_mapping .

CEON_URI_MAPPING_URI_PART_PRODUCT_REVIEWS);

$sql_data_array[‘main_page’] = zen_db_prepare_input(FILENAME_PRODUCT_REVIEWS);

zen_db_perform(TABLE_CEON_URI_MAPPINGS, $sql_data_array);

$sql_data_array[‘uri’] = zen_db_prepare_input($uri_mapping .

CEON_URI_MAPPING_URI_PART_PRODUCT_REVIEWS_INFO);

$sql_data_array[‘main_page’] =

zen_db_prepare_input(FILENAME_PRODUCT_REVIEWS_INFO);

zen_db_perform(TABLE_CEON_URI_MAPPINGS, $sql_data_array);

$sql_data_array[‘uri’] = zen_db_prepare_input($uri_mapping .

CEON_URI_MAPPING_URI_PART_PRODUCT_REVIEWS_WRITE);

$sql_data_array[‘main_page’] =

zen_db_prepare_input(FILENAME_PRODUCT_REVIEWS_WRITE);

zen_db_perform(TABLE_CEON_URI_MAPPINGS, $sql_data_array);

$sql_data_array[‘uri’] = zen_db_prepare_input($uri_mapping .

CEON_URI_MAPPING_URI_PART_TELL_A_FRIEND);

$sql_data_array[‘main_page’] =

zen_db_prepare_input(FILENAME_TELL_A_FRIEND);

zen_db_perform(TABLE_CEON_URI_MAPPINGS, $sql_data_array);

}

$products_list->MoveNext();

}

$sql=”delete from “.TABLE_CEON_URI_MAPPINGS.” where main_page=’page’ and associated_db_id not in (select pages_id from “.TABLE_EZPAGES_TEXT.”)”;

$db->Execute($sql);

$languages = zen_get_languages();

for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {

$sql=”select pages_title,pages_id from “.TABLE_EZPAGES_TEXT.” where pages_id not in (select associated_db_id from “.TABLE_CEON_URI_MAPPINGS.” where main_page=’page’) and languages_id=”.$languages[$i][‘id’];

$ezpage_linkdata = $db->Execute($sql);

while (!$ezpage_linkdata->EOF) {

$uri_mapping = ceon_uri_mapping_autogen_ez_page_uri(null, $ezpage_linkdata->fields[‘pages_title’],$languages[$i][‘code’], $languages[$i][‘id’]);

if (strlen($uri_mapping) > 1) {

// Make sure URI mapping is relative to root of site and does not have more than one

// trailing slash or any illegal characters

$uri_mapping = ceon_uri_mapping_cleanup_uri_mapping($uri_mapping);

}

$sql_data_array = array(

‘uri’ => zen_db_prepare_input($uri_mapping),

‘language_id’ => (int) $languages[$i][‘id’],

‘current_uri’ => 1,

‘main_page’ => FILENAME_EZPAGES,

‘associated_db_id’ => (int) $ezpage_linkdata->fields[‘pages_id’],

‘date_added’ => date(‘Y-m-d H:i:s’)

);

zen_db_perform(TABLE_CEON_URI_MAPPINGS, $sql_data_array);

$ezpage_linkdata->MoveNext();

}

}

}