存档

‘zen-cart’ 分类的存档

zen-cart细节图紊乱解决方案

2011年8月18日 无风的飘逸 2 条评论

zen cart对产品细节图的识别可谓是非常先进。

它是根据主图,然后只要是图片名字以主图的名字开头的,或者放在以主图文件名(不包含扩展名)为名的文件夹里的图片都可以被识别为产品的细节图。

但是今天我碰到一个问题。

产品主图:   image1.jpg

产品细节图: image1_1.jpg  image1_2.jpg .....

图片目录中还存在其它产品的主图和细节图:

image2.jpg,    image10.jpg   image10_1.jpg   image11.jpg ……

结果程序把image10.jpg   image10_1.jpg   image11.jpg 等以image1开头的图片全部识别为产品图片的细节图。

解决方案:

修改细节图识别的那断代码。

打开includes/modules/ (或者 includes/modules/当前模板文件夹/)additional_images.php

找到 if(preg_match("/" . $products_image_base . "/i", $file) == 1) {

修改为:

if(preg_match("/" . $products_image_base . "_/i", $file) == 1) {

Share
分类: zen-cart 标签:

【转载】解决zen cart目录链接为-c-.html的问题

2011年1月23日 无风的飘逸 没有评论

Posted by 老邓 on Wednesday, December 8, 2010 · Leave a Comment

在进行一些zen cart设置时发现产品页面(product_info)的category icon显示有两个问题,一是category name不显示,二是链接错误,形如:http://example.com/-c-.html (开启了SEO URLS后)。检查后台设置 admin -> configuration -> product info 是没有问题的,默认就已经打开,因此错误来源于代码问题。检查 includes/modules/category_icon_display.php 可以看到如下代码:

$category_icon_display_name = zen_get_categories_name((int)$current_category_id);
$category_icon_display_image = zen_get_categories_image((int)$current_category_id);

然而die($category_icon_display_name)出来的结果是空的。检查 zen_get_categories_name 函数没有问题,因此问题出在 $current_category_id 变量,果然,打印结果显示它是空的!经过搜索 $current_category_id 变量初始化于 includes/init_includes/init_category_path.php,检查代码可以看到:

$cPath = zen_get_product_path($_GET['products_id']);

检查函数 zen_get_product_path 代码可以看到zen cart使用 master_categories_id 来查看产品的分类的,而数据库中 master_categories_id 全是 0 !这时想到我们上产品基本都是使用 easy populate 插件来完成,master_categories_id 为空的情况只可能是由于 easy populate 的不完整,代码有点小失误(暂未细查)。OK,问题找到了,临时的解决办法是首先完善 zen_get_products_category_id 函数(因为它也是只根据 master_categories_id 查看分类,而未查看 products_to_categories 表),在 return 之前加入代码:

/**
* Add since 2010-12-8, by $d {http://www.ddmin.com}
*/
if (! $the_products_category->fields['master_categories_id']) {
$d_p2c_cid = $db->Execute('SELECT categories_id FROM `' . TABLE_PRODUCTS_TO_CATEGORIES . '` WHERE products_id="' . $products_id . '"')->fields['categories_id'];
$the_products_category->fields['master_categories_id'] = $d_p2c_cid;
}
/**
* Add end
*/

然后打开 includes/modules/category_icon_display.php,在 $category_icon_display_name = zen_get_categories_name((int)$current_category_id); 前加入代码:

/**
* Add since 2010-12-8, by $d {http://www.ddmin.com}
*/
$current_category_id = zen_get_products_category_id((int)$_GET['products_id']);
/**
* Add end
*/

category id 获取不到的问题解决,接着打开 template_default/templates/tpl_modules_category_icon_display.php,将 $_GET['cPath'] 改为 $current_category_id 即可,category icon问题解决。

本文转载老邓的博客

Share
分类: zen-cart 标签: ,

zen cart的IPS支付模块出现Forbidden! Please contact with us

2010年12月14日 无风的飘逸 没有评论

IPS付款的时候,出现Forbidden! Please contact with us提示,显示为alert警告框,

经过后台查询该代码,是IPS接口提出的警告!

查看代码,发现后台没有添加CNY货币代码。

那么这就是问题了

解决方法:在后台添加CNY货币代码(currencies)

Share
分类: zen-cart 标签: ,

Email Error: SMTP Error: Could not connect to SMTP host.

2010年11月24日 无风的飘逸 没有评论

zen cart常见错误之 email error:

错误提示:Email Error: SMTP Error: Could not connect to SMTP host.

一般在客户注册的时候,或者客户使用contact us联系我们的时候,此错误影响下单。

错误等级:五星

如果不及时修改,就算网站排名再好,也是没有单来的。

解决办法:

1、检查后台configuration-> e-mail, 看邮箱的配置是否正确。主要就是密码,邮件服务器,及发送的方式。常见的邮件发送发式有php, smtp, smtpauth;

2、 为了防止下次邮箱不能用的时候不报这个错误导致客户不能继续下单,我们应该开启邮件的友好提示。

即如果是英文版的后台为"email friendly error"如果是中文版则是“电子邮件出错信息", 把它设置为true;
正常情况下(我用的是1.3.8a)它在后台邮件设置的第六项;

Share

zen cart的PP跳转终于测试成功!

2010年11月17日 无风的飘逸 3 条评论

正在用某个版本的PayPal跳转,发现后台一直没有生成订单。

经过两天的苦战(我有点菜,一开始就压根没有想到用最快的办法测试),终于把错误逮出来了!

原来zen cart的ipn有对网站后台设置的pp邮箱地址和实际收款人的地址进行核对,如果正确无误,后台就会生成订单

Share
分类: zen-cart 标签:

LINUX环境下PHP后期安装DOM模块

2010年11月5日 无风的飘逸 1 条评论

最近在安装某zen cart插件的时候,提示需要DOM模块的支持。

本来DOM模块在编译PHP的时候,默认被加上的,但是我用的是webmin整合的php居然给我禁用掉了。得补上。

于是网上找了教材,解决了。

解决方法很简单,只有一行命令:

yum -y install php-dom

关联的问题:

1. webmin如何为PHP增加DOM模块;

2. virtualmin 如何为PHP增加DOM模块;

3. PHP后期安装DOM模块;

4. zen cart网站添加DOM模块支持

Share
分类: Linux 技术, PHP, zen-cart 标签:

[zen cart] 用户无法登录提示There was a security error when trying to login

2010年6月12日 无风的飘逸 4 条评论

这几天修改zen cart测试了很多东西,结果发现我的网站坏了,具体情况是这样的:

当我想注册一个新用户的时候,发现表单提交之后重新回到注册页面,而当我想登录的时候,表单提交之后则提示There was a security error when trying to login.

网上查了,这个主要原因是一个叫做securekey 的较验码较验失败,但是我装的都是最新版的zen cart。不可能做有这个问题(经过测试,确实不是这个原因)。

后来发现是我设置的重写出了问题,

我写的重写是这样的:

RewriteRule ^index.php$ / [R=301, L]

去掉就可以了

Share
分类: zen-cart 标签:

安装 news and archive manager可能导致首页无法显示

2010年4月29日 无风的飘逸 1 条评论

清水最新观察显示,安装 news and archive manager可能导致首页无法显示。

请广大zen cart使用者朋友们注意啦,安装news and archive manager这个插件时,一定要特别注意备份原网站。

如果你想减少麻烦,请备份includes\templates\template_default\templates\tpl_index_default.php 以待观察

Share
分类: zen-cart 标签:

[zen cart]Lightinthebox后台不能显示部分目录的产品,新建的目录正常

2010年4月11日 无风的飘逸 75 条评论

问题1:zen cart安装后台权限管理模块(admin_auth)模块后,通过easypopulate导入的产品为什么不能在后台显示?

问题2:Lightinthebox,通过easypopulate导入的产品为什么不能在后台显示?

这两个问题的解决方法其实是一样的:
抱歉,只有对本文发表过评论才能阅读隐藏内容

Share
分类: zen-cart 标签: ,

robots.txt for zen cart

2010年4月8日 无风的飘逸 没有评论

User-agent: *
Disallow: /cache/
Disallow: /contrib/
Disallow: /docs/
Disallow: /extras/
Disallow: /htmlarea/
Disallow: /stats/
Disallow: /sitemap/
Disallow: /graphics/
Disallow: /login.html
Disallow: /privacy.html
Disallow: /conditions.html
Disallow: /contact_us.html
Disallow: /gv_faq.html
Disallow: /discount_coupon.html
Disallow: /unsubscribe.html
Disallow: /shopping_cart.html
Disallow: /ask_a_question.html
Disallow: /popup_image_additional.html
Disallow: /product_reviews_write.html
Disallow: /tell_a_friend.html
Disallow: /pages-popup_image.html?
Disallow: /popup_image_additional.html?
Disallow: /login.html

User-agent: Googlebot-Image
Disallow: /

Share
分类: zen-cart 标签: