Jump to content

TylerJ

Member
  • Posts

    15
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

TylerJ's Achievements

  1. @creedon Thank you so much that worked. I did try something similar but I must have had something wrong.
  2. I tried copying that code and altering as it says. If I add multiple SKUs separated by , all on one line directed to one https://www.eventmamas.com/schedule, it does not redirect to that url. It redirects to https://www.eventmamasaz.com/shop/p/undefined If I add a separate line with only one SKU to a different url then any of the above SKUs add the item to cart. If I // the multiple SKU line then the single line works perfectly fine. Here is what I currently have and any SKU I click on just adds the item to the cart. What might I be doing wrong here? <script> $( ( ) => { debugger; const skuUrlMappings = { /* skus can be copied from a product item if you need more than one mapping then copy the line below, remove the "// " at the beginning of the line and enter the appropriate data */ 'SQ7877615, SQ3509884, SQ4108194, SQ5455403, SQ3834839, SQ4203701, SQ7273848, SQ3017341, SQ3998078, SQ1359881, SQ8312462, SQ1315619, SQ0851290, SQ4883355, SQ5433660, SQ3141676, SQ4329238, SQ0133624, SQ6412197, SQ5472623, SQ5632106, SQ7190695, SQ0487376, SQ2342351, SQ3054355': 'https://www.eventmamasaz.com/schedule' // last or only item doesn't get a comma at the end 'SQ6096208': 'https://www.eventmamas.com/contact' } // do not change anything below, there be the borg here if ( ! $( '.ProductItem' ).length ) return; const sku = Static.SQUARESPACE_CONTEXT.product.variants [ 0 ].sku; if ( ! sku in skuUrlMappings ) return; var $addToCartButton = $( '.sqs-add-to-cart-button' ); var $addToCartButtonClone = $addToCartButton.clone ( ) .click ( function ( ) { window.location = skuUrlMappings [ sku ]; } ); $addToCartButton.replaceWith ( $addToCartButtonClone ); } ); </script>
  3. @creedon As an update, I used the OPs CSS that she posted to remove the “Add to cart” button and create a button from a link which placed it where I want it. I managed to get the background color changed and the font color changed. What data do I need to add to make the size and shape of the button the same as the standard add to cart button? I tried adding as much as I could into custom CSS by going to another page and right click then inspect on a button but I could not seem to find what would change the shape and size. URL that has the button to be changed is http://www.eventmamasaz.com/shop/p/custom URL with a button I want to duplicate is http://Www.eventmamasaz.com/shop/p/birthday
  4. Here is the URL directly to the product I would like directed to contact instead of to the schedule. https://www.eventmamasaz.com/shop/p/custom password = password
  5. I have figured out the creating a button part but I can’t seem to get it where I want it. I would like to have it positioned where the current add to cart button is located
  6. @Jigbyjim @Challenger2 @cooltightyeahbro @actualhuman @Lfost411 I recently got help on doing this in another thread (Redirect “Add To Cart” button to scheduling app). Two things will need to be done: This answer was provided to me by @creedon Add the following to Settings > Advanced > Code Injection > HEADER. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> The second thing you will need to do is: Add the following to Store Settings > Advanced > Page Header Code Injection. <script> $( ( ) => { var url = 'https://www.squarespace.com/'; var $addToCartButton = $( '.sqs-add-to-cart-button' ); var $addToCartButtonClone = $addToCartButton.clone ( ) .click ( function ( event ) { window.location = url; } ); $addToCartButton.replaceWith ( $addToCartButtonClone ); } ); </script> Replace https://www.squarespace.com with the url you want to link to leaving the ‘ ‘ around the url. You can add custom button text on on the edit product page.
  7. @creedon@bangank36 I saw above that the OP removed the button and created her own button. Where would I find the data to recreate the original button so it looks the same on my page? I need 1 of my products to link to my contact page rather than scheduling. Or is there a different way of doing this within the script that was already added to my page header code injection page? As a side note @bangank36, since this does still seem to relate to this same thing I have removed my other post to prevent cluttering the forum with duplicate information.
  8. https://circle-hexahedron-azm6.squarespace.com/shop/p/lily-xgc3d password = password
  9. I tried adding this to my page because I need a similar setup but it still just adds the button to the cart. I am very new to this. My domain transfer is still in process so the URL is just the temp that is automatically generated by squarespace which requires a password currently to view. I'm not sure exactly what to do for you to be able to view the site.
  10. Were either of you able to come up with a solution. I am having a similar struggle. My business is renting yard displays for special occasions and I need to have customers be able to view available inventory for a certain date then checkout through commerce and have it automatically add them to my acuity schedule.
×
×
  • 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.