The needed information to run the plugin is stored in the following table:
The public product page modified to reflect the tariff modality (free / shareware / paid) associated with downloadable products.
The displayed title, the short description and the description, the ones corresponding to the current language. A link to display the original version proposed for texts which haven’t been written in the current language (based on the ProductExt.Language field). E.g.: «Read the original version (spanish)». The original version is displayed using an Ajax filed div, in order to make texts not appear in the HTML code.
For legal reason, some downloadable products can not be sold (and even browsed) in some countries.The ProhibitedCountryCodes field is contains a JSON formatted list of country codes (strings) where the product can’t be sold. If this list isn't blank and if it's valid (from a JSON point of view) a synchronous call to the Freegeoip.net service is performed with a 3 sec. timeout, ex.: http://freegeoip.net/json/user_ip If the response is usable, the IP address of the user and the associated country code will be stored in the application cache to be reused for a period of 24h. If the country code associated with the IP is part of the list contained in ProhibitedCountryCodes, a page containing a message explaining that the product can not be accessed from the country from which the user is viewing the site will be displayed and a message will be added to the nopCommerce log file.
If the product is free, the "Add to cart" button is replaced by a link allowing to download directly the product. The link activation open of a modal pop-up surrounded by a translucent background, displaying:
If the product is shareware, the link "Add to cart" will be replaced by a download link like the one described above (only the license text, stored in a different resource, will vary) and below which a "Pay" button allowing the user to pay the displayed price will be added (the process will be identical to the paid file case).
The shopping cart process stay the same.