Clicking add to cart brings user to another product page - Brooklyn Theme

Ceasar
New Member
4 0 0

Hey Shopifiers

I have a pretty unique situation. I need to have one of my products Add To Cart button bring my user to another product page after adding that product to the cart. I also need to customize the text of that button for that page. Any help is much appreciated! As noted in the subject line, I'm working with the Brooklyn theme.

 

Thanks!

0 Likes

Hi @Ceasar ,

What's the link to the page which add to cart button?

Cheers,

ui-gab
https://www.uiavenue.ca
We specialize in data analytics. If I've helped you today, please give our give our app a try (15-day free trial) https://apps.shopify.com/ui-ave-analytics and maybe write a good review.
Send me a message if you want a free data analysis consultation.
0 Likes
Ceasar
New Member
4 0 0

Hey @ui-gab 

 

The page that I need to have the custom Add To Cart button is: https://flashfriction.com/products/half-sole-repair

That page will add the product and then lead to this page: https://flashfriction.com/products/pick-up-fee

pw: temp123

0 Likes

This requires at least moderate knowledge of javascript to do it.

How familiar are you with javascript? If you aren't familiar at all, it can definitely be a bit tricky.

Here's the steps:

  1. Prevent the default function of the add to cart button on this page
  2. Instead make a ajax Post the add to cart
  3. Redirect to that page after

 

Sorry, other than writing the code for you, I can't help very much more.

ui-gab
https://www.uiavenue.ca
We specialize in data analytics. If I've helped you today, please give our give our app a try (15-day free trial) https://apps.shopify.com/ui-ave-analytics and maybe write a good review.
Send me a message if you want a free data analysis consultation.
0 Likes
Ceasar
New Member
4 0 0

Hmm ok. I'm not familiar with JS. But I have an ok brain for code. What would I need to do in order to get the add to cart button redirect to page two while maintaining the page two add to cart buttons destination?

 

 

0 Likes
Ceasar
New Member
4 0 0

I figured out how to alter the button text by using conditionals comparing page.id. So all good on that front. Will be continuing my research on how to adjust the button action.

0 Likes