Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0
jackcavell

Redirect Quick View button on product page to Add To Cart

Question

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>


Edited by jackcavell
Initial Revision

Share this post


Link to post

8 answers to this question

Recommended Posts

  • 0

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


World-class Squarespace Developer and Squarespace Circle Leader with a strong reputation on the Squarespace Forum.
I'm trusted by hundreds of Squarespace users worldwide, including designers, freelancers, business owners and big agencies.

I can tackle anything from small tweaks to full websites and I'm available for short and long bookings (min. 1 hour).
Book via my website giving as much notice as possible. Note that I'm usually booked 4 - 6 weeks in advance for jobs longer than 2 hours.
Prebuilt Squarespace Extensions
Custom Squarespace Extensions: Tell me about the functionality you need

**NEW** Our popular Enquiry Form ExtensionDate Picker Extension and Age Verification Extension are now Squarespace 7.1 compatible.

Share this post


Link to post
  • 0

@jackcavell Can you share your site url?


Send me a message if you have any questions (free 10 minutes).

4000+ free code: Adirondack - Avenue - Brine - Bedford - and more (all 7.0 template & 7.1)

Useful guide: How to share url (trial plan) - 2 languages site - 3 languages

Plugins: Product Enquiry Form - Product Color/Image Swatch VariantLightbox Anything

Learn CSS Basic: Treehouse - W3Schools - Flexbox

Other groups: SS Customization Resource Group - SS CSS Support - SS Community

 

Share this post


Link to post
  • 0

@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>");    





Send me a message if you have any questions (free 10 minutes).

4000+ free code: Adirondack - Avenue - Brine - Bedford - and more (all 7.0 template & 7.1)

Useful guide: How to share url (trial plan) - 2 languages site - 3 languages

Plugins: Product Enquiry Form - Product Color/Image Swatch VariantLightbox Anything

Learn CSS Basic: Treehouse - W3Schools - Flexbox

Other groups: SS Customization Resource Group - SS CSS Support - SS Community

 

Share this post


Link to post
  • 0

@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>



Send me a message if you have any questions (free 10 minutes).

4000+ free code: Adirondack - Avenue - Brine - Bedford - and more (all 7.0 template & 7.1)

Useful guide: How to share url (trial plan) - 2 languages site - 3 languages

Plugins: Product Enquiry Form - Product Color/Image Swatch VariantLightbox Anything

Learn CSS Basic: Treehouse - W3Schools - Flexbox

Other groups: SS Customization Resource Group - SS CSS Support - SS Community

 

Share this post


Link to post
  • 0

Nothing, it's still just opening quick view

I'm open to any other suggestions for showing an add to cart button for each product, this just seamed like the easiest option but maybe not!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...