在下个版本中会添加此功能。现在要实现可以先修改代码来实现。
修改如下:
打开根目录下的goods.php文件在71行后添加
复制内容到剪贴板
代码:
$pattern = '/^[0-9]+[^\.]/';
if (preg_match_all($pattern, $goods['shop_price'], $match))
{
$receive_itergral = $match[0][0] * $_CFG['integral_scale'];
$smarty->assign('receive_itergral', $receive_itergral);
}然后在语言包languages/zh_cn/common.php文件里的105行添加
复制内容到剪贴板
代码:
$_LANG['goods_receive_integral'] = '购买此商品时可获得:';最后在你所选择的模板目录下找到goods.dwt文件
在
<!-- {if $goods.integral > 0} -->
<tr>
<td width="35%">{$lang.goods_integral}</td>
<td>{$goods.integral} {$points_name}</td>
</tr>
<!-- {/if} -->
这段代码后面添加
复制内容到剪贴板
代码:
<!-- {if $cfg.use_integral > 0} -->
<!-- {if $receive_itergral} -->
<tr>
<td width="35%">{$lang.goods_receive_integral}</td>
<td><font color="red"> {$receive_itergral} {$points_name}</font></td>
</tr>
<!-- {/if} -->
<!-- {/if} -->然后在后台管理中心 系统设置->商店设置->购物流程 里将使用使用积分选中使用后,清除缓存后看前台效果。