Post by HAO » Sat Jan 07, 2017 5:31 am

我想要透過 ocmod 來「搜尋並取代」的指令,只是我看了官方的範例,我還是不了解。

如果說我要針對整段的程式碼,執行「搜尋並取代」的動作,請問有具體的範例可以教我怎麼做嗎?

例如:
upload/catalog/view/theme/*/template/account/address_form.tpl

我想要拿掉:

Code: Select all

          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-lastname"><?php echo $entry_lastname; ?></label>
            <div class="col-sm-10">
              <input type="text" name="lastname" value="<?php echo $lastname; ?>" placeholder="<?php echo $entry_lastname; ?>" id="input-lastname" class="form-control" />
              <?php if ($error_lastname) { ?>
              <div class="text-danger"><?php echo $error_lastname; ?></div>
              <?php } ?>
            </div>
          </div>
整段的程式碼,我該如何去做 ocmod 的修改呢?

HAO
Active Member

Posts

Joined
Fri Jun 03, 2011 2:52 pm

Post by threeus » Sat Apr 01, 2017 7:59 pm

lastname 不建議拿掉,那是系統必填欄位,你最多就是隱藏他,給他預設值

shop.threeus.com
Image


New member

Posts

Joined
Thu Sep 24, 2015 7:55 pm
Location - Taiwan

Post by HAO » Sun Apr 02, 2017 3:59 pm

我的意思是打個比方,事實上就算姓氏的欄位整個拿掉,只要懂得完整移除前後台的顯示位置並不會造成影響。

很遺憾的是,您提出的並不是我要的答案,因為我要的是搜尋整段並刪除的語法,希望有其他朋友可以提供一些技巧。

HAO
Active Member

Posts

Joined
Fri Jun 03, 2011 2:52 pm

Post by threeus » Wed Apr 05, 2017 5:47 pm

搜尋 header.tpl
找到 xxx
刪掉 (replace = 無)

Code: Select all

<file path="catalog/view/theme/default/template/common/header.tpl">
		<operation>
			<search><![CDATA[xxx]]></search>
			<add position="replace"><![CDATA[]]></add>
		</operation>
</file>

shop.threeus.com
Image


New member

Posts

Joined
Thu Sep 24, 2015 7:55 pm
Location - Taiwan

Post by HAO » Fri Apr 07, 2017 3:21 pm

感謝回覆,請讓我再確認,就結果來說就能實現完整刪除下面這段程式碼的動作嗎?

Code: Select all

          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-lastname"><?php echo $entry_lastname; ?></label>
            <div class="col-sm-10">
              <input type="text" name="lastname" value="<?php echo $lastname; ?>" placeholder="<?php echo $entry_lastname; ?>" id="input-lastname" class="form-control" />
              <?php if ($error_lastname) { ?>
              <div class="text-danger"><?php echo $error_lastname; ?></div>
              <?php } ?>
            </div>
          </div>

HAO
Active Member

Posts

Joined
Fri Jun 03, 2011 2:52 pm
Who is online

Users browsing this forum: No registered users and 4 guests