Marco Cianetti Posted March 21, 2019 Share Posted March 21, 2019 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. Info: 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} {/block} // In ProductController.php I added $this->ajaxDie(Tools::jsonEncode(array( ... 'my_block_name' => $this->render( 'path/to/tpl-file.tpl', array( 'data' => 'Updated data', ) ), ... )); // I see the correct AJAX response in my network tab 1 Link to comment Share on other sites More sharing options...
Marco Cianetti Posted March 22, 2019 Author Share Posted March 22, 2019 Hi, I found the replacement logic inside core.js file of my theme. Is it safe to edit this file? 😅 // The code I found (0, _jquery2['default'])('#section-id').replaceWith(resp.section_name); Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now