PIMinRiver

inRiver

Retrieve Product Attachments from inRiver

 NOTE

In some cases attachments cannot be retrieved directly from inRiver, for example due to the inRiver API or network limitations. Nevertheless, there is a possibility to retrieve attachments using an external file storage. For more information, see "Retrieve Files from External File Storage".

Product attachments in Sana are files and links added to the product and they are shown on the product details page in the Sana web store.

For example, you are selling electronics or some complex equipment used in mechanical engineering, and you need to provide some manuals to your customers online. These documents can be attached to the products and shown on the product details page in the Sana web store.

In Sana, any file can be a product attachment. In inRiver the product-to-resource relation can be considered as the Sana product attachment. You need to create product-to-resource relations in inRiver and then define which of these relations will be considered as Sana product attachments.

Step 1: To find the necessary relation in inRiver, open the inRiver Product Model. On the right side of the page you will see 2 sections: Included in and Includes. You need to click on Includes to see the list of relations, because the product-to-resource relation is the parent-to-child relation.

Step 2: You can create a new relation or use the already existing relations. If you create a new relation, the target entity type of this relation must be Resource. Since the resource entity type links to the Product Model in inRiver, such relation is considered as product-to-resource in inRiver and is used for the Sana product attachments.

On the screenshot below you can see several link types with the Resource target entity type. You need the Link Type Ids of the relations you are going to use. Link Type Ids are necessary to create a server setting. You can use one or several relations to create a server string.

For example, you want to transfer the Product Attachment and Resources relations to Sana. Then you need the Link Type Ids of these relations, which are: ProductAttachments and ProductResource.

Step 3: Create the server setting for the product-to-resource relations. Go to the Settings in the inRiver Control Center and create the SANA_PRODUCT_ATTACHMENTS_RELATIONS server setting.

Then you need to create a server setting value. Combine the Link Type Ids of the relations you are going to use into a single string. The strings should be separated with semicolon.

After combining the strings, the setting string will look like this:

ProductAttachments;ProductResource

You need to add this string to the value of the SANA_PRODUCT_ATTACHMENTS_RELATIONS server setting.

Step 4: When the server setting is created, you need to rebuild the product index. Open Sana Admin and click: Tools > Scheduled tasks. Run Rebuild index for the Product import task. Then, refresh the site cache.

If related products are created in the inRiver Enrichment Portal, then after product index is rebuilt, related products from inRiver will be available in the Sana web store.

Retrieve Product Attachments from Related Entity

In inRiver you can retrieve product attachments from both, the entity type you are using as a source entity and the related to it entity type. For example, you are using Item entity type to retrieve product attachments, but you also need to retrieve product attachments from the related Product entity type. To do this, you need to enter the correct values in the server setting. The server setting value should consist of two parts: the relation from Item entity type and the relation from Product entity type.

Step 1: To get the necessary relation from the Item entity type, open the inRiver Item Model. On the right side of the page you will see 2 sections: Included in and Includes. You need to click on Includes to see the list of relations. All relations which are included in the Item entity type are shown in the Includes section. Select the relation of the Resource target entity type or create a new one. You will need the Link Type Id of the relation to create the server setting.

For example, you want to transfer the Resource relation to Sana. Then you need the Link Type Id of this relation, which is: ItemResource.

Step 2: You need to get the relation which will be used to connect the Product entity type to the Item entity type.

Open the inRiver Item Model. On the right side of the page you will see 2 sections: Included in and Includes. You need to click on Included in to see the list of relations. All related to the Item entity type relations are shown in the Included in section. You will need the Link Type Id of the Product source entity type, which is: ProductItem. You will need this value to create the server setting to connect the Product entity type to the Item entity type.

Now, you need to select the relation which will be used to retrieve attachments from the Product entity type and used in Sana. Open the inRiver Product Model. Сlick on Includes to see the list of relations. Select the relation of the Resource target entity type or create a new one. You will need the Link Type Id of the relation to create the server setting. For example, ProductAttachments.

Then, you need to combine the Link Type Id of the relation which is used to connect the Product entity type and the Item entity type and the Link Type Id of the relation which is used to retrieve attachments from the Product entity type, separating the Link Type Ids with an underscore: ProductItem_ProductAttachments. This string is necessary to create the server setting.

Step 3: Create the server setting. Go to the Settings in the inRiver Control Center and create the SANA_ITEM_ATTACHMENTS_RELATIONS server setting.

Then you need to create the server setting value. Enter the string you created in the previous step and add the Link Type Id of the relation used to retrieve attachments from the Item entity type, separating it with a semicolon. After combining the strings, the setting string will look like this:

ItemResource;ProductItem_ProductAttachments

You need to add this string to the value of the SANA_ITEM_ATTACHMENTS_RELATIONS server setting.

In this way, the product attachments will be retrieved from both, Item and Product entity types and used in Sana.

Step 4: When the server setting is created, you need to rebuild the product index. Open Sana Admin and click: Tools > Scheduled tasks. Run Rebuild index for the Product import task. Then, refresh the site cache.

PIMinRiver