将独立的 PHP 页面集成到 Prestashop 中和/或修改重写规则
要求是添加一个通过表单向商店地址发送电子邮件的功能。这是为那些希望了解自己是否有资格获得 5 欧元奖金的游客提供的。
我已经完成了一个独立的脚本来满足此要求,并且当我输入完整的网址时,表单会按应有的方式显示。但是,单击产品描述中相同 url 的链接会产生 404。
这是否是由于 url 重写造成的? PHP 页面可以与 Prestashop 共存吗?或者我应该编写某种准系统模块来适应?
The requirement is to add a feature that sends an email to the shop's address through a form. This is for visitors that wish to find out if they're eligible for a 5 euro bonus.
I've done a standalone script that fills in this requirements and the form appears as it should when I enter the full url. However, clicking on a link to the same url from a product description produces a 404.
Could this be due to url rewriting? Can the PHP page co-exist with Prestashop or should I write a barebones module of some sort to fit in?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在您修改问题以使您达到-2 后,我给您投了赞成票。我希望这有帮助。
我不熟悉 Prestashop,但如果它使用 PHP(我相信它是因为您的标签),您可以尝试以下操作:
1 - 您可以向提交按钮添加事件侦听器。当按下表单提交按钮时,该函数将向服务器发送 Ajax 请求以发送电子邮件。
单击提交按钮时将调用 function_to_execute()。
您可以将此代码添加到表单所在的脚本中,或者如果您不想破解 Prestashop 代码,您可以使用 php.ini 将其添加到所有脚本中。只需添加:
我相信这可能有效。祝你好运!
I upvoted you after you revised the question to get you to -2. I hope this helps.
I am not familiar with Prestashop, but if it uses PHP which I believe it does because of your tags you can try a few things:
1 - you can add an event listener to the submit button. When the form submit button is pressed, the function will send an Ajax request to the server to send the email.
The function_to_execute() will be called when the submit button is clicked.
You can add this code to the script where the form is, or if you don't want to hack Prestashop code you can prepend it to all scripts using php.ini. Just add:
I believe this might work. Good luck!