Jump to content

[Question] How to refresh a TPL block after AJAX call

Recommended Posts

Hi guys,

I have a problem with my product page: if I choose a combination of the product the reference code doesn't refresh.

Now I think that the problem is with my block code in the template file.

I found the method displayAjaxRefresh in ProductController.php where other blocks are "refreshed" with Ajax Die.

I want to update my block too but it doesn't work.

Where do I have to implement the "refreshing" logic?

Thank you in advance.


Prestashop version: 1.7

// In my TPL file I have something like this

{block name='my_block_name'}
	{include file="path/to/tpl-file.tpl" data=$some_data}

// In ProductController.php I added

    'my_block_name' => $this->render(
        	'data' => 'Updated data',

// I see the correct AJAX response in my network tab


  • Thanks 1

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More