Jump to content

anazaragoza

Circle Member
  • Posts

    3
  • Joined

  • Last visited

Everything posted by anazaragoza

  1. Hi! I have found a useful code that I can add to my product info for redirecting to an upsell page when my clients add to cart from the product page. But I would need to make it work also when they just add the product to the cart from the single button I have embedded on the sales page. Could anyone help me with this? My sales page for that product is: https://anazaragoza-copywriter.com/sistema-revivir-web-muerta And the code is this one: <!-- 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 = "/upsell-page" //////////////////////////////// function redirectToUpsellPageHandler(wrapper){var addToCartButton=wrapper.querySelector(".sqs-add-to-cart-button"),productVariants=wrapper.querySelector(".product-variants");function isVariantInStock(){return productVariants.getAttribute("data-variant-in-stock")}function onClick(){(productVariants&&isVariantInStock()||!productVariants)&&setTimeout((function(){document.location.href=upsellPageUrl}),1200)}addToCartButton&&addToCartButton.addEventListener("click",onClick)}function redirectToUpsellPage(){var productPage=document.querySelector(".collection-type-products.view-item #productDetails, .collection-type-products.view-item .ProductItem-details"),productBlocks;productPage&&redirectToUpsellPageHandler(productPage),[].slice.call(document.querySelectorAll(".sqs-block-product")).forEach(redirectToUpsellPageHandler)}document.addEventListener("DOMContentLoaded",redirectToUpsellPage),window.addEventListener("mercury:load",redirectToUpsellPage); </script> <!-- end Redirect to Upsell Page after clicking on Add To Cart Button --> I suppose is just to modify sth here. Thank you very much, Ana
  2. Hi, this code is really useful. Thank you. But I would need some help to make it working when my clients add a product to their cart directly from my sales page (not from the product page). My sales page is: https://anazaragoza-copywriter.com/sistema-revivir-web-muerta Could that be possible? Anyone could help? Thank you. This is the code I was inserting on the product: <!-- 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 = "/upsell-page" //////////////////////////////// function redirectToUpsellPageHandler(wrapper){var addToCartButton=wrapper.querySelector(".sqs-add-to-cart-button"),productVariants=wrapper.querySelector(".product-variants");function isVariantInStock(){return productVariants.getAttribute("data-variant-in-stock")}function onClick(){(productVariants&&isVariantInStock()||!productVariants)&&setTimeout((function(){document.location.href=upsellPageUrl}),1200)}addToCartButton&&addToCartButton.addEventListener("click",onClick)}function redirectToUpsellPage(){var productPage=document.querySelector(".collection-type-products.view-item #productDetails, .collection-type-products.view-item .ProductItem-details"),productBlocks;productPage&&redirectToUpsellPageHandler(productPage),[].slice.call(document.querySelectorAll(".sqs-block-product")).forEach(redirectToUpsellPageHandler)}document.addEventListener("DOMContentLoaded",redirectToUpsellPage),window.addEventListener("mercury:load",redirectToUpsellPage); </script> <!-- end Redirect to Upsell Page after clicking on Add To Cart Button -->
×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.