<!-- Redirect to Upsell Page after clicking on Add To Cart Button -->
<!-- Author: Dmitry Kiselyov @_dmitrykiselyov -->
<script>
// /upsell-page is the default URL. To change it, replace /upsell-page with the required URL.
var upsellPageUrl = /complete-content-workbook-bonus;
////////////////////////////////
function redirectToUpsellPageHandler(wrapper){var addToCartButton=wrapper.querySelector(".sqs-add-to-cart-button"),productVariants=wrapper.parentNode.parentNode.querySelector(".product-variants");addToCartButton&&addToCartButton.addEventListener("click",onClick);var shopifyBuyFrame=document.querySelector(".shopify-buy-frame iframe");if(shopifyBuyFrame){var shopifyAddToCartButton=shopifyBuyFrame.contentWindow.document.querySelector(".shopify-buy__btn");shopifyAddToCartButton&&shopifyAddToCartButton.addEventListener("click",onClick)}function isVariantInStock(){return productVariants.getAttribute("data-variant-in-stock")}function onClick(){(productVariants&&isVariantInStock()||!productVariants)&&setTimeout((function(){document.location.href=/complete-content-workbook-bonus}),1200)}}function redirectToUpsellPage(){setTimeout((function(){[].slice.call(document.querySelectorAll(".sqs-add-to-cart-button-wrapper")).forEach(redirectToUpsellPageHandler)}),1500)}document.addEventListener("DOMContentLoaded",redirectToUpsellPage),window.addEventListener("mercury:load",redirectToUpsellPage);
</script>
<!-- end Redirect to Upsell Page after clicking on Add To Cart Button -->