Jump to content

Redirect Quick View button on product page to Add To Cart

Recommended Posts

Any ideas? Hoping for an add to cart button on a product page and this is my best bet

Someone sent me the below, which didnt work


<script>
      $(function() {
        $("#item-5d2755ebe6b58600010e5dea .sqs-product-quick-view-button").replaceWith("<div class="sqs-add-to-cart-button-inner">Add To Cart</div>");        
      });
      </script>


Link to comment
  • Replies 8
  • Views 1.7k
  • Created
  • Last Reply

The code posted above is unique and will only work on the site it was intended for. Please help us to help you by including a working link to a product on your website so that we can see what you are trying to achieve, the template you are using and the settings in use.

If your site isn't live yet, please check the visibility settings to ensure we can view the site content. If the site is still in trial mode you will need to set a site password and tell us what it is.

-Paul

Squarespace Expert & Professional Developer

Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. 
Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links.
Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.

Would you like your customers to be able to mark their favourite products in your Squarespace store?

Link to comment

@jackcavell


try replace:
$("#item-5d2755ebe6b58600010e5dea .sqs-product-quick-view-button").replaceWith("<div class="sqs-add-to-cart-button-inner">Add To Cart</div>");    

with

$(".sqs-product-quick-view-button").replaceWith("<div class="sqs-add-to-cart-button-inner">Add To Cart</div>");    




Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

@jackcavell try


 <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
       $(function() {
         $(".sqs-product-quick-view-button").replaceWith("<div class="sqs-add-to-cart-button-inner">Add To Cart</div>");        
       });
       </script>


Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.