OpenCart2 vqmod是否要更换,更换之前和之后? [英] OpenCart2 vqmod replace,before and after all replacing?

查看:85
本文介绍了OpenCart2 vqmod是否要更换,更换之前和之后?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请查看vqmod文件夹中的以下xml文件.

Please take a look at the following xml file in the vqmod folder.

<?xml version="1.0" encoding="UTF-8"?>
    <modification>
        <id>Drop Shipping</id>
        <version>2.0.0</version>
        <vqmver required="true">2.4.0</vqmver>
        <author>South Coast Hosting Services (Pty) Ltd</author>
        <file name="admin/language/*/common/menu.php">
            <operation error="log">
                <search><![CDATA[// Text]]></search>
                <add position="after"><![CDATA[
                $_['text_gdropship_menu'] = 'Drop Shipping';
                $_['text_gdropship_setup'] = 'Drop Shipping Setup';
                ]]></add>
            </operation>
        </file>
        <file name="admin/controller/common/menu.php">
            <operation error="log">
                <search ><![CDATA[$this->load->language('common/menu');]]></search>
                <add position="after"><![CDATA[
                $data['text_gdropship_setup'] = $this->language->get('text_gdropship_setup');
                $data['text_gdropship_menu'] = $this->language->get('text_gdropship_menu'); 
                ]]></add>
            </operation>
            <operation error="log">
                <search><![CDATA[$data['home'] = $this->url->link('common/dashboard', 'token=' . $this->session->data['token'], 'SSL');]]></search>
                <add position="before"><![CDATA[
                    $data['gdropshipmenu'] = $this->url->link('custom/gdropship', 'token=' . $this->session->data['token'], 'SSL');
                    $data['home'] = $this->url->link('common/dashboard', 'token=' . $this->session->data['token'], 'SSL');
                ]]></add>
            </operation>
        </file>
        <file name="admin/view/template/common/menu.tpl">
            <operation error="log">
                <search><![CDATA[<li id="system"><a class="parent"><i class="fa fa-cog fa-fw"></i> <span><?php echo $text_system; ?></span></a>]]></search>
                <add position="before"><![CDATA[<li><a class="parent"><i class="fa fa-share-alt fa-fw"></i><span><?php echo $text_gdropship_menu; ?><span></a>
        <ul>
            <li><a href="<?php echo $gdropshipmenu; ?>"><?php echo $text_gdropship_setup; ?></a></li>
        </ul><li id="system"><a class="parent"><i class="fa fa-cog fa-fw"></i> <span><?php echo $text_system; ?></span></a>]]></add>
            </operation>
        </file>
    </modification>

运行完美,链接到在

This runs perfectly, linking to an admin page create in this question. You will see that the position tags contain 'after' and 'before' options. My problem is (besides taking all day to figure this out and do these few lines) is that both these tags seem to replace instead of doing a before or after. Changing them to replace has no effect. Hence I just included the code I was 'After-ing'.

所以我的问题是我对上述代码做错了什么吗?我只想在继续开发之前澄清一下,这样就不会使我陷入困境.可能只是另一个OC2新手.

So my question is have I done something wrong with the above code? I would just like to clarify before proceeding with development so it does not bite me down the line. It could be just another OC2 newbie.

谢谢.

PS也许正在考虑对Opencart2进行新标记是什么?

PS Perhapse considering what's new a new tag for Opencart2 is warranted?

推荐答案

您的vQmod搜索或替换没有问题.问题是您已将搜索和替换参数的格式设置为OCMod,使用<add>标记中的position="XXX"而不是按照vQmod的格式使用<search>标记.交换这些应该可以解决问题

There is nothing wrong with your vQmod searches or replaces. The issue is you've formatted the search and replace parameters to those of OCMod, with the position="XXX" in the <add> tag instead of the <search> tag as per vQmod's format. Swapping those should fix the problem

这篇关于OpenCart2 vqmod是否要更换,更换之前和之后?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆