产品页面上的magento自定义表单

mal*_*kan 5 php magento content-management-system

我是Magento的新手,我需要一些概念指南和/或参考资料.我需要创建自定义表单,它将成为product-info页面的一部分(在它的底部),并将收集用户输入(电子邮件,大小,颜色).只有部分产品具有此功能/形式(由管理员决定).因此,此表单的目标是向商店管理员发送有关库存但不是希望尺寸和/或颜色的产品的电子邮件.我应该自定义现有Contact us表格还是应该在新模块中创建新的自定义表单?
表格应通过电子邮件向管理员提交数据以及产品名称.

Oğu*_*mir 1

好的,首先在 app/design/frontend/[namespace]/[theme]/template/catalog/product/send_request.phtml 下创建一个 .phtml 文件

然后,在/app/design/frontend/[namespace]/[theme]/layout/catalog.xml 中的catalog.xml 中添加此.phtml 文件引用

<block type="core/template" name="customer_request" template="catalog/product/send_request.phtml"/>

以下 : <label>Catalog Product View (Any)</label>

部分,但你应该找到正确的部分放置位置(几次尝试后你会发现)

最后,将您的 php 逻辑添加到send_request.phtml文件中。您在 send_request.phtml 中实现的表单将在产品视图页面下提供。