gpt4 book ai didi

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

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:45:32 25 4
gpt4 key购买 nike

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

最佳答案

好的,那么首先在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 中实现的表单将在产品 View 页面下可用。

关于php - 产品页面上的 magento 自定义表单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8961623/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com