How can I make the cart button, beside the search bar on top, to blink or glow whenever a customer is adding a product to the cart? Can anyone help me out on this?
Thanks in advance
Blinking Cart & more cart displaying options OC v.2.0.0.0 - 2.3.0.2:
https://www.opencart.com/index.php?rout ... n_id=29290
found here:
https://www.opencart.com/index.php?rout ... ing%20cart
and others also exist, like those linked below:
https://www.opencart.com/index.php?rout ... n_id=26304
https://www.opencart.com/index.php?rout ... n_id=24818
Ernie
https://www.opencart.com/index.php?rout ... n_id=29290
found here:
https://www.opencart.com/index.php?rout ... ing%20cart
and others also exist, like those linked below:
https://www.opencart.com/index.php?rout ... n_id=26304
https://www.opencart.com/index.php?rout ... n_id=24818
Ernie
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Assuming you're using default theme, you must edit these files:
for add to cart button in product page
for add to cart in other pages
Ther are 4 occurrence in this file
find in both file:
replace with:
open your stylesheet file:
add this:
This is a simple effect, you can write your own css.
Tested with OpenCart 2.3.0.2
for add to cart button in product page
Code: Select all
catalog/view/theme/default/template/product/product.tpl
Code: Select all
catalog/view/javascript/common.js
find in both file:
Code: Select all
$('#cart > button').html('<span id="cart-total"><i class="fa fa-shopping-cart"></i> ' + json['total'] + '</span>');
Code: Select all
$('#cart > button').addClass('blinker_cart').html('<span id="cart-total"><i class="fa fa-shopping-cart"></i> ' + json['total'] + '</span>').delay(3000).queue(function(){
$(this).removeClass('blinker_cart');
});
Code: Select all
catalog/view/theme/default/stylesheet/stylesheet.css
Code: Select all
.blinker_cart {
-webkit-animation: blinker_cart 500ms linear infinite;
animation: blinker_cart 500ms linear infinite;
}
@-webkit-keyframes blinker_cart {
50% {
opacity: 0.2;
-webkit-transform: scale(1.04);
transform: scale(1.04);
}
}
@keyframes blinker_cart {
50% {
opacity: 0.2;
-webkit-transform: scale(1.04);
transform: scale(1.04);
}
}
Tested with OpenCart 2.3.0.2
Who is online
Users browsing this forum: Bing [Bot] and 95 guests