| | 3 | By selecting a country during the installation LiteCart can "patch" |
---|
| | 4 | the installation with regional data. This is a guide how to create a |
---|
| | 5 | patch for Sweden. |
---|
| | 6 | |
---|
| | 7 | ## How To Create a Regional Pack |
---|
| | 8 | |
---|
| | 9 | 1. Create the following folder **~/install/data/SE/** where SE is |
---|
| | 10 | the country code for this guide example. If you want to create a shared |
---|
| | 11 | folder with other countries i.e. Denmark, comma separate the name the |
---|
| | 12 | folder **~/install/data/DK,SE/**. It is important that you use the |
---|
| | 13 | //two character// country ISO codes. |
---|
| | 14 | |
---|
| | 15 | 2. Create a subfolder named public_html |
---|
| | 16 | **~/install/data/SE/public_html/**. This is where you put files |
---|
| | 17 | that should be copied to the installation such as images, modules etc. |
---|
| | 18 | |
---|
| | 19 | 3. Create the file **~/install/data/SE/data.sql** containing MySQL |
---|
| | 20 | queries. |
---|
| | 21 | |
---|
| | 22 | ### Example of MySQL Queries |
---|
| | 23 | |
---|
| | 24 | Note all queries must be separated by the delimiter: -- |
---|
| | 25 | -------------------------------------------------------- |
---|
| | 26 | |
---|
| | 27 | ### Currency |
---|
| | 28 | |
---|
| | 29 | Add a currency: INSERT INTO \`lc_currencies\ |
---|
| | 30 | (\`status\`, \`code\`, \`name\`, \`value\`, \`decimals\`, \`prefix\`, |
---|
| | 31 | \`suffix\`, \`priority\`, \`date_updated\`, \`date_created\`) VALUES (1, |
---|
| | 32 | 'SEK', 'Svenska kronor', '1.0000', 2, '', ' kr', 0, NOW(), |
---|
| | 33 | NOW()); -- |
---|
| | 34 | -------------------------------------------------------- |
---|
| | 35 | ALTER TABLE \`lc_products_prices\` ADD \`SEK\` DECIMAL(11,4) NOT NULL; |
---|
| | 36 | -- |
---|
| | 37 | -------------------------------------------------------- |
---|
| | 38 | ALTER TABLE \`lc_products_campaigns\` ADD \`SEK\` DECIMAL(11,4) NOT |
---|
| | 39 | NULL; |
---|
| | 40 | |
---|
| | 41 | Make it the store currency and set new currency conversion values: |
---|
| | 42 | UPDATE \`lc_settings\` SET \`value\` = 'SEK' WHERE |
---|
| | 43 | \`key\` in ('store_currency_code', 'default_currency_code'); -- |
---|
| | 44 | -------------------------------------------------------- |
---|
| | 45 | UPDATE \`lc_currencies\` SET \`value\` = 6.8 WHERE \`code\` = 'USD' |
---|
| | 46 | LIMIT 1; -- |
---|
| | 47 | -------------------------------------------------------- |
---|
| | 48 | UPDATE \`lc_currencies\` SET \`value\` = 9.2 WHERE \`code\` = 'EUR' |
---|
| | 49 | LIMIT 1; |
---|
| | 50 | |
---|
| | 51 | ### Language |
---|
| | 52 | |
---|
| | 53 | Add a language: INSERT INTO \`lc_languages\ |
---|
| | 54 | (\`status\`, \`code\`, \`name\`, \`locale\`, \`charset\`, \`raw_date\`, |
---|
| | 55 | \`raw_time\`, \`raw_datetime\`, \`format_date\`, \`format_time\`, |
---|
| | 56 | \`format_datetime\`, \`decimal_point\`, \`thousands_sep\`, |
---|
| | 57 | \`currency_code\`, \`priority\`, \`date_updated\`, \`date_created\`) |
---|
| | 58 | VALUES (1, 'sv', 'Svenska', 'sv_SE.utf8,sv_SE.UTF-8,swedish', |
---|
| | 59 | 'UTF-8', 'Y-m-d', 'H:i', 'Y-m-d H:i', '%b %e %Y', '%H:%M', |
---|
| | 60 | '%b %e %Y %H:%M', ',', ' ', '', 0, NOW(), NOW()); |
---|
| | 61 | |
---|
| | 62 | ### Geo Zones and VAT |
---|
| | 63 | |
---|
| | 64 | Add a new geo zone and set VAT rates: INSERT INTO |
---|
| | 65 | \`lc_geo_zones\` (\`name\`, \`description\`, \`date_updated\`, |
---|
| | 66 | \`date_created\`) VALUES ('SE VAT Zone', *, NOW(), NOW()); -- |
---|
| | 67 | -------------------------------------------------------- |
---|
| | 68 | SET \@TAX_ZONE_SE = LAST_INSERT_ID(); -- |
---|
| | 69 | -------------------------------------------------------- |
---|
| | 70 | INSERT INTO \`lc_zones_to_geo_zones\` (\`geo_zone_id\`, |
---|
| | 71 | \`country_code\`, \`zone_code\`, \`date_updated\`, \`date_created\`) |
---|
| | 72 | VALUES (@TAX_ZONE_SE, 'SE',*, NOW(), NOW()); -- |
---|
| | 73 | -------------------------------------------------------- |
---|
| | 74 | INSERT INTO \`lc_tax_classes\` (\`name\`, \`description\`, |
---|
| | 75 | \`date_updated\`, \`date_created\`) VALUES ('Standard', *, NOW(), |
---|
| | 76 | NOW()), ('Reduced',*, NOW(), NOW()), ('Groceries', *, NOW(), NOW()); |
---|
| | 77 | -- |
---|
| | 78 | -------------------------------------------------------- |
---|
| | 79 | INSERT INTO \`lc_tax_rates\` (\`tax_class_id\`, \`geo_zone_id\`, |
---|
| | 80 | \`type\`, \`name\`, \`description\`, \`rate\`, \`customer_type\`, |
---|
| | 81 | \`tax_id_rule\`, \`date_updated\`, \`date_created\`) VALUES (1, |
---|
| | 82 | \@TAX_ZONE_SE, 'percent', 'SE VAT 25%',*, 25.0000, 'both', |
---|
| | 83 | 'both', NOW(), NOW()), (2, \@TAX_ZONE_SE, 'percent', 'SE VAT 12%', |
---|
| | 84 | *, 12.0000, 'both', 'both', NOW(), NOW()), (3, \@TAX_ZONE_SE, |
---|
| | 85 | 'percent', 'SE VAT 6%',*, 6.0000, 'both', 'both', NOW(), NOW()); |
---|