Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
314 views
in Technique[技术] by (71.8m points)

php - Calling Prestashop postProcess method

I'm actually developing a payment method module for Prestashop 1.7 but now I'm stuck with the postProcess() method on my payment page, the method is being called immediately when the payment page loads. Do you know why this is happening? My payment.tpl its a simple html form to perform a POST request.

Thanks in advance.

question from:https://stackoverflow.com/questions/65944556/calling-prestashop-postprocess-method

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Solved. Its needed a validation because the postProcess runs after init() and before initContent():

public function postProcess()
{
    if (!empty($_POST))
    {
    // Magic here!
    }
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...