问题在OpenCart中使用VQMOD在header.tpl中更改简单文本
问题描述:
我想第一次使用VQMOD,并且当我将下面的代码添加到我的页面时没有任何更改。问题在OpenCart中使用VQMOD在header.tpl中更改简单文本
我试图在主页(打开车)右上角的home
链接改为my home
,但文本并没有改变。不幸的是,VQMOD经理没有错误。
我的XML代码是在下面。我是否需要向我的TPL添加某些内容或进行其他更改?
<modification>
<file name="catalog/view/theme/*/template/common/header.tpl">
<operation>
<search position="replace"><![CDATA[<?php echo $text_home; ?>]]></search>
<add><![CDATA[my home]]></add>
</operation>
</file>
</modification>
答
您无法像代码中那样替换header.tpl。 VQMOD“只能搜索单行”不是特定的变量。
试试这个代码:
<file name="catalog/view/theme/*/template/common/header.tpl">
<operation>
<search position="replace"><![CDATA[
<div class="links"><a href="<?php echo $home; ?>"><?php echo $text_home; ?></a><a href="<?php echo $wishlist; ?>" id="wishlist-total"><?php echo $text_wishlist; ?></a><a href="<?php echo $account; ?>"><?php echo $text_account; ?></a><a href="<?php echo $shopping_cart; ?>"><?php echo $text_shopping_cart; ?></a><a href="<?php echo $checkout; ?>"><?php echo $text_checkout; ?></a></div>
]]>
</search>
<add><![CDATA[
<div class="links"><a href="<?php echo $home; ?>">your own link</a><a href="<?php echo $home; ?>"><?php echo $text_home; ?></a><a href="<?php echo $wishlist; ?>" id="wishlist-total"><?php echo $text_wishlist; ?></a><a href="<?php echo $account; ?>"><?php echo $text_account; ?></a><a href="<?php echo $shopping_cart; ?>"><?php echo $text_shopping_cart; ?></a><a href="<?php echo $checkout; ?>"><?php echo $text_checkout; ?></a></div>
]]>
</add>
</operation>
</file>
答
的一两件事,我看准缺少的直线距离是顶部的修改细节丢失
<id>Mod Name</id>
<version>1.0.0</version>
<vqmver>2.X</vqmver>
<author>Your name</author>
你真的应该有这样的代码太在xml文件的顶部
<?xml version="1.0" encoding="UTF-8"?>
答
您在* .tpl中包含()或require()或require_once()文件
require ('catalog/view/theme/*/template/product/*.tpl');
修改
require($vqmod->modCheck('catalog/view/theme/*/template/product/*.tpl'));
或
<?php
global $vqmod;
require($vqmod->modCheck('file/path/here'));
?>
或修改vqmod_opencart.xml
<file name="path/ *.tpl">
<operation>
<search position="replace" regex="true"><![CDATA[~require\(([^)]+)~]]></search>
<add><![CDATA[require($vqmod->modCheck($1)]]></add>
</operation>
</file>
我一直与vqmod同样的问题,它只是完全安装后没有反应,所以我恢复到编辑f iles手动。这不适合你吗? – Cleverbot 2012-07-13 15:09:48
如果您安装vQmod后还没有发生任何问题,那么在必要的文件夹上权限不正确或者在index.php文件中没有发生安装 – 2012-11-25 17:22:09