Add To Cart Redirect to Custom page

Solved
AmirLu
Tourist
4 1 2

Hey Everyone!

I'm wondering if it's possible when a customer clicks on "Add to Cart" button on the product page, it'll redirect them to a custom page on my site?

The idea stems from the fact that I'm currently doing market research of the product that I'm going to sell (we have no inventory of the product yet) and would like to gauge interest of the product. The idea is that someone clicks on add-to-cart, lands on a custom page and they'll be a pop-up saying that the product is finish and they could insert their email to be notified when it's restocked.  I'll be able to track all of this via Google Analytics (for the events of clicking add to cart, landing on the custom page and how many actually filled in their emails). 

Thanks!

Accepted Solution (1)

Accepted Solutions
AmirLu
Tourist
4 1 2

This is an accepted solution.

Hi everyone, 

I've found the solution to this already. I'll be sharing it here in case anyone else wants to do the same thing as me. Do note I'm using the Debut theme as of 23/20/2021. This may or may not work depending when you're reading this but you can definitely give it a shot!

Click "Edit Code" for your theme, then:

  • Find theme.js and click it
  • Once it opens, press CTRL+F to open the search function and search for "self._setupCartPopup(json);"
  • Underneath "self._setupCartPopup(json);", type in "location.href="paste-your-page-link-here";
  • Press save

It should look something like this when you're done:

          self._setupCartPopup(json);
        	location.href="https://yourstore.com/pages/your-new-page";

 

Hope this helps someone else! 

Cheers. 

 

View solution in original post

Replies 5 (5)
KetanKumar
Shopify Partner
24945 2500 9043

@AmirLu 

yes please add your custom page url but that was all products go to  custom page is this fine?

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
AmirLu
Tourist
4 1 2

Hey @KetanKumar!

Thanks for the speedy reply. 

For the answer to your question: Yes, it's okay if all products go to the custom page. This is no problem, as we're just currently gauging market interest. 

The link to the page is: https://beribuddy.com/pages/our-products-just-ran-out

The site theme is Debut. 

Currently the site is password protected. Do you require the password? 

KetanKumar
Shopify Partner
24945 2500 9043

@AmirLu 

yes i need it

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
AmirLu
Tourist
4 1 2

@KetanKumar 

The password is: brewth

Thanks and looking forward for your solution :)!

AmirLu
Tourist
4 1 2

This is an accepted solution.

Hi everyone, 

I've found the solution to this already. I'll be sharing it here in case anyone else wants to do the same thing as me. Do note I'm using the Debut theme as of 23/20/2021. This may or may not work depending when you're reading this but you can definitely give it a shot!

Click "Edit Code" for your theme, then:

  • Find theme.js and click it
  • Once it opens, press CTRL+F to open the search function and search for "self._setupCartPopup(json);"
  • Underneath "self._setupCartPopup(json);", type in "location.href="paste-your-page-link-here";
  • Press save

It should look something like this when you're done:

          self._setupCartPopup(json);
        	location.href="https://yourstore.com/pages/your-new-page";

 

Hope this helps someone else! 

Cheers. 

 

View solution in original post