Created
January 12, 2021 14:47
-
-
Save sashabeep/56857f598e8f507869dfac4738e2bd87 to your computer and use it in GitHub Desktop.
Toastify growl for Evolution CMS Commerce
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//using https://github.com/apvarun/toastify-js | |
$(document).on('cart-add-complete.commerce', function (e, params) { | |
var instance = params.data.instance; | |
switch(instance){ | |
case 'comparison': | |
var growlText = "Товар добавлен к сравнению"; | |
var growlLink = "/compare"; | |
break; | |
case 'wishlist': | |
var growlText = "Товар добавлен в избранное"; | |
var growlLink = "/favorites"; | |
break; | |
case 'products': | |
default: | |
var growlText = "Товар добавлен в корзину"; | |
var growlLink = "/cart"; | |
break; | |
} | |
Toastify({ | |
text: growlText, | |
className: "btn-gradient", | |
close: true, | |
destination: growlLink | |
}).showToast(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment