Once you have added and configured the E-commerce extension then everything will be taken care of automatically.
The product string is build via the SiteCatalyst tag template from the values defined in the E-com Extension.
You need to fill out the E-commerce Extension with the correct variables from your data layer. Check out this post: https://community.tealiumiq.com/posts/550011-e-commerce-extension
Whenever the variable for Order Id is defined the SC template will trigger the "purchase" event and populate the "purchaseID" variable with the value of the defined data source.
Then it will grab the values from the List of Categories, List of Prices, List of Quantities, List of Prices, etc. to build and populate s.products.
So in short, set up the E-commerce Extension correctly and verify the data is being passed in the data layer. Then the rest will be taken care of.