#Connect MAIN and PREVIEW of Digital Product?

33 messages · Page 1 of 1 (latest)

soft pumice
#

According to this documentation https://docs.medusajs.com/recipes/digital-products how MAIN and PREVIEW are connected?
When I need to create MAIN and PREVIEW I'm creating 2 different records in product_media table but there is no way to use same variant_id?
It looks like i don't have an option to connect MAIN and PREVIEW of same Digital product through same variant_id in the UI?
Documentation is wrong or I made some mistake? Can someone help me?

This document guides you through the different documentation resources that will help you build digital products with Medusa.

ionic rune
#

So if you follow that recipe, main is what would be delivered to end user. Preview should be a reduce/watermarked version of Main, that end user can download on the product page on the frontend.

soft pumice
#

yep thank you on quick answer.
I understand that but I'm wondering what I'm doing wrong since i can't get Preview.

Is it working for you?

ionic rune
#

yes works for me on desktop, just noticed it doesnt on mobile. But i am serving it up via S3 endpoint

soft pumice
#

hm i was trying whole day today to figure it out what is happening and still dont know

#

when you click download preview it fetches product with type PREVIEW you created through ProductMediaCreateForm

#

right?

#

I followed recipe and it tries to fetch product PREVIEW via product MAIN variant_id and it fails because those 2 records have different variant_Ids

#

sorry for bothering but im very curios what im doing wrong

ionic rune
#

are you on v1 or v2?

soft pumice
#

v1

ionic rune
#

ahh i have no experience ther elol

soft pumice
#

you followed recipe for v2?

ionic rune
#

yeah i followed v2 recipe

#

wait, did you add the preview button to the store front

soft pumice
#

yep

#

it works if i change product type to main

#

since i can get product with MAIN type when fetching with given variant_id

ionic rune
#

ah in v2 i can add both multiple previews and multiple mains

#

based on your video looks like can only do one or the other?

soft pumice
#

is v2 stable ?

#

im planning to create webshop and use it in production?

ionic rune
soft pumice
#

hm i dont know should i go with v1 or v2

#

what do you think?

#

how much exp you have with medusa?

#

i started recently

ionic rune
#

originally started with og v1 that was not ready for production when i needed to launch in dec 2022. Started on V2 ~1.5 4mo ago (man time flies, i started soon as the announced first preview in march). Really like the architecture difference in v2 compared to the early stage v1 i tested.

#

i personally didnt want to learn v1 if v2 was this close to release

#

rather deal with few bugs and help refine the future code base

soft pumice
#

yep you are right. I will give a shot to v2

#

thanks bro, you helped me