Version 3.0.2.0
A customer told me they find it annoying to have the page scroll up when the click "add to wishlist".
So I wanted to change that.
I tried changing /template/account/wishlist.twig to include "div style="position:fixed;" in the div, but it seems that file is cached somehow? I cleared all caching but nothing happens? Could it be vqmod?
How else can I change the behavior of what happens when I click "add to wishlist"? it triggers wishlist.add , where is that code located?
Thanks. I tried all the cache clearning but they didn't work.
But it gave me some ideas.
viewtopic.php?t=216444
Here it says how to remove the scroll effect.
Then I changed in stylesheet.css
to add this
.alert-dismissible {
position:fixed;
top: 0;
z-index: 500;
}
Then the alert box will be visible, at least.
Next step will be to make it fade out.
But it gave me some ideas.
viewtopic.php?t=216444
Here it says how to remove the scroll effect.
Then I changed in stylesheet.css
to add this
.alert-dismissible {
position:fixed;
top: 0;
z-index: 500;
}
Then the alert box will be visible, at least.
Next step will be to make it fade out.
catalog/view/javascript/common.js
this part sets the message and does the scrolling:
if you change that, clear your caches, including your browser cache as js is browser cached.
Code: Select all
var wishlist = {
'add': function(product_id) {
$.ajax({
url: 'index.php?route=account/wishlist/add',
type: 'post',
data: 'product_id=' + product_id,
dataType: 'json',
success: function(json) {
$('.alert-dismissible').remove();
if (json['redirect']) {
location = json['redirect'];
}
if (json['success']) {
$('#content').parent().before('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="close" data-dismiss="alert">×</button></div>');
}
$('#wishlist-total span').html(json['total']);
$('#wishlist-total').attr('title', json['total']);
$('html, body').animate({ scrollTop: 0 }, 'slow');
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
},
'remove': function() {
}
}
Code: Select all
if (json['success']) {
$('#content').parent().before('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="close" data-dismiss="alert">×</button></div>');
}
$('#wishlist-total span').html(json['total']);
$('#wishlist-total').attr('title', json['total']);
$('html, body').animate({ scrollTop: 0 }, 'slow');
Who is online
Users browsing this forum: No registered users and 38 guests