0

我已经安装了 Mageworx 下载扩展和 Template master - Easy tabs 扩展。可以通过管理员进行配置,将下载信息放在产品视图页面上,但无法告诉它将其放置在“简易标签”自定义标签中。

我找到了需要进行编辑的地方,但我不确定语法是否正确:

下载.xml:

<?xml version="1.0"?>
<layout version="0.1.0">
    <default>
        <reference name="head">
            <action method="addJs" ifconfig="mageworx_cms/downloads/enabled"><script>mageworx/downloads.js</script></action>
            <action method="addCss" ifconfig="mageworx_cms/downloads/enabled"><stylesheet>css/mageworx/downloads.css</stylesheet></action>
        </reference>
        <reference name="after_body_start">
            <block type="core/template" template="downloads/init_popup.phtml" name="init_video_popup" />
        </reference>
        <reference name="before_body_end">
            <block type="core/template" template="downloads/video_popup.phtml" name="video_popup" />
        </reference>
    </default>

    <catalog_product_view>
        <reference name="product.info">
            <block type="downloads/product" name="downloads.product" />
        </reference>
    </catalog_product_view>

    <!--catalog_category_layered>
        <reference name="product_list">
            <action ifconfig="mageworx_cms/downloads/enable_files_on_category_pages" method="setTemplate"><template>downloads/catalog-product-list.phtml</template></action>
        </reference>
    </catalog_category_layered>

    <catalog_category_default>
        <reference name="product_list">
            <action ifconfig="mageworx_cms/downloads/enable_files_on_category_pages" method="setTemplate"><template>downloads/catalog-product-list.phtml</template></action>
        </reference>
    </catalog_category_default>

    <catalogsearch_result_index>
        <reference name="search_result_list">
            <action ifconfig="mageworx_cms/downloads/enable_files_on_category_pages" method="setTemplate"><template>downloads/catalog-product-list.phtml</template></action>
        </reference>
    </catalogsearch_result_index>

    <catalogsearch_advanced_result>
        <reference name="search_result_list">
            <action ifconfig="mageworx_cms/downloads/enable_files_on_category_pages" method="setTemplate"><template>downloads/catalog-product-list.phtml</template></action>
        </reference>
    </catalogsearch_advanced_result-->
</layout>

TM_EasyTabs.xml:

<?xml version="1.0"?>
<config>
    <modules>
        <TM_EasyTabs>
            <active>true</active>
            <codePool>community</codePool>
            <tm_link><![CDATA[http://templates-master.com/magento-extensions/magento-easy-tabs.html]]></tm_link>
            <depends>
                <Mage_Catalog />
            </depends>
            <!-- Add custom tab for downloads -->
            <action method="addTab" translate="title" module="catalog">
                <alias>downloads</alias>
                <title>Downloads test</title>
                <block>downloads/product</block>
                <template>downloads/block_file_links.phtml</template>
            </action>
         </TM_EasyTabs>   
    </modules>
</config>

如您所见,我已尝试输入正确的语法,但我弄错了,因为当我取消注释时,选项卡会从产品页面消失。

编辑:

原来我编辑了错误的 xml 文件,我需要编辑的是布局文件夹中的 easytabs.xml。

我已经设法添加了一个包含下载内容的选项卡,但是因为我无法在管理员中完全禁用下载的添加,所以我现在得到了两个下载选项卡,一个用于我的自定义选项卡,一个用于下载扩展程序应该加入,但由于某种原因没有加入。

easytabs.xml:

<?xml version="1.0" encoding="UTF-8"?>
<layout version="0.1.0">
    <default>
        <reference name="head">
            <action method="addItem" ifconfig="easy_tabs/general/enabled"><type>skin_css</type><name>css/easytabs.css</name></action>
        </reference>
    </default>

    <catalog_product_view>
        <reference name="product.info">
            <action method="unsetChild" ifconfig="easy_tabs/general/descriptiontabbed"><name>description</name></action>
            <action method="unsetChild" ifconfig="easy_tabs/general/additionaltabbed"><name>additional</name></action>
            <action method="unsetChild" ifconfig="easy_tabs/general/upsellproductstabbed"><name>upsell_products</name></action>
        </reference>
        <reference name="right">
            <action method="unsetChild" ifconfig="easy_tabs/general/relatedtabbed"><name>catalog.product.related</name></action>
        </reference>
        <reference name="product.info.additional">
            <action method="unsetChild" ifconfig="easy_tabs/general/tagstabbed"><name>product_tag_list</name></action>
            <block type="catalog/product_view_tabs" name="product.info.tabs" as="info_tabs">
                <action method="setTemplate" ifconfig="easy_tabs/general/enabled"><template>easytabs/tabs.phtml</template></action>
                <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/general/descriptiontabbed"><alias>description_tabbed</alias><title>Description</title><block>catalog/product_view_description</block><template>easytabs/description.phtml</template></action>
                <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/general/additionaltabbed"><alias>additional_tabbed</alias><title>Specification</title><block>catalog/product_view_attributes</block><template>easytabs/attributes.phtml</template></action>
                <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/general/upsellproductstabbed"><alias>upsell_products_tabbed</alias><title>We Also Recommend</title><block>catalog/product_list_upsell</block><template>catalog/product/list/upsell.phtml</template></action>
                <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/general/relatedtabbed"><alias>related_tabbed</alias><title>Related Products</title><block>catalog/product_list_related</block><template>easytabs/catalogproductrelated.phtml</template></action>
                <action method="addTab" translate="title" module="tag"     ifconfig="easy_tabs/general/tagstabbed"><alias>tags_tabbed</alias><title>Product Tags</title><block>tag/product_list</block><template>easytabs/catalogproducttags.phtml</template></action>
                <action method="addTab" translate="title" module="review"  ifconfig="easy_tabs/general/reviewtabbed"><alias>review_tabbed</alias><title>Reviews</title><block>review/product_view_list</block><template>easytabs/catalogproductreview.phtml</template></action>
                <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/custom/customtab"><alias>custom</alias><title>Custom tab</title><block>catalog/product_view</block><template>downloads/block_file_links.phtml</template></action>
                <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/custom/customtab1"><alias>custom1</alias><title>Custom tab</title><block>catalog/product_view</block><template>easytabs/catalogproductcustom1.phtml</template></action>
                <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/custom/customtab2"><alias>custom2</alias><title>Custom tab</title><block>catalog/product_view</block><template>easytabs/catalogproductcustom2.phtml</template></action>
                <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/custom/customtab3"><alias>custom3</alias><title>Custom tab</title><block>catalog/product_view</block><template>easytabs/catalogproductcustom3.phtml</template></action>
                <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/custom/customtab4"><alias>custom4</alias><title>Custom tab</title><block>catalog/product_view</block><template>easytabs/catalogproductcustom4.phtml</template></action>
                <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/customcms/tabcms"><alias>cms</alias><title>CMS tab</title><block>core/template</block><template>easytabs/catalogproductcms.phtml</template></action>
                <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/customcms/tabcms1"><alias>cms1</alias><title>CMS tab</title><block>core/template</block><template>easytabs/catalogproductcms1.phtml</template></action>
                <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/customcms/tabcms2"><alias>cms2</alias><title>CMS tab</title><block>core/template</block><template>easytabs/catalogproductcms2.phtml</template></action>
                <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/customcms/tabcms3"><alias>cms3</alias><title>CMS tab</title><block>core/template</block><template>easytabs/catalogproductcms3.phtml</template></action>
                <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/customcms/tabcms4"><alias>cms4</alias><title>CMS tab</title><block>core/template</block><template>easytabs/catalogproductcms4.phtml</template></action>
                <action method="addTab" translate="title" module="downloads">
                    <alias>downloads_test</alias>
                    <title>Downloads test</title>
                    <block>downloads/product</block>
                    <template>downloads/block_file_links.phtml</template>
                </action>
            </block>
        </reference>
    </catalog_product_view>
</layout>

我现在需要删除额外的选项卡,但删除我的引用会删除它们...

解决了:

在我的 addTab 操作之后添加了这个,它删除了额外的选项卡:

<action method="unsetChild"><name>downloads_test</name></action>
4

2 回答 2

0

布局/easytabs.xml:

<?xml version="1.0" encoding="UTF-8"?>
<layout version="0.1.0">
    <default>
        <reference name="head">
            <action method="addItem" ifconfig="easy_tabs/general/enabled"><type>skin_css</type><name>css/easytabs.css</name></action>
        </reference>
    </default>

    <catalog_product_view>
        <reference name="product.info">
            <action method="unsetChild" ifconfig="easy_tabs/general/descriptiontabbed"><name>description</name></action>
            <action method="unsetChild" ifconfig="easy_tabs/general/additionaltabbed"><name>additional</name></action>
            <action method="unsetChild" ifconfig="easy_tabs/general/upsellproductstabbed"><name>upsell_products</name></action>
        </reference>
        <reference name="right">
            <action method="unsetChild" ifconfig="easy_tabs/general/relatedtabbed"><name>catalog.product.related</name></action>
        </reference>
        <reference name="product.info.additional">
            <action method="unsetChild" ifconfig="easy_tabs/general/tagstabbed"><name>product_tag_list</name></action>
            <block type="catalog/product_view_tabs" name="product.info.tabs" as="info_tabs">
                <action method="setTemplate" ifconfig="easy_tabs/general/enabled"><template>easytabs/tabs.phtml</template></action>
                <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/general/descriptiontabbed"><alias>description_tabbed</alias><title>Description</title><block>catalog/product_view_description</block><template>easytabs/description.phtml</template></action>
                <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/general/additionaltabbed"><alias>additional_tabbed</alias><title>Specification</title><block>catalog/product_view_attributes</block><template>easytabs/attributes.phtml</template></action>
                <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/general/upsellproductstabbed"><alias>upsell_products_tabbed</alias><title>We Also Recommend</title><block>catalog/product_list_upsell</block><template>catalog/product/list/upsell.phtml</template></action>
                <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/general/relatedtabbed"><alias>related_tabbed</alias><title>Related Products</title><block>catalog/product_list_related</block><template>easytabs/catalogproductrelated.phtml</template></action>
                <action method="addTab" translate="title" module="tag"     ifconfig="easy_tabs/general/tagstabbed"><alias>tags_tabbed</alias><title>Product Tags</title><block>tag/product_list</block><template>easytabs/catalogproducttags.phtml</template></action>
                <action method="addTab" translate="title" module="review"  ifconfig="easy_tabs/general/reviewtabbed"><alias>review_tabbed</alias><title>Reviews</title><block>review/product_view_list</block><template>easytabs/catalogproductreview.phtml</template></action>
                <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/custom/customtab"><alias>custom</alias><title>Custom tab</title><block>catalog/product_view</block><template>downloads/block_file_links.phtml</template></action>
                <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/custom/customtab1"><alias>custom1</alias><title>Custom tab</title><block>catalog/product_view</block><template>easytabs/catalogproductcustom1.phtml</template></action>
                <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/custom/customtab2"><alias>custom2</alias><title>Custom tab</title><block>catalog/product_view</block><template>easytabs/catalogproductcustom2.phtml</template></action>
                <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/custom/customtab3"><alias>custom3</alias><title>Custom tab</title><block>catalog/product_view</block><template>easytabs/catalogproductcustom3.phtml</template></action>
                <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/custom/customtab4"><alias>custom4</alias><title>Custom tab</title><block>catalog/product_view</block><template>easytabs/catalogproductcustom4.phtml</template></action>
                <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/customcms/tabcms"><alias>cms</alias><title>CMS tab</title><block>core/template</block><template>easytabs/catalogproductcms.phtml</template></action>
                <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/customcms/tabcms1"><alias>cms1</alias><title>CMS tab</title><block>core/template</block><template>easytabs/catalogproductcms1.phtml</template></action>
                <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/customcms/tabcms2"><alias>cms2</alias><title>CMS tab</title><block>core/template</block><template>easytabs/catalogproductcms2.phtml</template></action>
                <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/customcms/tabcms3"><alias>cms3</alias><title>CMS tab</title><block>core/template</block><template>easytabs/catalogproductcms3.phtml</template></action>
                <action method="addTab" translate="title" module="catalog" ifconfig="easy_tabs/customcms/tabcms4"><alias>cms4</alias><title>CMS tab</title><block>core/template</block><template>easytabs/catalogproductcms4.phtml</template></action>
                <action method="addTab" translate="title" module="downloads">
                    <alias>downloads_test</alias>
                    <title>Downloads test</title>
                    <block>downloads/product</block>
                    <template>downloads/block_file_links.phtml</template>
                </action>
                <action method="unsetChild"><name>downloads_test</name></action>
            </block>
        </reference>
    </catalog_product_view>
</layout>
于 2013-03-21T12:29:13.920 回答
0

MageWorx 的文件下载扩展应该与 TM_EasyTabs 完全兼容。问题的最可能原因是 FileDownloads 扩展在 EasyTabs 之前加载。要解决它,请尝试编辑文件 app/etc/modules/MageWorx_Downloads.xml

From:
<config>
    <modules>
        <MageWorx_Downloads>
            <active>true</active>
            <codePool>local</codePool>
            <extension_name><![CDATA[File Downloads & Product Attachments]]></extension_name>
        </MageWorx_Downloads>
    </modules>
</config>

To:
<config>
    <modules>
        <MageWorx_Downloads>
            <active>true</active>
            <codePool>local</codePool>
            <extension_name><![CDATA[File Downloads & Product Attachments]]></extension_name>
            <depends><TM_EasyTabs /></depends>
        </MageWorx_Downloads>
    </modules>
</config>

如果这没有帮助,请随时联系 MageWorx 的支持团队。

于 2015-07-01T10:14:27.847 回答