开发者

Integrate a standalone PHP page into Prestashop AND/OR modify rewrite rules [closed]

开发者 https://www.devze.com 2023-04-02 23:54 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

The requirement is to add a feature that sends an email to the shop's addre开发者_C百科ss 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?


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.

window.addEvent('load', function() {
    var foo = document.getElementById("bar");   
    foo.addEventListener("click", function_to_execute(), false);
}

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:

auto_prepend_file = "/path/to/file/with/function.php"

I believe this might work. Good luck!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号