模仿Magento的“选择产品"功能-如小部件中所示 [英] Mimic the Magento 'select product' functionality - as seen in the widget

查看:88
本文介绍了模仿Magento的“选择产品"功能-如小部件中所示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人成功地从一个标准小部件中复制了选择产品"功能,并在自己的自定义(admin)模块中使用了该功能吗?

Has anyone successfully managed to copy the 'select product' functionality from one of the standard widgets and use it in their own custom (admin) module?

我有一个自定义模块(带有管理界面),我希望通过允许管理员使用与catalog-product-select中相同的功能从目录中选择现有产品,来对其进行一些改进.小部件.也就是说,我的管理员应单击一个按钮,这将启动带有树形和网格UI的ajax层(弹出窗口).

I have a custom module (with an admin interface) that I'd like to improve slightly by allowing the administrator to select an existing product from the catalog using the same functionality that I've seen in the catalog-product-select widget. I.e my adminstrator should click on a button and that would launch an ajax layer (popup?) with the tree and grid UI.

尝试对该功能进行反向工程后,我可以看到该小部件正在使用Mage_Adminhtml_Block_Catalog_Product_Widget_Chooser.php文件.

Having attempted to reverse engineer this functionality, I can see that the widget is using the Mage_Adminhtml_Block_Catalog_Product_Widget_Chooser.php file.

尽管理想情况下,我将非常感谢与此有关的任何信息/链接,如果没有人知道如何执行此操作,那么谁能向我展示一些执行第一步的代码-在ajax层中启动php文件弹出窗口.

Although ideally I'd very much appreciate any info / links on this, if no-one knows how to do this, then can anyone show me some code to do the first step - to launch a php file within an ajax layer popup.

预先感谢, 伊恩

推荐答案

以下代码将执行以下操作:

following code will do this:

<choose_product>
    <label>Choose Product</label>
    <visible>1</visible>
    <required>1</required>
    <type>label</type>
    <helper_block>
        <type>adminhtml/catalog_product_widget_chooser</type>
        <data>
            <button translate="open">
                <open>Select Product...</open>
            </button>
        </data>
    </helper_block>
</choose_product>

只需将其添加到widget.xml中的参数"部分

just add that to your "parameters"-Section inside your widget.xml

这篇关于模仿Magento的“选择产品"功能-如小部件中所示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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