The price of RF image files is by default determined by the size of the file that a user wants to buy. In XS version 29, it is possible to create multiple RF licences. This article explains how you can configure this option.
Edit the licence names
First, you need to change the names of the licences that you want to make available. The names are defined in the constants file constants-rf.txt. Go to Site configuration and click on Constants in the sidebar. Find the file constants-rf.txt in the dropdown box and click on its name. The file has the following constants:
The values for the above labels are just examples. You can use 5 different licences for which you can configure different prices. If you want to use fewer options, then enter a – as the value. For example, if you don’t want to use the 5th one then use
The value – will automatically hide the licence on the client facing pages. You must also check the box above the columns that you want to use.
Editorial and Commercial licences
The fist two columns are reserved for Editorial type licences, and the second two columns are reserved for Commercial type licenses. For example Editorial Print, Editorial Online, Commercial Print and Commercial Online. The fifth column is reserved for a generic/other licence. Note that this is only relevant if you want to automatically make licences unavailable if a file is only available for Editorial or Commercial use.
When you are done, click Save local copy.
If you website uses multiple locales, then make sure to edit the constants files for each locale.
In the administrator dashboard, click on Price calculator. Then click File collections in the sidebar. Either create a new RF collection, or edit an existing one. In the properties dialog, you’ll see 5 price columns for each file size.
The labels above the price columns are the names that you have entered in your constants files. Hover over the column name to display the full name. You can now enter prices for each of the licences. On the client facing pages, the user will be able to select both a licence and a file size. The combination of both determines the price. When you are done click Save at the bottom of the dialog. If you have other RF collections, then edit the prices for those as well before you continue.
Enabling multiple licences on the client facing pages
Once you are done with the actions described in the previous paragraphs (all options must have prices), you can enable the function. Go to Site configuration and click on Metadata display in the sidebar. Then open the section Collection file size settings. Check the box Use multiple pricing option and click Save at the bottom.
Using custom templates
Note that the HTML uses classes that will automatically hide any of the licence options that you don’t want to use (the ones with a – value in the constants file as explained above).
Preview pages and modal previews
To change the code fragment used on the cart page, select file 67 in the group “Cart page fragments”. The HTML and script have xs tags to show the selected option and price.
And an example of the script that you must add to the code editor: