InstallationSingle Server Deployment

Single Server Deployment

Configure the Currency

This chapter is for the SQL Provider only.

Sana Commerce SQL Provider does not support multi-currency. For the SQL Provider webshop the default currency is determined in the SQL database.
Default currency: Euro

To change the default currency a SQL script should be executed on the Sana Commerce database:

  • Before executing the script the following values should be set in the script:

    Value Description
    currencyId
    The ID of the currency which should be used in the webshop.
    currencyName
    The name of the currency which should be used in the webshop.
    oldCurrencyId The ID of the current currency.
    siteId The ID of the website for which the default currency should be changed.
    The website ID can be found in the 'Websites' table in Microsoft SQL Server Management Studio.
DELETE FROM [dbo].[Currencies]
DECLARE @currencyId nvarchar(50)
DECLARE @currencyName nvarchar(50)
DECLARE @oldCurrencyId nvarchar(50)
DECLARE @siteId nvarchar(50)
SET @currencyId = '[currency id]' /* new currency ID*/
SET @currencyName = '[currency friendly name]'/* new currency friendly name */
SET @oldCurrencyId = '[current currency id]'/* current currency ID. case-sensitive. */
SET @siteId = '[site id]'/* ID of the site where currency should be changed */
INSERT INTO [dbo].[Currencies]
VALUES
   (@currencyId,
    @currencyName,
    NULL)
/* Next step should be performed for every site that uses Sql-provider*/
DECLARE @fields nvarchar(MAX)
SET @fields = CAST((SELECT Fields FROM [dbo].[Settings] WHERE Id=@siteId) as nvarchar(MAX))
SET @fields = REPLACE(@fields,
       '<field name="DefaultCurrency" type="System.String, mscorlib" storeWithEntity="False"><string>' + @oldCurrencyId + '</string></field>',
       '<field name="DefaultCurrency" type="System.String, mscorlib" storeWithEntity="False"><string>' + @currencyId + '</string></field>'
      )
UPDATE [dbo].[Settings]
SET Fields = CAST(@fields as xml)
WHERE Id=@siteId

You can also download the SQL script.

  • When the values for the new currency are set, execute the SQL script on the Sana Commerce database.

Now the default currency is changed for the SQL Provider webshop.

InstallationSingle Server Deployment