mtm Posted February 3, 2014 Share Posted February 3, 2014 I had no help or any reply with this post and i'm hoping that this time i can get some luck. Maybe it wasn't posted at the right place... Here's what i posted: (PS 1.4.8.2) Hi, I managed to add product image to my block whishlist in header/top of the page (it slides down/up with a click, like the log/sign in at Prestashop site). The problem is that the images (path) get broken when i switch from wishlists in the drop-down list. If i refresh the page, it's ok. It seems that the ajax part is not working and the images are not refreshed... The correct path is /img/p/21-118-small.jpg (ok when i refresh the page or when the product is added). After i change wishlists in the drop-down list, the image is broken and the path changes to /img/p/1/1/8/118-small.jpg. In Chrome's console, i get this error: WishlistChangeDefault.$.ajax.success ajax-wishlist.js:85 and the piece of code in the ajax-whishlist.js file and the line 85 in the WishlistChangeDefault function: function WishlistChangeDefault(id, id_wishlist) { $.ajax({ type: 'GET', url: baseDir + 'modules/blockwishlist/cart.php', async: true, data: 'id_wishlist=' + id_wishlist + '&token=' + static_token, cache: false, success: function(data) { $('#' + id).slideUp('normal'); document.getElementById(id).innerHTML = data; $('#' + id).slideDown('normal'); } }); } The line 85 in the function: document.getElementById(id).innerHTML = data; I tried to follow the blockcart structure (which i also managed to add product images and solved the ajax issue) but it's diferent (easier, imo). I guess something is missing in the cart.php (or somewhere else for sure) file of the block wishlist. Can anyone help me how to figure out this? Thanks. Link to comment Share on other sites More sharing options...
vekia Posted February 3, 2014 Share Posted February 3, 2014 duplicated: http://www.prestashop.com/forums/topic/303629-wishlist-problem-with-ajax-product-image-refresh/?do=findComment&comment=1536330 Link to comment Share on other sites More sharing options...
Recommended Posts