Jump to content

Moving an Additional Info-form on product page

Go to solution Solved by tuanphan,

Recommended Posts

Hello

I have added code that creates a form as my additional information on a product page. I would like that form to be placed where the arrow points, or before the black button. I have tried adding some code to the footer, but I havent been able to achieve what I want. Can someone please help? 🙂

Also, is there a way to edit the code that makes up the product page directly? That would be convinient.

Also 2, is it possible to insert this form on this spot on all my products in an easy and efficient way?

https://www.sagospegeln.se/butik/p/country-feast-set-3nybt-aclmx

image.thumb.png.9907e9206909b8aebb65037406c8a856.png

Link to comment

Add to Settings > Developer Tools > Code Injection > Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
  $(document).ready(function() { 
    $('section.ProductItem-additional').insertBefore('.product-variants');
	});
</script>

image.thumb.png.28ad6367d50e12470098cc08e115d517.png

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

Hello

This is the link to the page: https://www.sagospegeln.se/butik/p/milk-dip-cup-92wf6-7jbr7

I now have two buttons on this product page. One for uploading some data, and one for adding the product to the cart. This is obviously a bad idea. I want to remove the first button "Skicka in" (I know how to), and make it so that the "Lägg i kundvagnen"-button also runs the first buttons function.

This is what I have currently injected in the footer. The first part is changing the location of some stuff.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
  $(document).ready(function() { 
    $('section.ProductItem-additional').insertBefore('.product-variants');
    });
  
  $("#yui_3_17_2_1_1690040888674_281").on("click", 
                      function(e){
                        alert("Hello");                      
    });
</script>

I think the idea of second part of the code is correct, but it is not working - I am not getting an alert. Is the ID of the button wrong? If only I can get an alert, I think I can add the first buttons functionality.

 

Link to comment

Hello

This is the link to the page: https://www.sagospegeln.se/butik/p/milk-dip-cup-92wf6-7jbr7

I now have two buttons on this product page. One for uploading some data, and one for adding the product to the cart. This is obviously a bad idea. I want to remove the first button "Skicka in" (I know how to), and make it so that the "Lägg i kundvagnen"-button also runs the first buttons function.

This is what I have currently injected in the footer. The first part is changing the location of some stuff.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
  $(document).ready(function() { 
    $('section.ProductItem-additional').insertBefore('.product-variants');
    });
  
  $("#yui_3_17_2_1_1690040888674_281").on("click", 
                      function(e){
                        alert("Hello");                      
    });
</script>

I think the idea of second part of the code is correct, but it is not working - I am not getting an alert. Is the ID of the button wrong? If only I can get an alert, I think I can add the first buttons functionality.

Link to comment
  • Solution
On 7/23/2023 at 4:08 PM, svanholm said:

Hello

This is the link to the page: https://www.sagospegeln.se/butik/p/milk-dip-cup-92wf6-7jbr7

I now have two buttons on this product page. One for uploading some data, and one for adding the product to the cart. This is obviously a bad idea. I want to remove the first button "Skicka in" (I know how to), and make it so that the "Lägg i kundvagnen"-button also runs the first buttons function.

This is what I have currently injected in the footer. The first part is changing the location of some stuff.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
  $(document).ready(function() { 
    $('section.ProductItem-additional').insertBefore('.product-variants');
    });
  
  $("#yui_3_17_2_1_1690040888674_281").on("click", 
                      function(e){
                        alert("Hello");                      
    });
</script>

I think the idea of second part of the code is correct, but it is not working - I am not getting an alert. Is the ID of the button wrong? If only I can get an alert, I think I can add the first buttons functionality.

Hi,

This is not possible. You can consider using custom product form

https://support.squarespace.com/hc/en-us/articles/205811218-Creating-a-custom-product-form

and use this guide to add upload field to form

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

Create an account or sign in to comment

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

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