| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Minicart show on add product | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
Minicart show on add product
I am trying to have the minicart show and then fade after two seconds of showing itself when I add a product. I think I have to edit the ajax.minicart.js file but I just can't find out where. I need to find where the click function is for the div that holds the minicart. Any ideas?
__________________
Sizzle Factor @ www.sizzlefactor.com Simply X-Cart @ www.simplyxcart.com VitalBGS @ www.vitalbgs.com For all of your X-Cart solutions! X-Cart versions 4.4.0 to 5.0 |
|||||||||
#2
|
|||||||||
|
|||||||||
Re: Minicart show on add product
Actually I figured it out.
find these lines in ajax.add2cart.js: // Widget :: ajax callback ajax.widgets.add2cart.obj.prototype.callback = function(state, a, b, c, d) { if (!this.isReady()) return false; var s = false; if (state && c.messages) { for (var i = 0; i < c.messages.length; i++) { if (c.messages[i].name == 'cartChanged' && c.messages[i].params.status == 1 && c.messages[i].params.changes) { for (var p in c.messages[i].params.changes) { if (hasOwnProperty(c.messages[i].params.changes, p) && c.messages[i].params.changes[p].productid == this.productid && c.messages[i].params.changes[p].changed != 0) s = true; } } } } this.changeState(s ? 3 : 4); return true; } Then edit them to: // Widget :: ajax callback ajax.widgets.add2cart.obj.prototype.callback = function(state, a, b, c, d) { if (!this.isReady()) return false; var s = false; if (state && c.messages) { for (var i = 0; i < c.messages.length; i++) { if (c.messages[i].name == 'cartChanged' && c.messages[i].params.status == 1 && c.messages[i].params.changes) { for (var p in c.messages[i].params.changes) { if (hasOwnProperty(c.messages[i].params.changes, p) && c.messages[i].params.changes[p].productid == this.productid && c.messages[i].params.changes[p].changed != 0) s = true; } } } } $('.ajax-minicart-icon').trigger('click'); // CUSTOM ADD TO CART setTimeout(function() { $(".minicart-box").fadeOut("slow"); }, 5000); this.changeState(s ? 3 : 4); return true; } That will allow the cart to appear and fade out after 5 seconds.
__________________
Sizzle Factor @ www.sizzlefactor.com Simply X-Cart @ www.simplyxcart.com VitalBGS @ www.vitalbgs.com For all of your X-Cart solutions! X-Cart versions 4.4.0 to 5.0 |
|||||||||
|
|
|||
X-Cart forums © 2001-2020
|