zen-cart商品产品页显示评论内容教程
在做zen-cart二次开发过程中,做到商品产品页面的修改的时候,都想把产品评论显示在产品当前页面上,其实无论对于SEO还是对于产品销售来说,显示产品评论好处还是很大的。以下是我自己实际操作总结修改教程:
1.找文件\includes\templates\template_default\templates\找到tpl_product_reviews_default.php 复制到当前网站使用模板templets下。
例如修改文件名称为:tpl_product_reviews_default_for_product_info.php 放置到\includes\templates\模板名称\templates\下
2.到\includes\templates\模板名称\templates\下找到商品产品页页面tpl_product_info_display.php,打开源文件到相应地方放置以下代码:
[php]get_template_dir(‘/tpl_product_reviews_default_for_product_info.php’,DIR_WS_TEMPLATE, $current_page_base,’templates’). ‘/tpl_product_reviews_default_for_product_info.php’);?>[/php]
3.到\includes\modules\pages\product_reviews\下找到header_php.php 内代码如下图
复制到\includes\modules\pages\product_info\header_php.php最后
4.TEXT_OF_5_STARS和TEXT_APPROVAL_REQUIRED等修改到\includes\languages\english\当前使用模板\product_info.php
最后的?>上面加上:
[php]//bof product reviews
define(‘TEXT_OF_5_STARS’, ‘%s of 5 Stars’);
define(‘TEXT_APPROVAL_REQUIRED’, ‘NOTE: Reviews require prior approval before they will be displayed’);
//eof product reviews[/php]
5.最终效果图: