Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: custom URL parameters

custom URL parameters

joaofelipe
New Member
5 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
1831 273 423

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
New Member
5 0 0

So how did these pages I mentioned above do it?

SBD_
Shopify Staff
1831 273 423

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