zencart v1.3.9h后台产品编辑时问题修改
2011-05-25 15:21
357 查看
zencart v1.3.9h后台产品编辑时产品名,产品描述,产品型号信息未读出问题
Symptoms:
a) Using PHP version lower than 5.2.3(and 5.2.3 is LESS THAN 5.2.13, for example. ie: 3 is less than 13)
b) Zen Cart v1.3.9h
c) On admin "home" page you notice that your list of customers shows only dates, not names.
d) On admin product-edit screen you notice that the product name, description, and model number are empty when editing a product.
NOTE: If you're using such an old version of PHP, then your site is certainly not PCI-Compliant, and is thus likely to contain known security problems in PHP, and you should be upgrading your hosting to a newer version of PHP.
The following is ONLY a workaround for the symptoms mentioned above, and is NOT needed if you're using a current version of PHP.
Solution:
Strictly speaking, this is only necessary if you're using a PHP version lower than PHP 5.2.3
1. /admin/includes/functions/general.php
Line 39, change from:
Code:
return htmlspecialchars($string, ENT_COMPAT, CHARSET, FALSE);to:
Code:
return htmlspecialchars($string, ENT_COMPAT, CHARSET);2. /admin/includes/modules/product/collect_info.php
(and if you use the other product types too, then *those* collect_info.php files as well. See below for the list of filenames.)
Action: You have two choices:
either:
a) revert these files back to v1.3.9g versions (recommended, since it's simpler)
or
b) make similar edits in 3 places in each file, removing the ", TRUE" in each of these sections of code:
Approx line 299:
Code:
<td class="main"><?php echo zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . zen_draw_input_field('products_name[' . $languages[$i]['id'] . ']', (isset($products_name[$languages[$i]['id']]) ? htmlspecialchars(stripslashes($products_name[$languages[$i]['id']]), ENT_COMPAT, CHARSET, TRUE) : htmlspecialchars(zen_get_products_name($pInfo->products_id, $languages[$i]['id']), ENT_COMPAT, CHARSET, TRUE)), zen_set_field_length(TABLE_PRODUCTS_DESCRIPTION, 'products_name')); ?></td>Approx line 412:
Code:
echo zen_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '100%', '30', (isset($products_description[$languages[$i]['id']])) ? htmlspecialchars(stripslashes($products_description[$languages[$i]['id']]), ENT_COMPAT, CHARSET, TRUE) : htmlspecialchars(zen_get_products_description($pInfo->products_id, $languages[$i]['id']), ENT_COMPAT, CHARSET, TRUE)); //,'id="'.'products_description' . $languages[$i]['id'] . '"');Approx line 433:
Code:
<td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_model', htmlspecialchars(stripslashes($pInfo->products_model), ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_PRODUCTS, 'products_model')); ?></td>(NOTE: Line-numbers will vary depending on which product-type file you're editing.)
These are the additional product-type files which you may or may not be using:
- /admin/includes/modules/document_general/collect_info.php
- /admin/includes/modules/document_product/collect_info.php
- /admin/includes/modules/product_free_shipping/collect_info.php
- /admin/includes/modules/product_music/collect_info.php
3. includes/modules/pages/shopping_cart/header_php.php
Line 111, remove the ", TRUE":
Code:
$attr_value = htmlspecialchars($products[$i]['attributes_values'][$option], E
Code:
$attr_value = htmlspecialchars($products[$i]['attributes_values'][$option], ENT_COMPAT, CHARSET, TRUE);
如果产品名还是没有则把
zen_get_products_name($pInfo->products_id, $languages[$i]['id']), 直接换成产品名变量 $pInfo->products_name
$products_name[$languages[$i]['id']]) 直接换成产品名变量 $pInfo->products_name
其它类似
Symptoms:
a) Using PHP version lower than 5.2.3(and 5.2.3 is LESS THAN 5.2.13, for example. ie: 3 is less than 13)
b) Zen Cart v1.3.9h
c) On admin "home" page you notice that your list of customers shows only dates, not names.
d) On admin product-edit screen you notice that the product name, description, and model number are empty when editing a product.
NOTE: If you're using such an old version of PHP, then your site is certainly not PCI-Compliant, and is thus likely to contain known security problems in PHP, and you should be upgrading your hosting to a newer version of PHP.
The following is ONLY a workaround for the symptoms mentioned above, and is NOT needed if you're using a current version of PHP.
Solution:
Strictly speaking, this is only necessary if you're using a PHP version lower than PHP 5.2.3
1. /admin/includes/functions/general.php
Line 39, change from:
Code:
return htmlspecialchars($string, ENT_COMPAT, CHARSET, FALSE);to:
Code:
return htmlspecialchars($string, ENT_COMPAT, CHARSET);2. /admin/includes/modules/product/collect_info.php
(and if you use the other product types too, then *those* collect_info.php files as well. See below for the list of filenames.)
Action: You have two choices:
either:
a) revert these files back to v1.3.9g versions (recommended, since it's simpler)
or
b) make similar edits in 3 places in each file, removing the ", TRUE" in each of these sections of code:
Approx line 299:
Code:
<td class="main"><?php echo zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . zen_draw_input_field('products_name[' . $languages[$i]['id'] . ']', (isset($products_name[$languages[$i]['id']]) ? htmlspecialchars(stripslashes($products_name[$languages[$i]['id']]), ENT_COMPAT, CHARSET, TRUE) : htmlspecialchars(zen_get_products_name($pInfo->products_id, $languages[$i]['id']), ENT_COMPAT, CHARSET, TRUE)), zen_set_field_length(TABLE_PRODUCTS_DESCRIPTION, 'products_name')); ?></td>Approx line 412:
Code:
echo zen_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '100%', '30', (isset($products_description[$languages[$i]['id']])) ? htmlspecialchars(stripslashes($products_description[$languages[$i]['id']]), ENT_COMPAT, CHARSET, TRUE) : htmlspecialchars(zen_get_products_description($pInfo->products_id, $languages[$i]['id']), ENT_COMPAT, CHARSET, TRUE)); //,'id="'.'products_description' . $languages[$i]['id'] . '"');Approx line 433:
Code:
<td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_model', htmlspecialchars(stripslashes($pInfo->products_model), ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_PRODUCTS, 'products_model')); ?></td>(NOTE: Line-numbers will vary depending on which product-type file you're editing.)
These are the additional product-type files which you may or may not be using:
- /admin/includes/modules/document_general/collect_info.php
- /admin/includes/modules/document_product/collect_info.php
- /admin/includes/modules/product_free_shipping/collect_info.php
- /admin/includes/modules/product_music/collect_info.php
3. includes/modules/pages/shopping_cart/header_php.php
Line 111, remove the ", TRUE":
Code:
$attr_value = htmlspecialchars($products[$i]['attributes_values'][$option], E
Code:
$attr_value = htmlspecialchars($products[$i]['attributes_values'][$option], ENT_COMPAT, CHARSET, TRUE);
如果产品名还是没有则把
zen_get_products_name($pInfo->products_id, $languages[$i]['id']), 直接换成产品名变量 $pInfo->products_name
$products_name[$languages[$i]['id']]) 直接换成产品名变量 $pInfo->products_name
其它类似
相关文章推荐
- zencart初始安装后台目录admin必须修改才能登录问题
- zencart前台小语种后台英文 导入批量表 前后台不显示产品的问题
- zencart初始安装后台目录admin必须修改才能登录问题 .
- Zencart畅销产品(bestsellers)与后台订单显示图片
- 问题:后台线程修改自动布局引擎
- mysql语句修改zencart产品原价为特价的倍数
- phpcms 后台登陆及版权修改问题
- WordPress博客后台不能显示所有主题和无法编辑主题的问题的解决方法
- 解决在VS(winform)程序中无法在调试时修改代码的问题(也就是“编辑并继续”功能无效)
- ZenCart后台订单详细页显示产品图片和链接
- 修改编辑文件夹名称, put数据出现的问题
- zencart后台修改首页meta_title、meta_keywords、meta_description
- 修改Wordpress-4.0的文章编辑区内容(MCE控件)跟随最外面垂直滚动条滚动的问题
- zencart无法加载购物车数据,产品不能添加到购物车问题解决
- Function ALV可编辑列修改数据后与与内表数据同步问题
- Magento 后台订单详情页Items Ordered列表处,添加跳转到编辑产品的url
- element UI Cascader 级联选择器 编辑 修改 数组 路径 问题(转载)
- magento 后台保存分类失败,无法保存产品,ajax一直在转的问题 的解决 - Cannot edit categories in Magento
- zencart 后台目录产品黄色icon_yellow_on.gif 解决方案
- 怎么解决织梦cms后台编辑内容等出现空白的问题?