Join us for an upcoming Shopify Partner webinar on February 27, 2024. Discover the latest Checkout Extensibility features, and deep dive on improvements to Shopify Functions and Web Pixels. Register now for either the 10am EST or 2pm EST sessions.

custom URL parameters

joaofelipe
Visitor
3 0 0

I want to do the following: when a customer clicks on an ad for a product, this product X appears first in the collection. When you click on an ad for product Y, that product appears first in the SAME collection. I want to do this countless times for countless products. other platforms that copy Shopify do this. How can I do it? I will leave some examples below:

 

https://www.sisterparty.com/collections/best-seller

https://www.sisterparty.com/collections/best-seller?from_short_url=true&id=6ce602dc-6ee7-4158-b99b-e...

 

https://www.sisterparty.com/collections/best-seller?from_short_url=true&id=39d5aba5-76d3-4bd1-b8f4-c...

 

see that the collection is the same, the only thing that changes are the URL parameters and the products

Replies 3 (3)

SBD_
Shopify Staff
1779 263 383

Hey @joaofelipe 

 

Unfortunately this would only be possible client-side / using JavaScript. Which would break (or require multiple page fetches) if the collection had > 50 products.

Scott | Developer Advocate @ Shopify 

joaofelipe
Visitor
3 0 0

So how did these pages I mentioned above do it?

SBD_
Shopify Staff
1779 263 383

Without digging into their code it's tricky to tell. Either some client-side JS, or maybe a hack like this.

Scott | Developer Advocate @ Shopify