Sunday, July 24, 2016

WCS - Adding new currency support

By default, Websphere Commerce doesn't provide an option to use Indian Rupees as the currency. But while customizing WCS for Indian customers, supporting Indian currency is necessary. Follow the below steps to enable INR as one of the currency option in the WCS based website.

Step 1. Configure INR as one of the currency: For this, execute the below SQLs in database.

-- To create currency
INSERT INTO SETCURR (SETCCURR, SETCCODE, SETCEXP) VALUES ('INR', 35, -2);

-- To add description to a currency in site level
INSERT INTO SETCURRDSC VALUES ('INR', -1, 'Indian Rupees', NULL);

-- To add currency format rule
INSERT INTO CURFORMAT VALUES (-1, 'INR', 1 , -1, 'R', 2, NULL, NULL);

-- To add currency formatting description
INSERT INTO CURFMTDESC VALUES (-1, -1, 'INR', -1, '₹', NULL, '₹ ',NULL, NULL, '₹ ',NULL, NULL, NULL, '#,##0.00', 'Indian Rupees', NULL);

-- To add currency conversion details. It is an optional step
INSERT INTO CURCONVERT (STOREENT_ID, FROMCURR, TOCURR, FACTOR, MULTIPLYORDIVIDE, BIDIRECTIONAL, UPDATABLE, CURCONVERT_ID) VALUES (-1, 'USD', 'INR', '65.00','M', 'Y', 'Y', -12)

Step 2. Add below entries against each stores (in case of extended sites), where INR should be displayed as one of the currency.

UPDATE STOREENT SET SETCCURR = 'INR' WHERE STOREENT_ID= <store_id>;

INSERT INTO CURLIST VALUES (<store_id>, 'INR', NULL);

UPDATE STORECONF SET VALUE='0' WHERE STOREENT_ID=<store_id> AND NAME='wc.search.priceMode';

* If you do not update the pricemode entry in STORECONF table, the price of the item will get displayed as "price pending".

Instead of performing step 2, we can also associate currency through management center as mentioned below.

a) Logon to management center
b) Select store management option from the top left navigation
c) Select the store in which this change need to be applied
d) Select INR as the default currency. Remove whatever currencies are not required for your site.
e) Click Save and Close


Similar way, any additional currency support can be added in WebSphere Commerce.

If you are using dataload utilities to load price details to WCS, you might need to modify the data load configuration files to support this new currency.

wc-dataload-env.xml:

In the business context configuration, mention currency as 'INR'.

wc-loader-offer.xml:

In config reader section, add an entry to support INR price.

<_config:column number="14" name="PriceInINR"/>

In the datamapping section in BusinessObjectBuilder section, add/update the following entries.

<_config:mapping xpath="PriceEntry[0]/Price/Price/Currency" value="INR" valueFrom="Fixed"/>
<_config:mapping xpath="PriceEntry[0]/Price/Price/value" value="PriceInINR" />



No comments:

Post a Comment