Share a user's uploaded images across multiple products - xmpie-users/uStore-js GitHub Wiki

By default, when a user uploads an image for a dynamic document, uStore will:

  1. for privacy reasons, make the image available only for that user; and
  2. make that image available only for that product.

When the user returns to the store and orders the same product again, he/she can pick the image that was uploaded previously, rather than have to upload the image again.

In some cases, it may be useful to allow the user to select that uploaded image on other products that have dynamic or variable images. The following steps allow you to share a user's uploaded image across multiple products.

The need:

Share uploaded images across multiple products. User wants to see his uploaded image available in multiple products and not just one.

The solution:

  1. Define a File system asset folder in uProduce. Assuming that uStore is installed on the uProduce server, the asset folder should point to: \\localhost\uStoreShared\Assets
  2. On each product's customization step, define the image ADOR:
    • Select the asset folder created in the first step.
    • Check the “Take Values from Data Source” Checkbox, and click Custom
    • Use the following Query:
select replace(imagesourcelocation, 'user_' + Cast (@UserID as varchar(max)) + '\','') as text,
replace(imagesourcelocation, 'user_' + Cast (@UserID as varchar(max)) + '\','') as value,
0 AS ISDEFAULT 
From IMAGE
Where userid=@UserID