User Tools

Site Tools


installation:regional_packages

Installation: Regional Packages

By selecting a country during the installation LiteCart can “patch” the installation with regional data. This is a guide how to create a patch for Sweden.

How To Create a Regional Installation Package

1. Create the following folder ~/install/data/SE/. If you want to create a shared folder with e.g. Denmark name the folder ~/install/data/DK,SE/. It is important that you use the two character country ISO codes.

2. Create a subfolder named public_html ~/install/data/SE/public_html/. This is where you put files that should be copied to the installation such as images, modules etc.

3. Create the file ~/install/data/SE/data.sql containing MySQL queries.

Example of MySQL Queries

Note all queries must be separated by the delimiter:

-- --------------------------------------------------------

Currency

Add a currency:

INSERT INTO `lc_currencies` (`status`, `code`, `name`, `value`, `decimals`, `prefix`, `suffix`, `priority`, `date_updated`, `date_created`) VALUES
(1, 'SEK', 'Svenska kronor', '1.0000', 2, '', ' kr', 0, NOW(), NOW());
-- --------------------------------------------------------
ALTER TABLE `lc_products_prices`
ADD `SEK` DECIMAL(11,4) NOT NULL;
-- --------------------------------------------------------
ALTER TABLE `lc_products_campaigns`
ADD `SEK` DECIMAL(11,4) NOT NULL;

Make it the store currency and set new currency conversion values:

UPDATE `lc_settings`
SET `value` = 'SEK'
WHERE `key` in ('store_currency_code', 'default_currency_code');
-- --------------------------------------------------------
UPDATE `lc_currencies`
SET `value` = 6.8
WHERE `code` = 'USD'
LIMIT 1;
-- --------------------------------------------------------
UPDATE `lc_currencies`
SET `value` = 9.2
WHERE `code` = 'EUR'
LIMIT 1;

Language

Add a language:

INSERT INTO `lc_languages` (`status`, `code`, `name`, `locale`, `charset`, `raw_date`, `raw_time`, `raw_datetime`, `format_date`, `format_time`, `format_datetime`, `decimal_point`, `thousands_sep`, `currency_code`, `priority`, `date_updated`, `date_created`) VALUES
(1, 'sv', 'Svenska', 'sv_SE.utf8,sv_SE.UTF-8,swedish', 'UTF-8', 'Y-m-d', 'H:i', 'Y-m-d H:i', '%b %e %Y', '%H:%M', '%b %e %Y %H:%M', ',', ' ', '', 0, NOW(), NOW());

Geo Zones and VAT

Add a new geo zone and set VAT rates:

INSERT INTO `lc_geo_zones` (`name`, `description`, `date_updated`, `date_created`) VALUES
('SE VAT Zone', '', NOW(), NOW());
-- --------------------------------------------------------
SET @TAX_ZONE_SE = LAST_INSERT_ID();
-- --------------------------------------------------------
INSERT INTO `lc_zones_to_geo_zones` (`geo_zone_id`, `country_code`, `zone_code`, `date_updated`, `date_created`) VALUES
(@TAX_ZONE_SE, 'SE', '', NOW(), NOW());
-- --------------------------------------------------------
INSERT INTO `lc_tax_classes` (`name`, `description`, `date_updated`, `date_created`) VALUES
('Standard', '', NOW(), NOW()),
('Reduced', '', NOW(), NOW()),
('Groceries', '', NOW(), NOW());
-- --------------------------------------------------------
INSERT INTO `lc_tax_rates` (`tax_class_id`, `geo_zone_id`, `type`, `name`, `description`, `rate`, `customer_type`, `tax_id_rule`, `date_updated`, `date_created`) VALUES
(1, @TAX_ZONE_SE, 'percent', 'SE VAT 25%', '', 25.0000, 'both', 'both', NOW(), NOW()),
(2, @TAX_ZONE_SE, 'percent', 'SE VAT 12%', '', 12.0000, 'both', 'both', NOW(), NOW()),
(3, @TAX_ZONE_SE, 'percent', 'SE VAT 6%', '', 6.0000, 'both', 'both', NOW(), NOW());
installation/regional_packages.txt · Last modified: 2015/06/08 02:21 by 78.72.180.122