Zipcode based catalog

Highlighted
New Member
3 0 0

Hi Everyone,

I would like to offer a location based product catalog to the end users. Here is what I have in mind:

1. User visits our store at www.example.com/

2. We present a page asking the user to enter their zip code. User presses submit and we validate if we have a supplier in that zipcode. If Yes, we let the end user confirm the supplier.

3. At this point the user's supplier is set

4. At this point, I would like to only show those collections to the enduser that correspond to user selected supplier.

In terms of implementation, my original thought was that I could simply write a shopify app to validate the zipcode and find the list of suppliers in that area code. And I was planning to set this as a cookie.

However, it seems I can't depend on the cookies in the liquid templates to conditionally select the collections to display. Is there another way possible? Would deeply appreciate any insights.

On the similar lines, is it possible to restrict the product search to a collection? E.g. search/all_supplier_1?

Thanks in Advance

Vivek

0 Likes
Highlighted
Shopify Partner
2163 102 307

4. At this point, I would like to only show those collections to the enduser that correspond to user selected supplier.

Use metafields, or tags, on collections for supplier names, match to customer supplier. 

write a shopify app to validate the zipcode and find the list of suppliers in that area code

https://help.shopify.com/api/reference/fulfillmentservice , or https://help.shopify.com/api/reference/carrierservice depending on how the stream is setup.

And I was planning to set this as a cookie.

Use customer tags , add tag during signup, but note edit&delete management needs to be through the api.

On the similar lines, is it possible to restrict the product search to a collection? E.g. search/all_supplier_1?

In search.liquid match the collection to the set supplier, or to use ajax

/search?view=json&type=product&q=whatever  by making an alternate template search.json.liquid, more advanced usage should look at solr engine documentation

also see. https://help.shopify.com/themes/liquid/objects/search

 

I'm hireable for liquid customizations like this, app implementations require much more detail.

 

Problem Solved? ✔️Accept and ? Like the solution so you can help others.
Buy me a coffee ☕ paypal.me/paulnewton or donate to eff.org
Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com
0 Likes
Highlighted
New Member
3 0 0

Paul, 

Thank you so much for your response. I am still not fully clear on this. 

You said:

Use metafields, or tags, on collections for supplier names, match to customer supplier. 

How do I get the customer supplier? If the customer supplier is stored in the browser cookie, how do I obtain it in the liquid template so I can match it with metafields or tags on collection?

Using the customer tags is an interesting idea, however it seems it requires that a user is logged in. I would like to be able to simply have users enter their zip code and then tailor the catalog according to what is available in their area. Ideally simply show only a set of collections e.g. collection1_supplier1 collection2_supplier1 etc.

Re: Search

Am I correct in assuming that the solution you mentioned for search requires that the user be logged in?

Again greatly appreciate your time as well as additional further insights.

Best Regards

Vivek

 

0 Likes
Highlighted
Shopify Partner
2163 102 307

To be clear from here out User = user without customer account, Customer = user with account and logged in. 

A thing to know that changes how this is done verus other platforms is There is no form processing native to shopify.  What you want to do is similar to using customer accounts as a standard design model for location based supply chains(like wholesale,resellers,etc). Without customer accounts,your just applying a filter(tags,views) to the whole site. This could also mean your catalog is even more complicated as you could want products to never show unless a zipcode is set account or no account. And that's before even considering if urls should be shareable per location.

How do I get the customer supplier?

With Customer's via customer-tags, for regular Users via ajax(pages),apps,proxy-apps.

If the customer supplier is stored in the browser cookie, how do I obtain it in the liquid template so I can match it with metafields or tags on collection?

Your providing the name of the supplier correct?

Simple answer you don't. Difficult answer you could do this with a proxy app but that's potential overkill. Without having the data at render time you need to serve either the entire data-set or enough to use some other method(ajax,proxy,api). Then hide what doesn't match.

 

Using the customer tags is an interesting idea, however it seems it requires that a user is logged in.

Yes, this reduces the amount of data you have to send to the Customer . Otherwise ,typically, you have to pre-render the dataset  then send it to the users browser then do the filtering client-side (perf hit).

I would like to be able to simply have users enter their zip code and then tailor the catalog according to what is available in their area.

That's an easy to say outcome statement, actual implementation solutions not so much. Contrast with the checkout|order side, there the go to answers are simpler: carrier or fulfillment service api's.

But without customer accounts how this has to be implemented for the frontend isn't a simple button press if you want the users to be the ones with a simple button press.

Ideally simply show only a set of collections e.g. collection1_supplier1 collection2_supplier1 etc.

 If you have a only a handful of suppliers use alternate templates and the view param. Upside of if you can do this is urls are more shareable.

 

Re: Search

Am I correct in assuming that the solution you mentioned for search requires that the user be logged in?

 No.

 

Problem Solved? ✔️Accept and ? Like the solution so you can help others.
Buy me a coffee ☕ paypal.me/paulnewton or donate to eff.org
Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com
0 Likes
Highlighted
New Member
3 0 0

Can you help me ? i heve the same problem

0 Likes