Home / Prestashop Module Tutorials / Ap Page Builder / Error Address token not defined when create or edit widget | Ap Pagebuilder Module

Error Address token not defined when create or edit widget | Ap Pagebuilder Module


Ap Page builder – a powerful module with strong features in back-office that allow you to manage, customize, edit your website quickly.  One of the outstanding functions of this Prestashop Module is to make it possible for you to create and edit widgets in Ap Hook Builder.


1. Edit Widget in Ap Hook Builder

You can easily edit HTML right on a popup with available handy options.



2. Error when create and edit widget

However, sometimes, when you create and edit the widget, the popup doesn’t display the right options for you to edit. You can realize this error displayed at all widgets that have edit part as the picture below


Error in Edit HTML
Error in Edit HTML


When facing this problem, do not panic.

what you need to do first is to press F12 then select Console, you will see the error report:

Uncaught ReferenceError: address_token is not defined in file admin.js?v=


Error address token not defined
Error address token not defined


Now I will guide you on how to deal with it.

Firstly, you access the file via Ftp YOUR_SITE/modules/appagebuilder/views/js/admin/home.js

then find code inline 574

$('#modal_form .modal-body').html(data);


replace to 

//fix bug prestashop can not get address_token

  if (typeof address_token === "undefined") {
var match = RegExp('[?&]' + 'token' + '=([^&]*)').exec(window.location.search);
address_token = match && decodeURIComponent(match[1].replace(/\+/g, ' '));
$('#modal_form .modal-body').html(data);


or you can download in this URL and replace


Now everything is back to work. You can continue to create and edit the widget.

Good luck with Ap Page Builder Module.


About Luu Ly

Check Also


How to install Prestashop speed optimization module – Leo Speed for your website?

Website’s speed plays an extremely important role in bettering user experience, improving your website SEO, …


  1. Hello,

    It doesn’t work for me, I installed the file in the right place but I still have the “token” error and cannot modify the description of the image. What should I do ?

    Thank you so much


  2. Hello,

    I apologize for my very bad English.

    I bought a “Leo Clarck” template for Prestashop and I have a problem. The Apollo page Builder module does not work. Indeed.
    I cannot modify elements which I put in the positions, that makes me jump the editors and oblige me after each modifications to save quit then return to be able to modify again.
    I noticed with the console that I had this concern: ReferenceError: address_token is not defined

    Please tell me how to solve my problem.

    I use Prestashop 1.7.6.x

Leave a Reply