store icon indicating copy to clipboard operation
store copied to clipboard

Overlay circles with available colors on apparel

Open cassidyjames opened this issue 5 years ago • 8 comments

If an apparel product (or maybe any product with color options?) has multiple colors available, it'd be nice to overlay little circles w/the available colors on the product listing on the main page. And I guess set the title text for those circles to the color name?

cassidyjames avatar Nov 30 '20 21:11 cassidyjames

This is going to be pretty hard. We would have to fetch every product's information, and then all of the variant information for it. Meaning with our current 19 products, 58 (I think) API requests...

I think the best thing would be to not do this. Otherwise:

  • We do the huge amount of requests and hope stuff doesn't get rate limited
  • We include something in the product title like (Multiple Colors) and parse it out. Show some color wheel like icon

btkostner avatar Jan 04 '21 06:01 btkostner

I'm fine parsing out (Multiple Colors) and then showing something on the index. Actually, to make this more generalizable and flexible, what if we support arbitrary strings between parenthesis or brackets or something, and then we wrap that in a span.callout, then I can do fun things in CSS?

cassidyjames avatar Apr 15 '21 03:04 cassidyjames

Super rough mock:

Screenshot from 2021-04-14 21-07-46

cassidyjames avatar Apr 15 '21 03:04 cassidyjames

I can do that. Do you want the parentheses parsed out everywhere, or just on the index so we can show that bubble? Basically should the cart show how it is now or without the parentheses?

btkostner avatar Apr 15 '21 04:04 btkostner

I think parsed out everywhere; it's already a little weird that we show Terminal Tee – ­Fitted (Multiple Colors) - Black - L or whatever now. It would be cleaner to pull that out and only show it in the span on the index.

cassidyjames avatar Apr 15 '21 18:04 cassidyjames

@btkostner should we do square brackets [] or braces {} to be more explicit (basically, something we won't ever want in the actual product names)? I guess parenthesis () are probably also safe, but I think something more intentional might avoid issues down the line if that's not too much added work.

cassidyjames avatar Apr 15 '21 18:04 cassidyjames

No work at all, it's just regex :tm:. Just let me know what you want in printful and what you want parsed out.

Update: We could also split it to a comma split list. So we could have Terminal Tee {Unisex, Multiple Colors} parse into Terminal Tee with Unisex and Multiple Colors as little bubbles.

btkostner avatar Apr 15 '21 19:04 btkostner

@btkostner I'm a fan of square brackets [] I think, because they won't look super weird if they show up somewhere user-facing but also I don't see us ever wanting them in a real product name. Comma-separation would be neat, too!

cassidyjames avatar Apr 19 '21 18:04 cassidyjames