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

About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥.
Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. 
Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links.
Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional.

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.