svanholm Posted July 21 Share Posted July 21 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 Link to comment
tuanphan Posted July 22 Share Posted July 22 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> Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
svanholm Posted July 22 Author Share Posted July 22 Thanks. That worked well. I guess that product-variants and ProductItem-additional are div-class names. Is there a way to see the names other than "webbrowser code inspector"? Link to comment
svanholm Posted July 22 Author Share Posted July 22 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
svanholm Posted July 23 Author Share Posted July 23 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 tuanphan Posted July 25 Solution Share Posted July 25 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 https://kerstinmartin.com/blog/file-upload https://www.squarewebsites.org/blog/squarespace-websites-uploader Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment