Any Way To Redirect A Customer To A Link Based On A Keyword In A Checked Out Product Title?

- 1 answer

I need to be able to redirect a customer who buys a certain product to a form for more detailed data collection. Not too experienced with programming but I currently have this in my additional scripts section.

I have searched through all this documentation but have no idea how to implement it.

Currently have this for the keyword autocheckout:

  {% if line.product.handle.includes('**autocheckout**') %}
     <script> window.location =""; </script>
{% break %}
  {% endif %}
{% endfor %}

I expected this to redirect but it doesn't work.



You are close, just need to specify .href,

you currently have

<script> window.location = ""; </script>

just make it this to make it work, it simulates a mouse click

<script> window.location.href = ""; </script>

furthermore you can experiment and try this one out too, it simulates a HTTP redirect

<script> window.location.replace = ""; </script>