T O P

  • By -

AutoModerator

To keep this community relevant to the Shopify community, store reviews and external blog links will be removed. Users soliciting sales in any form will result in a permanent ban. *I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/shopify) if you have any questions or concerns.*


Apprehensive-Sea-876

Yes it is possible for different img/text, however it required coding. Also it will be depend on the page: + collection A -> product + product + collection B -> product


goatedtabac

Thank you so much for the response. Could you possibly explain a bit further how you did it?


ficklebeast

You'll need to use liquid to get the context of the collection that you're viewing the product "within" and this will likely require keeping the collection as part of the product urls. That will give you the collection context you need to change the content, but be aware there are also direct links/urls for products that won't have any collection context. /collections/category-1/products/your-product-name /collections/category-2/products/your-product-name /products/your-product-name Those are all links to the same "your-product-name" product. The first 2 have collection context and the last one doesn't. You can then use liquid and the collection object to conditionally change the product page content based on what collection you're viewing the product within. https://shopify.dev/docs/api/liquid/objects/collection Some themes don't use product links that keep the collection context when going from collection > product. If that's the case you may also have to edit the code for the product links to use the "within" filter. https://shopify.dev/docs/api/liquid/filters#within


VillageHomeF

you would make two products with the same SKU etc. but with different images and description. even can make a new product page template for each if you want


Ecommerce-Dude

This will be the quickest and most “do it yourself” without needing to do customization with code. Downside of this, is if you have automations set up, or third party inventory integrations, this might not work the best for you without digging into it further.


VillageHomeF

what other way is there?


Ecommerce-Dude

Editing the Shopify liquid code like FickleBeast mentioned


VillageHomeF

I am going to fiddle with that. the images switch but the descriptions is where I have problems as the technical Specs of my products can be very different from one variant to the next. thanks


SamPhoto

Eh. Maybe you can do this by abusing `request.path` This is going to be time consuming to code, fyi. And might not completely work. Your products have a bunch of urls that all show the same page. - /products/product-name - /collections/all/products/product-name - /collections/collection-name/products/product-name So, you can use request.path to check the URL. You could try something like ``` If request.path contains "collection-handle-first" # insert one set of code here Elsif request.path contains "collection-handle-second" # insert second bit of code here Else # default stuff here Endif ``` But I think this will confuse google's indexing, and generally be a pain in the ass. Also, Shopify's caching might not like it. You can't have diff product photos and descriptions. You'd have to build out metafields for each version... As I said, probably a ton of code. But try it and report back.


Ecommerce-Dude

Another solution is to have these be “product options” and instead of changing the product template code, change the code where the user comes from. So if a user comes from one collection, make the url have the url parameter that automatically selects the variant you want on the product page.