我正在尝试从opencart 2.0x结帐和注册页面中删除一些字段,例如传真,邮政编码。我似乎找不到合适的扩展名,所以我想从代码级别进行编辑。
任何人都可以指导我到一个起点吗?
答案 0 :(得分:2)
答案 1 :(得分:2)
您可以制作新文件
除去-fields.ocmod.xml
并输入此代码
<?xml version="1.0" encoding="utf-8"?>
<modification>
<name>Remove Field From Checkout Page</name>
<code>removeextrafield</code>
<version>1.0</version>
<author>Anuj Khandelwal</author>
<link>http://themextension.com</link>
<file path="catalog/view/theme/*/template/account/register.tpl">
<operation>
<search index="2"><![CDATA[
<div class="form-group">
]]></search>
<add position="replace"><![CDATA[
<div class="form-group" style="display: none;>
]]></add>
</operation>
</file>
<file path="catalog/view/theme/*/template/account/address_form.tpl">
<operation>
<search index="1"><![CDATA[
<div class="form-group">
]]></search>
<add position="replace"><![CDATA[
<div class="form-group" style="display: none;>
]]></add>
</operation>
</file>
<file path="catalog/view/theme/*/template/affiliate/{edit,register}.tpl">
<operation>
<search index="3"><![CDATA[
<div class="form-group">
]]></search>
<add position="replace"><![CDATA[
<div class="form-group" style="display: none;>
]]></add>
</operation>
<operation>
<search><![CDATA[
$entry_address_1;
]]></search>
<add position="replace" trim="true"><![CDATA[
$text_your_address;
]]></add>
</operation>
</file>
<file path="catalog/view/theme/*/template/checkout/{guest_shipping,payment_address,shipping_address}.tpl">
<operation>
<search index="1"><![CDATA[
<div class="form-group">
]]></search>
<add position="replace"><![CDATA[
<div class="form-group" style="display: none;>
]]></add>
</operation>
</file>
<file path="catalog/view/theme/*/template/checkout/{guest_shipping,payment_address,shipping_address}.tpl">
<operation>
<search index="1"><![CDATA[
<div class="form-group">
]]></search>
<add position="replace"><![CDATA[
<div class="form-group" style="display: none;>
]]></add>
</operation>
</file>
<file path="catalog/view/theme/*/template/checkout/{register,guest}.tpl">
<operation>
<search><![CDATA[
<div class="form-group">
]]></search>
<add position="replace"><![CDATA[
<div class="form-group" style="display: none;>
]]></add>
</operation>
</file>
<file path="catalog/view/theme/*/template/account/{register,address_form}.tpl">
<operation>
<search><![CDATA[
$entry_address_1;
]]></search>
<add position="replace" trim="true"><![CDATA[
$text_your_address;
]]></add>
</operation>
</file>
<file path="catalog/view/theme/*/template/checkout/{register,guest,guest_shipping,payment_address,shipping_address}.tpl">
<operation>
<search><![CDATA[
$entry_address_1;
]]></search>
<add position="replace" trim="true"><![CDATA[
$text_your_address;
]]></add>
</operation>
</file>
</modification>