Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- (function() {
- function addToCartHandler() {
- var addToCartButton = document.querySelector('#product_addtocart_form .btn-cart');
- if (addToCartButton) {
- addToCartButton.addEventListener('click', function() {
- if (!window.adoricClickCampaignShowed) {
- setTimeout(function() {
- adoric.trigger('showSunglasses');
- }, 5000);
- }
- window.adoricClickCampaignShowed = true;
- });
- }
- }
- var MAXIMUM_WAITING_TIME = 10 * 1000;/*30 seconds*/
- var waitPageTriggerElement = setInterval(function() {
- var wrapperElement = document.querySelector('#product_addtocart_form .btn-cart');
- if (wrapperElement && adoric) {
- clearInterval(waitPageTriggerElement);
- addToCartHandler();
- }
- }, 200);
- setTimeout(function() {
- clearInterval(waitPageTriggerElement);
- }, MAXIMUM_WAITING_TIME);
- })();
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement