Menu Close
    Start a Project Request quote Reading list Switch to dark mode

    Hide Header and Footer HTML in AJAX response using Front Controller

    When we have to use Ajax in Prestashop front development, we have to create a file where we can perform the process. Generally, we have created an ajax folder and in that folder, we create and file ajax.php for our ajax processing, in this file we have to load Prestashop Classes by including file.

    But instead of this, we can create a PrestaShop front controller and use this front controller for ajax processing.

    Simply create a Front controller if not exist OR use the existing controller and process your Ajax on the same.

    Prestashop front controller always has the HTML of Header and Footer, So while ajax response, we have to hide them.

    If we are using the existing Front Controller where the other operation also performs, We have to create a condition in which we can hide the header and footer

    Define display_header and display_footer variable false in Front Controller file init function

    Otherwise, simply define init function like this,

    . . .


    Add Your Comment

    Be the first to comment.

    Back to Top
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just recieved your project brief and our expert will contact you shortly.
    Send Again