Permalink
Browse files

3000fc4

  • Loading branch information...
1 parent f480973 commit fbd893e39c76771a88ba1ef37b5a4db7b2aa91f8 Kris Thom White committed May 21, 2013
Showing with 1,849 additions and 857 deletions.
  1. +0 −1 css/base.css
  2. +1 −1 framework/utils/CFileHelper.php
  3. +158 −160 install.php
  4. +0 −15 js/checkout.js
  5. +0 −9 js/wishlist.js
  6. +1 −5 protected/components/Controller.php
  7. +1 −3 protected/components/FBIdentity.php
  8. +67 −7 protected/components/ShoppingCart.php
  9. +17 −1 protected/components/helpers.php
  10. +2 −2 protected/config/_main.php
  11. +1 −1 protected/config/wsver.php
  12. +22 −17 protected/controllers/CartController.php
  13. +175 −70 protected/controllers/InstallController.php
  14. +10 −19 protected/controllers/LegacysoapController.php
  15. +6 −3 protected/controllers/MyaccountController.php
  16. +1 −7 protected/controllers/ProductController.php
  17. +8 −0 protected/controllers/SiteController.php
  18. +7 −9 protected/controllers/WishlistController.php
  19. +3 −0 protected/extensions/Yii-Image-Zoomer/.gitignore
  20. +0 −39 protected/extensions/blueprintgrid/JBlueprintGrid.php
  21. +0 −1 protected/extensions/blueprintgrid/assets/css/blueprint-grid.css
  22. BIN protected/extensions/blueprintgrid/assets/css/src/grid copy.png
  23. BIN protected/extensions/blueprintgrid/assets/css/src/grid.png
  24. +0 −51 protected/extensions/blueprintgrid/assets/js/blueprint-grid.js
  25. +0 −13 protected/extensions/wsbwishlist/views/index.php
  26. +0 −45 protected/extensions/wsbwishlist/wsbwishlist.php
  27. BIN protected/extensions/wslangflags/assets/flags/fr_ca.gif
  28. +5 −5 protected/extensions/wspayment/moneris/models/monerisAdminForm.php
  29. +1 −1 protected/extensions/wspayment/moneris/moneris.php
  30. +27 −96 protected/extensions/wsshipping/freeshipping/freeshipping.php
  31. +1 −1 protected/extensions/wsshipping/storepickup/storepickup.php
  32. +2 −5 protected/extensions/wsshipping/ups/ups.php
  33. +1 −1 protected/extensions/wsshipping/usps/usps.php
  34. +17 −8 protected/models/Cart.php
  35. +5 −8 protected/models/CartPayment.php
  36. +1 −1 protected/models/Category.php
  37. +33 −2 protected/models/Configuration.php
  38. +17 −5 protected/models/Customer.php
  39. +16 −0 protected/models/Document.php
  40. +10 −15 protected/models/Family.php
  41. +9 −0 protected/models/Modules.php
  42. +91 −11 protected/models/Product.php
  43. +6 −0 protected/models/ProductTags.php
  44. +9 −8 protected/models/PromoCode.php
  45. +3 −6 protected/models/base/BaseWishlist.php
  46. +5 −3 protected/models/forms/BaseCheckoutForm.php
  47. +3 −2 protected/modules/admin/assets/css/admin.css
  48. +17 −4 protected/modules/admin/components/AdminBaseController.php
  49. +7 −23 protected/modules/admin/controllers/DefaultController.php
  50. +1 −0 protected/modules/admin/controllers/PaymentsController.php
  51. +2 −0 protected/modules/admin/controllers/SystemController.php
  52. +113 −6 protected/modules/admin/controllers/ThemeController.php
  53. +6 −0 protected/modules/admin/signatures.php
  54. +1 −1 protected/modules/admin/views/databaseadmin/customers.php
  55. +1 −1 protected/modules/admin/views/theme/header.php
  56. +2 −2 protected/modules/admin/views/theme/manage.php
  57. +1 −1 protected/modules/admin/views/theme/upload.php
  58. +1 −1 protected/views-cities/cart/_googleconversion.php
  59. +4 −4 protected/views-cities/layouts/column2.php
  60. +1 −4 protected/views-cities/layouts/errorlayout.php
  61. +1 −5 protected/views-cities/layouts/jumper.php
  62. +1 −4 protected/views-cities/layouts/main.php
  63. +2 −5 protected/views-cities/mail/_cart.php
  64. +1 −4 protected/views-cities/mail/_contactform.php
  65. +1 −1 protected/views-cities/mail/_customerreceipt.php
  66. +1 −4 protected/views-cities/mail/_forgotpassword.php
  67. +68 −58 protected/views-cities/product/index.php
  68. +1 −2 themes/brooklyn/views/wsbwishlist/index.php → protected/views-cities/site/_wishlists.php
  69. +27 −0 themes/brooklyn/README.txt
  70. +60 −2 themes/brooklyn/config.xml
  71. +11 −1 themes/brooklyn/css/style.css
  72. +0 −67 themes/brooklyn/views/sidecart/index.php
  73. +80 −0 themes/custom/config.xml
  74. 0 themes/{brooklyn/css/colorless.css → custom/css/custom.css}
  75. +148 −0 themes/custom/css/dark.css
  76. BIN themes/custom/css/images/adv_search.png
  77. BIN themes/custom/css/images/arrow-down.png
  78. BIN themes/custom/css/images/arrow-right.gif
  79. BIN themes/custom/css/images/breadcrumbs_home.png
  80. BIN themes/custom/css/images/btn_add.png
  81. BIN themes/custom/css/images/btn_edit.png
  82. BIN themes/custom/css/images/btn_email.png
  83. BIN themes/custom/css/images/btn_remove.png
  84. BIN themes/custom/css/images/checkoutarrow.png
  85. BIN themes/custom/css/images/cross.png
  86. BIN themes/custom/css/images/darkbg.gif
  87. BIN themes/custom/css/images/email_footer_bg.png
  88. BIN themes/custom/css/images/email_header_bg.png
  89. BIN themes/custom/css/images/loginhead.png
  90. BIN themes/custom/css/images/next-horizontal.png
  91. BIN themes/custom/css/images/next-vertical.png
  92. BIN themes/custom/css/images/prev-horizontal.png
  93. BIN themes/custom/css/images/prev-vertical.png
  94. BIN themes/custom/css/images/scroll_left.png
  95. BIN themes/custom/css/images/scroll_right.png
  96. BIN themes/custom/css/images/shoppingcart.png
  97. BIN themes/custom/css/images/shoppingcartdark.png
  98. BIN themes/custom/css/images/shoppingcartlight.png
  99. BIN themes/custom/css/images/slash.png
  100. BIN themes/custom/css/images/spyglass.png
  101. +145 −0 themes/custom/css/light.css
  102. +396 −0 themes/custom/css/style.css
  103. BIN themes/custom/custom.png
  104. +7 −0 themes/custom/views/site/index.php
View
1 css/base.css
@@ -138,7 +138,6 @@ em {
strong {
font-weight: bold;
- color: #333;
}
small {
View
2 framework/utils/CFileHelper.php
@@ -284,7 +284,7 @@ private static function mkdir($dst,array $options,$recursive)
self::mkdir(dirname($dst),$options,true);
$mode=isset($options['newDirMode']) ? $options['newDirMode'] : 0777;
- $res=mkdir($dst, $mode);
+ $res=@mkdir($dst, $mode);
chmod($dst,$mode);
return $res;
}
View
318 install.php
@@ -1,5 +1,6 @@
<?php
set_time_limit(300);
+define('VERSION',"3.0.0");
define('DBARRAY_NUM', MYSQL_NUM);define('DBARRAY_ASSOC', MYSQL_ASSOC);define('DBARRAY_BOTH', MYSQL_BOTH);if (!defined('DB_EXPLAIN')) { define('DB_EXPLAIN', false);}if (!defined('DB_QUERIES')) { define('DB_QUERIES', false);}
@@ -45,6 +46,38 @@
break;
}
+
+function xls_check_file_signatures($complete = false)
+{
+ $checked = array();
+ $checked['<b>--File Signatures Check for ' . _xls_version() . '--</b>'] = "pass";
+
+ include("protected/modules/admin/signatures.php");
+
+ $fn = unserialize($signatures);
+ if (!isset($signatures)) {
+ $checked['Signature File in /includes'] = "fail";
+ }
+
+ foreach ($fn as $key => $value) {
+
+ if (!file_exists($key)) {
+ $checked[$key] = "MISSING";
+ } else {
+ $hashes = explode(",", $value);
+ $hashfile = md5_file($key);
+ if (!in_array($hashfile, $hashes)) {
+ $checked[$key] = "modified";
+ } elseif (_xls_version() != $versions[array_search($hashfile, $hashes)] || $complete) {
+ $checked[$key] = $versions[array_search($hashfile, $hashes)];
+ }
+ }
+
+
+ }
+ return $checked;
+}
+
function makeHtaccess()
{
//Update Rewrite Base in htaccess
@@ -101,7 +134,7 @@ function makeSymbolicLink()
}
function _xls_version()
{
- return "3.0.0";
+ return VERSION;
}
function displayForm()
@@ -202,7 +235,7 @@ function displayNotAcceptable($checkenv)
//For 2.1.x upgrade, have the upgrades been run?
if ($_SERVER['REQUEST_URI'] == "/install.php?check") {
//$checkenv = array_merge($checkenv, xls_check_upgrades());
- //$checkenv = array_merge($checkenv, xls_check_file_signatures());
+ $checkenv = array_merge($checkenv, xls_check_file_signatures());
}
} else {
@@ -299,7 +332,7 @@ function runInstall(key)
document.getElementById('stats').innerHTML = obj.tag;
else document.getElementById('stats').innerHTML = "";
<?php if(isset($_GET['debug'])): ?>
- document.getElementById('stats').innerHTML = "online "+online + " total "+obj.total + " perc " + perc;
+ document.getElementById('stats').innerHTML = "Running line "+online + " of " + obj.total + " (" + perc + "%)";
<?php endif; ?>
if (online==obj.total) {
clearInterval(pinttimer);
@@ -531,6 +564,7 @@ public function getSchema()
else $this->schemaNumber=0;
} else $this->schemaNumber=0;
+
}
public function query($sql) {
@@ -795,6 +829,7 @@ function runInstall($db,$sqlline = 0)
zipAndFolders();
if ($upgrade) $db->changedb('old');
if ($upgrade) if ($db->schemaNumber<217) up217($db);
+ $tag = "Applying pre-3.0 changes. Line #".$sqlline;
case 3:
case 4:
@@ -806,19 +841,24 @@ function runInstall($db,$sqlline = 0)
case 10:
if ($upgrade) $db->changedb('old');
if ($upgrade) if ($db->schemaNumber==217) up250($db,$sqlline);
+ $tag = "Applying pre-3.0 changes. Line #".$sqlline;
break;
case 11:
if ($upgrade) $db->changedb('old');
if ($upgrade) if ($db->schemaNumber==250) up251($db);
+ $tag = "Applying pre-3.0 changes. Line #".$sqlline;
break;
case 12:
if ($upgrade) $db->changedb('old');
if ($upgrade) if ($db->schemaNumber==251) up252($db);
+ $tag = "Creating new tables. Line #".$sqlline;
break;
case 13:
$db->changedb('new');
initialCreateTables($db); //Create all tables at once
+ if (!$upgrade)
+ initialConfigLoad($db);
break;
default:
@@ -834,11 +874,13 @@ function runInstall($db,$sqlline = 0)
$db->query('SET NAMES utf8');
$db->query('SET FOREIGN_KEY_CHECKS=0');
$db->query($sqlStringtoRun);
+ if ($sqlline<28) $tag = "Creating tables";
+ if ($sqlline>=28 && $sqlline<=75) $tag = "Processing images table";
+
}
if ($sqlline==$total && !$upgrade)
{
- initialConfigLoad($db);
initialDataLoad($db);
}
@@ -848,12 +890,15 @@ function runInstall($db,$sqlline = 0)
makeHtaccess();
makeSymbolicLink();
installMainConfig();
+ $tag = "Halfway there, stand by...";
}
}
- return json_encode(array('result'=>"success",'line'=>$sqlline,'total'=>$total,'upgrade'=>$upgrade));
+ if (isset($tag))
+ return json_encode(array('result'=>"success",'line'=>$sqlline,'tag'=>$tag,'total'=>$total,'upgrade'=>$upgrade));
+ else return json_encode(array('result'=>"success",'line'=>$sqlline,'total'=>$total,'upgrade'=>$upgrade));
}
@@ -1243,42 +1288,6 @@ function initialCreateTables($db)
engine=innodb
DEFAULT charset=utf8;
- CREATE TABLE `{newdbname}`.`xlsws_gift_registry_receipents`
- (
- `rowid` INT(11) NOT NULL auto_increment,
- `registry_id` INT(11) NOT NULL,
- `customer_id` INT(11) DEFAULT NULL,
- `receipent_name` VARCHAR(100) NOT NULL,
- `receipent_email` VARCHAR(100) NOT NULL,
- `email_sent` TINYINT(1) DEFAULT '0',
- `created` DATETIME NOT NULL,
- `modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (`rowid`),
- KEY `registry_id` (`registry_id`),
- KEY `customer_id` (`customer_id`)
- )
- engine=innodb
- DEFAULT charset=utf8;
-
- CREATE TABLE `{newdbname}`.`xlsws_images`
- (
- `rowid` BIGINT(20) unsigned NOT NULL auto_increment,
- `image_path` VARCHAR(255) DEFAULT NULL,
- `image_data` MEDIUMBLOB,
- `width` MEDIUMINT(9) DEFAULT NULL,
- `height` MEDIUMINT(9) DEFAULT NULL,
- `checksum` VARCHAR(32) DEFAULT NULL,
- `parent` BIGINT(20) DEFAULT NULL,
- `index` int(11) DEFAULT NULL,
- `product_id` bigint(20) unsigned DEFAULT NULL,
- `created` DATETIME NOT NULL,
- `modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (`rowid`),
- UNIQUE KEY `width` (`width`, `height`, `parent`),
- KEY `parent` (`parent`)
- )
- engine=innodb
- DEFAULT charset=utf8;
CREATE TABLE `{newdbname}`.`xlsws_modules`
(
@@ -1350,6 +1359,26 @@ function initialCreateTables($db)
engine=innodb
DEFAULT charset=utf8;
+ CREATE TABLE `{newdbname}`.`xlsws_images`
+ (
+ `id` BIGINT(20) unsigned NOT NULL auto_increment,
+ `image_path` VARCHAR(255) DEFAULT NULL,
+ `width` MEDIUMINT(9) DEFAULT NULL,
+ `height` MEDIUMINT(9) DEFAULT NULL,
+ `parent` BIGINT(20) DEFAULT NULL,
+ `index` int(11) DEFAULT NULL,
+ `product_id` bigint(20) unsigned DEFAULT NULL,
+ `created` DATETIME NOT NULL,
+ `modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `width` (`width`, `height`, `parent`),
+ KEY `index` (`index`),
+ KEY `product_id` (`product_id`),
+ KEY `image_path` (`image_path`),
+ KEY `parent` (`parent`)
+ )
+ engine=innodb
+ DEFAULT charset=utf8;
CREATE TABLE `{newdbname}`.`xlsws_product_category_assn`
(
@@ -1593,10 +1622,6 @@ function initialMigrateTables()
SELECT *
FROM `{olddbname}`.`xlsws_gift_registry_items`;
- INSERT INTO `{newdbname}`.`xlsws_gift_registry_receipents`
- SELECT *
- FROM `{olddbname}`.`xlsws_gift_registry_receipents`;
-
INSERT INTO `{newdbname}`.`xlsws_modules`
SELECT *
FROM `{olddbname}`.`xlsws_modules`;
@@ -1617,26 +1642,34 @@ function initialMigrateTables()
SELECT *
FROM `{olddbname}`.`xlsws_product_related`;
- INSERT INTO `{newdbname}`.`xlsws_images` (rowid,image_path,width,height,checksum,parent,created,modified) SELECT rowid,image_path,width,height,checksum,parent,created,modified FROM `{olddbname}`.`xlsws_images`;
+ INSERT INTO `{newdbname}`.`xlsws_images` (id,image_path,width,height,parent,created,modified) SELECT rowid,image_path,width,height,parent,created,modified FROM `{olddbname}`.`xlsws_images`;
- update `{newdbname}`.`xlsws_images` as a left join `{newdbname}`.`xlsws_product` as b on b.image_id=a.rowid set a.product_id=b.rowid;
+ update `{newdbname}`.`xlsws_images` as a left join `{newdbname}`.`xlsws_product` as b on b.image_id=a.id set a.product_id=b.rowid;
- update `{newdbname}`.`xlsws_images` as a left join `{newdbname}`.`xlsws_images` as b on b.rowid=a.parent set a.product_id=b.product_id where a.rowid<>a.parent;
+ update `{newdbname}`.`xlsws_images` as a left join `{newdbname}`.`xlsws_images` as b on b.id=a.parent set a.product_id=b.product_id where a.id<>a.parent;
UPDATE `{newdbname}`.`xlsws_images` set `index`=0 where product_id IS NOT NULL;
- update `{newdbname}`.`xlsws_images` as a left join `{olddbname}`.`xlsws_product_image_assn` as b on b.image_id=a.rowid set a.product_id=b.product_id where a.product_id is null and b.product_id is not null;
- update `{newdbname}`.`xlsws_images` as a left join `{newdbname}`.`xlsws_images` as b on b.rowid=a.parent set a.product_id=b.product_id where a.rowid<>a.parent and a.product_id is null;
+ update `{newdbname}`.`xlsws_images` as a left join `{olddbname}`.`xlsws_product_image_assn` as b on b.image_id=a.id set a.product_id=b.product_id where a.product_id is null and b.product_id is not null;
+
+ update `{newdbname}`.`xlsws_images` as a left join `{newdbname}`.`xlsws_images` as b on b.id=a.parent set a.product_id=b.product_id where a.id<>a.parent and a.product_id is null;
+
+ update `{newdbname}`.`xlsws_images` set `index`=4 where `index` is null and image_path is not null and image_path like '%_3_add.%';
+ update `{newdbname}`.`xlsws_images` set `index`=4 where `index` is null and image_path is not null and image_path like '%-add-3.%';
+ update `{newdbname}`.`xlsws_images` set `index`=4 where `index` is null and image_path is not null and image_path like '%-add-3-%';
+ update `{newdbname}`.`xlsws_images` set `index`=4 where `index` is null and image_path is not null and image_path like '%_2_add.%';
+ update `{newdbname}`.`xlsws_images` set `index`=3 where `index` is null and image_path is not null and image_path like '%-add-2.%';
+ update `{newdbname}`.`xlsws_images` set `index`=3 where `index` is null and image_path is not null and image_path like '%-add-2-%';
+ update `{newdbname}`.`xlsws_images` set `index`=2 where `index` is null and image_path is not null and image_path like '%_1_add.%';
+ update `{newdbname}`.`xlsws_images` set `index`=2 where `index` is null and image_path is not null and image_path like '%-add-1.%';
+ update `{newdbname}`.`xlsws_images` set `index`=2 where `index` is null and image_path is not null and image_path like '%-add-1-%';
+ update `{newdbname}`.`xlsws_images` set `index`=1 where `index` is null and image_path is not null and image_path like '%_add.%';
+ update `{newdbname}`.`xlsws_images` set `index`=1 where `index` is null and image_path is not null and image_path like '%-add.%';
+ update `{newdbname}`.`xlsws_images` set `index`=1 where `index` is null and image_path is not null and image_path like '%-add-%';
+
+
- update `{newdbname}`.`xlsws_images` set `index`=1 where `index` is null and image_path like '%-add.%';
- update `{newdbname}`.`xlsws_images` set `index`=1 where `index` is null and image_path like '%-add-%';
- update `{newdbname}`.`xlsws_images` set `index`=2 where `index` is null and image_path like '%-add-1.%';
- update `{newdbname}`.`xlsws_images` set `index`=2 where `index` is null and image_path like '%-add-1-%';
- update `{newdbname}`.`xlsws_images` set `index`=3 where `index` is null and image_path like '%-add-2.%';
- update `{newdbname}`.`xlsws_images` set `index`=3 where `index` is null and image_path like '%-add-2-%';
- update `{newdbname}`.`xlsws_images` set `index`=4 where `index` is null and image_path like '%-add-3.%';
- update `{newdbname}`.`xlsws_images` set `index`=4 where `index` is null and image_path like '%-add-3-%';
INSERT INTO `{newdbname}`.`xlsws_promo_code`
SELECT *
@@ -1688,8 +1721,6 @@ function migrateTwoFiveToThree()
alter table {newdbname}.xlsws_family CHANGE `rowid` `id` BIGINT(20) unsigned NOT NULL AUTO_INCREMENT;
alter table {newdbname}.xlsws_gift_registry CHANGE `rowid` `id` BIGINT(20) unsigned NOT NULL AUTO_INCREMENT;
alter table {newdbname}.xlsws_gift_registry_items CHANGE `rowid` `id` BIGINT(20) unsigned NOT NULL AUTO_INCREMENT;
- alter table {newdbname}.xlsws_gift_registry_receipents CHANGE `rowid` `id` BIGINT(20) unsigned NOT NULL AUTO_INCREMENT;
- alter table {newdbname}.xlsws_images CHANGE `rowid` `id` BIGINT(20) unsigned NOT NULL AUTO_INCREMENT;
alter table {newdbname}.xlsws_modules CHANGE `rowid` `id` INT(11) unsigned NOT NULL AUTO_INCREMENT;
alter table {newdbname}.xlsws_product CHANGE `rowid` `id` BIGINT(20) unsigned NOT NULL AUTO_INCREMENT;
alter table {newdbname}.xlsws_product_qty_pricing CHANGE `rowid` `id` INT(11) unsigned NOT NULL AUTO_INCREMENT;
@@ -1734,11 +1765,6 @@ function migrateTwoFiveToThree()
ALTER TABLE `{newdbname}`.`xlsws_product` CHANGE `image_id` `image_id` BIGINT(20) unsigned NULL;
ALTER TABLE `{newdbname}`.`xlsws_promo_code` CHANGE `except` `exception` TINYINT(1) NOT NULL DEFAULT '0';
ALTER TABLE `{newdbname}`.`xlsws_tax` CHANGE `max` `max_tax` DOUBLE NULL DEFAULT '0';
- ALTER TABLE `{newdbname}`.`xlsws_images` DROP `image_data`;
- ALTER TABLE `{newdbname}`.`xlsws_images` DROP `checksum`;
-
- ALTER TABLE `{newdbname}`.`xlsws_images` ADD INDEX (`product_id`);
- ALTER TABLE `{newdbname}`.`xlsws_images` ADD INDEX (`index`);
ALTER TABLE `{newdbname}`.`xlsws_state` ADD `country_id` INT UNSIGNED NULL DEFAULT NULL AFTER `id`;
@@ -1939,16 +1965,18 @@ function migrateTwoFiveToThree()
CREATE TABLE IF NOT EXISTS `{newdbname}`.`xlsws_stringsource` (
- `id` int(11) NOT NULL auto_increment,
- `category` varchar(32) default NULL,
- `message` text,
- PRIMARY KEY (`id`)
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `category` varchar(32) DEFAULT NULL,
+ `message` varchar(1024) DEFAULT '',
+ PRIMARY KEY (`id`),
+ KEY `category` (`category`),
+ KEY `message` (`message`(255))
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `{newdbname}`.`xlsws_stringtranslate` (
`id` int(11) NOT NULL,
`language` varchar(16) NOT NULL default '',
- `translation` text,
+ `translation` varchar(1024),
PRIMARY KEY (`id`,`language`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -2121,7 +2149,7 @@ function migrateTwoFiveToThree()
ALTER TABLE `{newdbname}`.`xlsws_customer` ADD `email_verified` INT NULL DEFAULT NULL AFTER `email`;
-
+ ALTER TABLE `{newdbname}`.`xlsws_images` ADD FOREIGN KEY (`product_id`) REFERENCES `xlsws_product` (`id`);
ALTER TABLE `{newdbname}`.`xlsws_cart` MODIFY COLUMN `first_name` VARCHAR(64) DEFAULT NULL AFTER `id_str`;
ALTER TABLE `{newdbname}`.`xlsws_cart` MODIFY COLUMN `last_name` VARCHAR(64) DEFAULT NULL AFTER `first_name`;
@@ -2144,7 +2172,6 @@ function migrateTwoFiveToThree()
ALTER TABLE `{newdbname}`.`xlsws_cart` ADD CONSTRAINT `fk_shiprecord` FOREIGN KEY (`shipping_id`) REFERENCES `xlsws_cart_shipping` (`id`);
ALTER TABLE `{newdbname}`.`xlsws_cart` ADD CONSTRAINT `fk_payrecord` FOREIGN KEY (`payment_id`) REFERENCES `xlsws_cart_payment` (`id`);
ALTER TABLE `{newdbname}`.`xlsws_cart` DROP `discount`;
- ALTER TABLE `{newdbname}`.`xlsws_images` ADD FOREIGN KEY (`product_id`) REFERENCES `xlsws_product` (`id`);
ALTER TABLE `{newdbname}`.`xlsws_customer` ADD `default_billing_id` BIGINT(20) UNSIGNED NULL DEFAULT NULL AFTER `company`;
ALTER TABLE `{newdbname}`.`xlsws_customer` ADD `default_shipping_id` BIGINT(20) UNSIGNED NULL DEFAULT NULL AFTER `default_billing_id`;
ALTER TABLE `{newdbname}`.`xlsws_customer` ADD FOREIGN KEY (`default_billing_id`) REFERENCES `xlsws_customer_address` (`id`);
@@ -2280,10 +2307,11 @@ function migrateTwoFiveToThree()
ALTER TABLE `xlsws_category` CHANGE `meta_keywords` `google_extra` VARCHAR(255) NULL DEFAULT NULL;
ALTER TABLE `xlsws_modules` ADD `version` INT NULL DEFAULT NULL AFTER `category`;
- INSERT INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`)
+ INSERT IGNORE INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`)
VALUES
- ('Share Cart Email Subject Line', 'EMAIL_SUBJECT_CART', '{storename} Cart for {customername}', 'Configure Email Subject line with variables for Customer Email', 24, 10, '2012-08-28 14:07:09', '2012-08-28 14:07:09', NULL, 0, 1),
- ('Wishlist Email Subject Line', 'EMAIL_SUBJECT_WISHLIST', '{storename} Wishlist for {customername}', 'Configure Email Subject line with variables for Customer Email', 24, 10, '2012-08-28 14:07:09', '2012-08-28 14:07:09', NULL, 0, 1);
+ ('Share Cart Email Subject Line', 'EMAIL_SUBJECT_CART', '{storename} Cart for {customername}', 'Configure Email Subject line with variables for Customer Email', 24, 10, '2012-08-28 14:07:09', '2012-08-28 14:07:09', NULL, 0, 1);
+ INSERT IGNORE INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`)
+ VALUES ('Wishlist Email Subject Line', 'EMAIL_SUBJECT_WISHLIST', '{storename} Wishlist for {customername}', 'Configure Email Subject line with variables for Customer Email', 24, 10, '2012-08-28 14:07:09', '2012-08-28 14:07:09', NULL, 0, 1);
ALTER TABLE `xlsws_configuration` CHANGE `helper_text` `helper_text` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '';
ALTER TABLE `xlsws_cart` CHANGE `linkid` `linkid` VARCHAR(64) NULL DEFAULT NULL;
@@ -2298,7 +2326,7 @@ function migrateTwoFiveToThree()
UPDATE `xlsws_configuration` SET `helper_text` = '' WHERE `key_name` = 'EMAIL_SEND_CUSTOMER';
UPDATE `xlsws_configuration` SET `helper_text` = 'Email store on every order' WHERE `key_name` = 'EMAIL_SEND_STORE';
UPDATE `xlsws_configuration` SET `helper_text` = '' WHERE `key_name` = 'STORE_NAME';
- INSERT INTO `xlsws_configuration` (`id`, `title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`) VALUES (NULL, 'System Logging', 'DEBUG_LOGGING', 'error', '', '1', '21', '2013-02-07 11:13:36', '2012-03-08 09:57:38', 'LOGGING', '0', '1');
+ INSERT IGNORE INTO `xlsws_configuration` (`id`, `title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`) VALUES (NULL, 'System Logging', 'DEBUG_LOGGING', 'error', '', '1', '21', '2013-02-07 11:13:36', '2012-03-08 09:57:38', 'LOGGING', '0', '1');
UPDATE `xlsws_configuration` SET `configuration_type_id` = '25', `sort_order` = '3' WHERE `key_name` = 'WEIGHT_UNIT';
UPDATE `xlsws_configuration` SET `configuration_type_id` = '25', `sort_order` = '4' WHERE `key_name` = 'DIMENSION_UNIT';
UPDATE `xlsws_configuration` SET `configuration_type_id` = '25', `sort_order` = '5' WHERE `key_name` = 'SHIPPING_TAXABLE';
@@ -2325,24 +2353,23 @@ function migrateTwoFiveToThree()
update xlsws_configuration set `key_value`='brooklyn' where `key_name`='DEFAULT_TEMPLATE';
update xlsws_configuration set `title`='Non-inventoried Item Display Message' where `key_name`='INVENTORY_NON_TITLE';
- INSERT INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`) VALUES ('Photo Processor', 'CEventPhoto', 'wsphoto', 'Component that handles photos', '28', '1', CURRENT_TIMESTAMP, NULL, 'CEventPhoto', '0', '1');
- INSERT INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`) VALUES ('Recommendation Processor', 'PROCESSOR_RECOMMEND', 'wsrecommend', 'Component that handles additional product recommendations', '28', '2', CURRENT_TIMESTAMP,NULL, 'PROCESSOR_RECOMMEND', '0', '1');
- INSERT INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`) VALUES ('Menu Processor', 'PROCESSOR_MENU', 'wsmenu', 'Component that handles menu display', '28', '2', CURRENT_TIMESTAMP, NULL, 'PROCESSOR_MENU', '0', '1');
- INSERT INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`) VALUES ('Language Menu shows', 'PROCESSOR_LANGMENU', 'wslanglinks', 'Component that handles language menu display', '15', '2', CURRENT_TIMESTAMP, NULL, 'PROCESSOR_LANGMENU', '0', '1');
- INSERT INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`) VALUES ('Delivery Speed format', 'SHIPPING_FORMAT', '{label} ({price})', 'Formatting for Delivery Speed. The variables {label} and {price} can be used.', '25', '5', CURRENT_TIMESTAMP, NULL, NULL, '0', '1');
- INSERT INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`) VALUES ('Products Per Row', 'PRODUCTS_PER_ROW', '3', 'Products per row on grid. (Note this number must be divisible evenly into 12. That\'s why \'5\' is missing.)', '8', '3', CURRENT_TIMESTAMP, NULL, 'PRODUCTS_PER_ROW', '0', '1');
+ INSERT IGNORE INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`) VALUES ('Photo Processor', 'CEventPhoto', 'wsphoto', 'Component that handles photos', '28', '1', CURRENT_TIMESTAMP, NULL, 'CEventPhoto', '0', '1');
+ INSERT IGNORE INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`) VALUES ('Menu Processor', 'PROCESSOR_MENU', 'wsmenu', 'Component that handles menu display', '28', '2', CURRENT_TIMESTAMP, NULL, 'PROCESSOR_MENU', '0', '1');
+ INSERT IGNORE INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`) VALUES ('Language Menu shows', 'PROCESSOR_LANGMENU', 'wslanglinks', 'Component that handles language menu display', '15', '2', CURRENT_TIMESTAMP, NULL, 'PROCESSOR_LANGMENU', '0', '1');
+ INSERT IGNORE INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`) VALUES ('Delivery Speed format', 'SHIPPING_FORMAT', '{label} ({price})', 'Formatting for Delivery Speed. The variables {label} and {price} can be used.', '25', '5', CURRENT_TIMESTAMP, NULL, NULL, '0', '1');
+ INSERT IGNORE INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`) VALUES ('Products Per Row', 'PRODUCTS_PER_ROW', '3', 'Products per row on grid. (Note this number must be divisible evenly into 12. That\'s why \'5\' is missing.)', '8', '3', CURRENT_TIMESTAMP, NULL, 'PRODUCTS_PER_ROW', '0', '1');
ALTER TABLE `xlsws_configuration` ADD `required` INT NULL DEFAULT NULL AFTER `param`;
- INSERT INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `options`, `template_specific`, `param`, `required`)
+ INSERT IGNORE INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `options`, `template_specific`, `param`, `required`)
VALUES ('Home page', 'HOME_PAGE', '*products', 'Home page viewers should first see', 19, 4, 'HOME_PAGE', 0, 1, NULL);
-INSERT INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `options`, `template_specific`, `param`, `required`)
+INSERT IGNORE INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `options`, `template_specific`, `param`, `required`)
VALUES ('Use Short Description', 'USE_SHORT_DESC', 1, 'Home page viewers should first see', 19, 5, 'BOOL', 0, 1, NULL);
ALTER TABLE `xlsws_customer` ADD INDEX (`facebook`);
-INSERT INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`, `required`) VALUES ('Facebook Secret Key', 'FACEBOOK_SECRET', '', 'Secret Key found with your App ID', 26, 2, CURRENT_TIMESTAMP, NULL, NULL, 0, 0, NULL);
-INSERT INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`, `required`) VALUES ('Show Facebook Comments on Product details', 'FACEBOOK_COMMENTS', 0, '', 26, 3, CURRENT_TIMESTAMP, NULL, 'BOOL', 0, 0, NULL);
-INSERT INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`, `required`) VALUES ('Show Post to Wall after checkout', 'FACEBOOK_CHECKOUT', 0, '', 26, 4, CURRENT_TIMESTAMP, NULL, 'BOOL', 0, 0, NULL);
-INSERT INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`, `required`) VALUES ('Share to Wall Caption', 'FACEBOOK_WALL_CAPTION', 'I found some great deals at {storename}!', '', 26, 5, CURRENT_TIMESTAMP, NULL, NULL, 0, 0, NULL);
-INSERT INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`, `required`) VALUES ('Share to Wall Button', 'FACEBOOK_WALL_PUBLISH', 'Post to your wall', '', 26, 7, CURRENT_TIMESTAMP, NULL, NULL, 0, 0, NULL);
-INSERT INTO `xlsws_modules` (`active`, `module`, `category`, `version`, `name`, `sort_order`, `configuration`, `modified`, `created`)
+INSERT IGNORE INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`, `required`) VALUES ('Facebook Secret Key', 'FACEBOOK_SECRET', '', 'Secret Key found with your App ID', 26, 2, CURRENT_TIMESTAMP, NULL, NULL, 0, 0, NULL);
+INSERT IGNORE INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`, `required`) VALUES ('Show Facebook Comments on Product details', 'FACEBOOK_COMMENTS', 0, '', 26, 3, CURRENT_TIMESTAMP, NULL, 'BOOL', 0, 0, NULL);
+INSERT IGNORE INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`, `required`) VALUES ('Show Post to Wall after checkout', 'FACEBOOK_CHECKOUT', 0, '', 26, 4, CURRENT_TIMESTAMP, NULL, 'BOOL', 0, 0, NULL);
+INSERT IGNORE INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`, `required`) VALUES ('Share to Wall Caption', 'FACEBOOK_WALL_CAPTION', 'I found some great deals at {storename}!', '', 26, 5, CURRENT_TIMESTAMP, NULL, NULL, 0, 0, NULL);
+INSERT IGNORE INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`, `required`) VALUES ('Share to Wall Button', 'FACEBOOK_WALL_PUBLISH', 'Post to your wall', '', 26, 7, CURRENT_TIMESTAMP, NULL, NULL, 0, 0, NULL);
+INSERT IGNORE INTO `xlsws_modules` (`active`, `module`, `category`, `version`, `name`, `sort_order`, `configuration`, `modified`, `created`)
VALUES (1, 'wsphoto', 'CEventPhoto', 1, 'Web Store Internal', 1, NULL, NULL, NULL);
DELETE FROM `xlsws_configuration` where `key_name`='PRODUCT_ENLARGE_SHOW_LIGHTBOX';
DELETE FROM `xlsws_configuration` where `key_name`='DEBUG_DELETE_DUPES';
@@ -2351,12 +2378,13 @@ function migrateTwoFiveToThree()
DELETE FROM `xlsws_configuration` where `key_name`='DEBUG_TEMPLATE';
DELETE FROM `xlsws_configuration` where `key_name`='HTML_EMAIL';
DELETE FROM `xlsws_configuration` where `key_name`='SESSION_HANDLER';
-INSERT INTO `xlsws_configuration` ( `title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`, `required`) VALUES ('Jpg Image Quality (1 to 100)', 'IMAGE_QUALITY', '75', 'Compression for JPG images', '17', '15', CURRENT_TIMESTAMP, NULL, NULL, '0', '1', '1');
-INSERT INTO `xlsws_configuration` ( `title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`, `required`) VALUES ('Jpg Sharpen (1 to 50)', 'IMAGE_SHARPEN', '25', 'Sharpening for JPG images', '17', '16', CURRENT_TIMESTAMP, NULL, NULL, '0', '1', '1');
-INSERT INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`, `required`) VALUES ('Image Background Color Fill', 'IMAGE_BACKGROUND', '#FFFFFF', 'Optional image background color (#HEX)', 17, 20, CURRENT_TIMESTAMP, NULL, NULL, 1, 1, 0);
+INSERT IGNORE INTO `xlsws_configuration` ( `title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`, `required`) VALUES ('Jpg Image Quality (1 to 100)', 'IMAGE_QUALITY', '75', 'Compression for JPG images', '17', '15', CURRENT_TIMESTAMP, NULL, NULL, '0', '1', '1');
+INSERT IGNORE INTO `xlsws_configuration` ( `title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`, `required`) VALUES ('Jpg Sharpen (1 to 50)', 'IMAGE_SHARPEN', '25', 'Sharpening for JPG images', '17', '16', CURRENT_TIMESTAMP, NULL, NULL, '0', '1', '1');
+INSERT IGNORE INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`, `required`) VALUES ('Image Background {color} Fill', 'IMAGE_BACKGROUND', '#FFFFFF', 'Optional image background color (#HEX)', 17, 20, CURRENT_TIMESTAMP, NULL, NULL, 1, 1, 0);
ALTER TABLE `xlsws_cart` CHANGE `ip_host` `origin` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;
-INSERT INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `options`, `template_specific`, `param`, `required`)
-VALUES ('Installed', 'INSTALLED', 0, '', 0, 0, 'BOOL', 0, 1, NULL);
+INSERT IGNORE INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `options`, `template_specific`, `param`, `required`) VALUES ('Installed', 'INSTALLED', 0, '', 0, 0, 'BOOL', 0, 1, NULL);
+INSERT IGNORE INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `options`, `template_specific`, `param`, `required`) VALUES ('Use Categories in Product URLs', 'SEO_URL_CATEGORIES', 0, 'This will include the Category path when creating the SEO formatted URLs.',21,2, 'BOOL', 0, 1, NULL);
+INSERT IGNORE INTO `xlsws_configuration` (`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`, `required`) VALUES ('Use Quantity Entry Blank', 'SHOW_QTY_ENTRY', '0', 'If enabled, show freeform qty entry for Add To Cart', '19', '12', CURRENT_TIMESTAMP, NULL, 'BOOL', '1', '1', NULL);
UPDATE xlsws_configuration set key_value='dark' where key_value='webstore-dark' AND key_name='DEFAULT_TEMPLATE_THEME';
UPDATE xlsws_configuration set key_value='light' where key_value='webstore-light' AND key_name='DEFAULT_TEMPLATE_THEME';
UPDATE xlsws_configuration set key_value='Hurry, only {qty} left in stock!' where key_name='INVENTORY_LOW_TITLE';
@@ -2365,6 +2393,13 @@ function migrateTwoFiveToThree()
UPDATE xlsws_configuration set title='Display Inventory on Product Details' where key_name='INVENTORY_DISPLAY';
UPDATE xlsws_configuration set title='Authorized IPs For LightSpeed uploading (USE WITH CAUTION)',helper_text='List of IP Addresses (comma separated) which are allowed to upload products and download orders. NOTE: DO NOT USE THIS OPTION IF YOU DO NOT HAVE A STATIC IP ADDRESS' where key_name='LSAUTH_IPS';
DELETE FROM `xlsws_configuration` where `key_name`='DEFAULT_EXPIRY_GIFT_REGISTRY';
+UPDATE xlsws_configuration set title='Update {color} options',helper_text='Enable this option to have the {color} drop-down menu populated on each size change.' where key_name='ENABLE_COLOR_FILTER';
+UPDATE xlsws_configuration set title='Product {color} Label',helper_text='Rename {color} Option of LightSpeed to this' where key_name='PRODUCT_COLOR_LABEL';
+UPDATE xlsws_configuration set title='Image Background {color} Fill',helper_text='Optional image background {color} (#HEX)' where key_name='IMAGE_BACKGROUND';
+UPDATE xlsws_configuration set configuration_type_id=29 where key_name like '%IMAGE_WIDTH';
+UPDATE xlsws_configuration set configuration_type_id=29 where key_name like '%IMAGE_HEIGHT';
+UPDATE xlsws_modules set category='theme' where category='template';
+INSERT IGNORE INTO `xlsws_configuration` (`id`, `title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `modified`, `created`, `options`, `template_specific`, `param`, `required`) VALUES (NULL, 'After adding item to cart', 'AFTER_ADD_CART', '0', 'What should site do after shopper adds item to cart', '4', '5', '2009-04-06 10:34:34', '2009-04-06 10:34:34', 'AFTER_ADD_CART', '0', '1', NULL);
SET FOREIGN_KEY_CHECKS=1";
}
@@ -2403,14 +2438,14 @@ function initialConfigLoad($db)
$db->add_config_key("INVENTORY_FIELD_TOTAL","Inventory should include Virtual Warehouses",0,"If selected yes, the inventory figure shown will be that of available, reserved and inventory in warehouses. If no, only that of available in store will be shown",11,3,"BOOL");
$db->add_config_key("INVENTORY_NON_TITLE","Non-inventoried Item Display Message","Available on request","Title to be shown for products that are not normally stocked",11,9,"");
$db->add_config_key("SHIP_RESTRICT_DESTINATION","Only Ship To Defined Destinations",0,"If selected yes, web shopper can only choose addresses in defined Destinations. See Destinations for more information",25,1,"BOOL");
- $db->add_config_key("LISTING_IMAGE_WIDTH","Product Grid image width",180,"Product Listing Image Width. Comes in search or category listing page",17,1,"INT");
- $db->add_config_key("LISTING_IMAGE_HEIGHT","Product Grid image height",190,"Product Listing Image Height. Comes in search or category listing page",17,2,"INT");
- $db->add_config_key("DETAIL_IMAGE_WIDTH","Product Detail Image Width",256,"Product Detail Page Image Width. When the product is being viewed in the product detail page.",17,5,"INT");
- $db->add_config_key("DETAIL_IMAGE_HEIGHT","Product Detail Image Width",256,"Product Detail Page Image Height. When the product is being viewed in the product detail page.",17,6,"INT");
+ $db->add_config_key("LISTING_IMAGE_WIDTH","Product Grid image width",180,"Product Listing Image Width. Comes in search or category listing page",29,1,"INT");
+ $db->add_config_key("LISTING_IMAGE_HEIGHT","Product Grid image height",190,"Product Listing Image Height. Comes in search or category listing page",29,2,"INT");
+ $db->add_config_key("DETAIL_IMAGE_WIDTH","Product Detail Image Width",256,"Product Detail Page Image Width. When the product is being viewed in the product detail page.",29,5,"INT");
+ $db->add_config_key("DETAIL_IMAGE_HEIGHT","Product Detail Image Width",256,"Product Detail Page Image Height. When the product is being viewed in the product detail page.",29,6,"INT");
$db->add_config_key("PRODUCT_SIZE_LABEL","Product Size Label","Size","Rename Size Option of LightSpeed to this",8,2,NULL);
$db->add_config_key("PRODUCT_COLOR_LABEL","Product Color Label","Color","Rename Color Option of LightSpeed to this",8,1,NULL);
- $db->add_config_key("MINI_IMAGE_WIDTH","Shopping Cart image width",30,"Mini Cart Image Width. For images in the mini cart for every page.",17,3,"INT");
- $db->add_config_key("MINI_IMAGE_HEIGHT","Shopping Cart image height",30,"Mini Cart Image Height. For images in the mini cart for every page.",17,4,"INT");
+ $db->add_config_key("MINI_IMAGE_WIDTH","Shopping Cart image width",30,"Mini Cart Image Width. For images in the mini cart for every page.",29,3,"INT");
+ $db->add_config_key("MINI_IMAGE_HEIGHT","Shopping Cart image height",30,"Mini Cart Image Height. For images in the mini cart for every page.",29,4,"INT");
$db->add_config_key("TAX_INCLUSIVE_PRICING","Tax Inclusive Pricing",0,"If selected yes, all prices will be shown tax inclusive in webstore.",15,6,"BOOL");
$db->add_config_key("ENCODING","Browser Encoding","UTF-8","What character encoding would you like to use for your visitors? UTF-8 should be normal for all users.",15,10,"ENCODING");
$db->add_config_key("TIMEZONE","Web Store Time Zone","America/New_York","The timezone in which your Web Store should display and store time.",15,4,"TIMEZONE");
@@ -2485,12 +2520,12 @@ function initialConfigLoad($db)
$db->add_config_key("SEO_PRODUCT_DESCRIPTION","Product Meta Description format","{longdescription}","Which elements appear in the Meta Description",22,3,"NULL");
$db->add_config_key("SEO_CATEGORY_TITLE","Category pages Title format","{name} : {storename}","Which elements appear in the title of a category page",23,1,"NULL");
$db->add_config_key("SEO_CUSTOMPAGE_TITLE","Custom pages Title format","{name} : {storename}","Which elements appear in the title of a custom page",23,2,"NULL");
- $db->add_config_key("CATEGORY_IMAGE_WIDTH","Category Page Image Width",180,"if using a Category Page image",17,7,"INT");
- $db->add_config_key("CATEGORY_IMAGE_HEIGHT","Category Page Image Width",180,"if using a Category Page image",17,8,"INT");
- $db->add_config_key("PREVIEW_IMAGE_WIDTH","Preview Thumbnail (Product Detail Page) Width",60,"Preview Thumbnail image",17,9,"INT");
- $db->add_config_key("PREVIEW_IMAGE_HEIGHT","Preview Thumbnail (Product Detail Page) Height",60,"Preview Thumbnail image",17,10,"INT");
- $db->add_config_key("SLIDER_IMAGE_WIDTH","Slider Image Width",90,"Slider on custom pages",17,11,"INT");
- $db->add_config_key("SLIDER_IMAGE_HEIGHT","Slider Image Height",90,"Slider on custom pages",17,12,"INT");
+ $db->add_config_key("CATEGORY_IMAGE_WIDTH","Category Page Image Width",180,"if using a Category Page image",29,7,"INT");
+ $db->add_config_key("CATEGORY_IMAGE_HEIGHT","Category Page Image Width",180,"if using a Category Page image",29,8,"INT");
+ $db->add_config_key("PREVIEW_IMAGE_WIDTH","Preview Thumbnail (Product Detail Page) Width",60,"Preview Thumbnail image",29,9,"INT");
+ $db->add_config_key("PREVIEW_IMAGE_HEIGHT","Preview Thumbnail (Product Detail Page) Height",60,"Preview Thumbnail image",29,10,"INT");
+ $db->add_config_key("SLIDER_IMAGE_WIDTH","Slider Image Width",90,"Slider on custom pages",29,11,"INT");
+ $db->add_config_key("SLIDER_IMAGE_HEIGHT","Slider Image Height",90,"Slider on custom pages",29,12,"INT");
$db->add_config_key("IMAGE_FORMAT","Image Format","jpg","Use .jpg or .png format for images. JPG files are smaller but slightly lower quality. PNG is higher quality and supports transparency, but has a larger file size.",17,18,"IMAGE_FORMAT");
$db->add_config_key("ENABLE_CATEGORY_IMAGE","Display Image on Category Page (when set)",0,"Requires a defined Category image under SEO settings",17,13,"BOOL");
$db->add_config_key("SHIP_SAME_BILLSHIP","Require Billing and Shipping Address to Match",0,"Locks the Shipping and Billing are same checkbox to not allow separate shipping address.",25,2,"BOOL");
@@ -2499,7 +2534,7 @@ function initialConfigLoad($db)
$db->add_config_key("STORE_ADDRESS2","Store City, State, Postal","Anytown, NY 12345","Address line 2",2,6,"NULL");
$db->add_config_key("STORE_HOURS","Store Operating Hours","MON-FRI: 9AM-9PM SAT: 11AM-6PM SUN: CLOSED","Store hours. Use &lt;br&gt; tag to create two lines if desired.",2,7,"NULL");
$db->add_config_key("DEFAULT_TEMPLATE_THEME","Template theme","light","If supported, changable colo(u)rs for template files.",0,2,"DEFAULT_TEMPLATE_THEME");
- $db->add_config_key("GOOGLE_MPN","Product Codes are Manufacturer Part Numbers in Google Shopping",1,"If your Product Codes are Manufacturer Part Numbers, turn this on to apply this to Google Shopping feed.",20,4,"BOOL");
+ $db->add_config_key("GOOGLE_MPN","Product Codes are Manufacturer Part Numbers in Google Shopping",0,"If your Product Codes are Manufacturer Part Numbers, turn this on to apply this to Google Shopping feed.",20,4,"BOOL");
$db->add_config_key("EMAIL_SUBJECT_WISHLIST","Wishlist Email Subject Line","{storename} Wishlist for {customername}","Configure Email Subject line with variables for Customer Email",24,10,NULL);
$db->add_config_key("FACEBOOK_APPID","Facebook App ID",'',"Create Facebook AppID",26,1,NULL);
$db->add_config_key("EMAIL_SUBJECT_CART","Share Cart Email Subject Line","{storename} Cart for {customername}","Configure Email Subject line with variables for Customer Email",24,10,NULL);
@@ -3127,6 +3162,7 @@ function up217($db)
$db->add_config_key('DATABASE_SCHEMA_VERSION' ,'Database Schema Version',
'217', 'Used for tracking schema changes', '', '', NULL);
+ $db->query("UPDATE `xlsws_configuration` SET `value`='217' where `key`='DATABASE_SCHEMA_VERSION'");
}
@@ -3451,40 +3487,40 @@ function up250($db,$sqlline)
- $db->query("UPDATE `xlsws_configuration` SET `title`='Product Grid image width', `configuration_type_id`=17, `sort_order`=1,options='INT',template_specific=1
+ $db->query("UPDATE `xlsws_configuration` SET `title`='Product Grid image width', `configuration_type_id`=29, `sort_order`=1,options='INT',template_specific=1
where `key`='LISTING_IMAGE_WIDTH'");
- $db->query("UPDATE `xlsws_configuration` SET `title`='Product Grid image height', `configuration_type_id`=17, `sort_order`=2 ,options='INT' ,template_specific=1
+ $db->query("UPDATE `xlsws_configuration` SET `title`='Product Grid image height', `configuration_type_id`=29, `sort_order`=2 ,options='INT' ,template_specific=1
where `key`='LISTING_IMAGE_HEIGHT'");
- $db->query("UPDATE `xlsws_configuration` SET `title`='Shopping Cart image width', `configuration_type_id`=17, `sort_order`=3 ,options='INT',template_specific=1
+ $db->query("UPDATE `xlsws_configuration` SET `title`='Shopping Cart image width', `configuration_type_id`=29, `sort_order`=3 ,options='INT',template_specific=1
where `key`='MINI_IMAGE_WIDTH'");
- $db->query("UPDATE `xlsws_configuration` SET `title`='Shopping Cart image height', `configuration_type_id`=17, `sort_order`=4 ,options='INT',template_specific=1
+ $db->query("UPDATE `xlsws_configuration` SET `title`='Shopping Cart image height', `configuration_type_id`=29, `sort_order`=4 ,options='INT',template_specific=1
where `key`='MINI_IMAGE_HEIGHT'");
- $db->query("UPDATE `xlsws_configuration` SET `title`='Product Detail Image Width', `configuration_type_id`=17, `sort_order`=5 ,options='INT' ,template_specific=1
+ $db->query("UPDATE `xlsws_configuration` SET `title`='Product Detail Image Width', `configuration_type_id`=29, `sort_order`=5 ,options='INT' ,template_specific=1
where `key`='DETAIL_IMAGE_WIDTH'");
- $db->query("UPDATE `xlsws_configuration` SET `title`='Product Detail Image Height', `configuration_type_id`=17, `sort_order`=6 ,options='INT' ,template_specific=1
+ $db->query("UPDATE `xlsws_configuration` SET `title`='Product Detail Image Height', `configuration_type_id`=29, `sort_order`=6 ,options='INT' ,template_specific=1
where `key`='DETAIL_IMAGE_HEIGHT'");
$db->add_config_key('CATEGORY_IMAGE_WIDTH' ,
'Category Page Image Width',
- '180', 'if using a Category Page image', 17, 7, 'INT',1);
+ '180', 'if using a Category Page image', 29, 7, 'INT',1);
$db->add_config_key('CATEGORY_IMAGE_HEIGHT' ,
'Category Page Image Height',
- '180', 'if using a Category Page image', 17, 8, 'INT',1);
+ '180', 'if using a Category Page image', 29, 8, 'INT',1);
$db->add_config_key('PREVIEW_IMAGE_WIDTH' ,
'Preview Thumbnail (Product Detail Page) Width',
- '30', 'Preview Thumbnail image', 17, 9, 'INT',1);
+ '30', 'Preview Thumbnail image', 29, 9, 'INT',1);
$db->add_config_key('PREVIEW_IMAGE_HEIGHT' ,
'Preview Thumbnail (Product Detail Page) Height',
- '30', 'Preview Thumbnail image', 17, 10, 'INT',1);
+ '30', 'Preview Thumbnail image', 29, 10, 'INT',1);
$db->add_config_key('SLIDER_IMAGE_WIDTH' ,
'Slider Image Width',
- '90', 'Slider on custom pages', 17, 11, 'INT',1);
+ '90', 'Slider on custom pages', 29, 11, 'INT',1);
$db->add_config_key('SLIDER_IMAGE_HEIGHT' ,
'Slider Image Height',
- '90', 'Slider on custom pages', 17, 12, 'INT',1);
+ '90', 'Slider on custom pages', 29, 12, 'INT',1);
$db->add_config_key('IMAGE_FORMAT' ,
'Image Format',
'jpg', 'Use .jpg or .png format for images. JPG files are smaller but slightly lower quality. PNG is higher quality and supports transparency, but has a larger file size.', 17, 18, 'IMAGE_FORMAT',0);
@@ -3495,8 +3531,8 @@ function up250($db,$sqlline)
$db->add_config_key('ENABLE_CATEGORY_IMAGE' ,
'Display Image on Category Page (when set)',
'0', 'Requires a defined Category image under SEO settings', 17, 13, 'BOOL',1);
- $db->query("update `xlsws_configuration` set template_specific=1 where `key` like '%_IMAGE_WIDTH'");
- $db->query("update `xlsws_configuration` set template_specific=1 where `key` like '%_IMAGE_HEIGHT'");
+ $db->query("update `xlsws_configuration` set template_specific=1,`configuration_type_id`=29 where `key` like '%_IMAGE_WIDTH'");
+ $db->query("update `xlsws_configuration` set template_specific=1,`configuration_type_id`=29 where `key` like '%_IMAGE_HEIGHT'");
$db->query("update `xlsws_configuration` set template_specific=1 where `key` = 'DEFAULT_TEMPLATE_THEME'");
$db->query("update `xlsws_configuration` set template_specific=1 where `key` = 'PRODUCTS_PER_PAGE'");
@@ -3744,43 +3780,5 @@ function xls_check_upgrades()
return $checked;
}
- function xls_check_file_signatures($complete = false)
-{
- $checked = array();
- $checked['<b>--File Signatures Check for ' . _xls_version() . '--</b>'] = "pass";
-
- include("includes/signatures.php");
-
- $template = _dbx_first_cell("select `value` from xlsws_configuration where `key`='DEFAULT_TEMPLATE'");
-
- $fn = unserialize($signatures);
- if (!isset($signatures)) {
- $checked['Signature File in /includes'] = "fail";
- }
-
- foreach ($fn as $key => $value) {
-
- if (strstr($key, '/templates') && !strstr($key, '/templates/' . $template)) {
- //skip not our template
- } else {
-
- if (!file_exists($key)) {
- $checked[$key] = "MISSING";
- } else {
- $hashes = explode(",", $value);
- $hashfile = md5_file($key);
- if (!in_array($hashfile, $hashes)) {
- $checked[$key] = "modified";
- } elseif (_xls_version() != $versions[array_search($hashfile, $hashes)] || $complete) {
- $checked[$key] = $versions[array_search($hashfile, $hashes)];
- }
- }
-
- }
-
-
- }
- return $checked;
-}
?>
View
15 js/checkout.js
@@ -1,15 +0,0 @@
-
-function processPromo(data) {
- if (data.action=="alert") alert(data.errormsg);
- else if (data.action=="error") {
- $("#CheckoutForm_promoCode_em_").html(data.errormsg);
- $("#CheckoutForm_promoCode_em_").show();
- } else if (data.action=="success") {
- $("#CheckoutForm_promoCode_em_").html(data.errormsg);
- $("#CheckoutForm_promoCode_em_").show();
- $("#cartItems").html(data.cartitems);
- if (savedShippingProviders)
- $("#btnCalculate").click();
- }
-}
-
View
9 js/wishlist.js
@@ -1,9 +0,0 @@
-
-function wishlistedit(data) {
- if (data.status=="success") {
- $("#qty-"+data.id).html(data.qty);
- $("#WishitemEdit").dialog("close");
- if (data.reload) location.reload();
- } else alert(data.errormsg);
-}
-
View
6 protected/components/Controller.php
@@ -29,7 +29,6 @@ class Controller extends CController
/* These are public variables that are used in our layout, so we have to define them.
*/
- public $pageLanguage;
public $pageDescription;
public $pageCanonicalUrl;
public $pageImageUrl;
@@ -87,7 +86,6 @@ public function init() {
$this->pageTitle =
Yii::app()->name = _xls_get_conf('STORE_NAME', 'LightSpeed Web Store');
- $this->pageLanguage = _xls_get_conf('LANG_CODE', 'en');
$this->pageCanonicalUrl = $this->getCanonicalUrl();
$this->pageDescription = _xls_get_conf('STORE_TAGLINE');
$this->pageImageUrl ='';
@@ -106,9 +104,7 @@ public function init() {
Yii::app()->end();
}
- //$this->menuwidget = $this->widget('application.extensions.wsmenu.wsmenu');
-
- //$this->searchPnl=$this->renderPartial('search',array(),true);
+ Yii::app()->shoppingcart->UpdateMissingProducts();
//Run other functions to create some data we always need
$this->buildGoogle();
View
4 protected/components/FBIdentity.php
@@ -63,9 +63,7 @@ public function authenticate()
//New user to our site using Facebook, so set up an account
$model = new Customer();
- $model->scenario = 'create';
- $model->password = "facebook";
- $model->password_repeat = "facebook";
+ $model->scenario = 'createfb';
$results = Yii::app()->facebook->api('/me');
$model->first_name = $results['first_name'];
$model->last_name = $results['last_name'];
View
74 protected/components/ShoppingCart.php
@@ -56,20 +56,22 @@ public function getModel()
if (!is_null($intCustomerid))
$objCart = Cart::LoadLastCartInProgress($intCustomerid);
if (is_null($objCart))
- $objCart = Cart::InitializeCart();
-
- Yii::app()->user->setState('cartid',$objCart->id);
+ $objCart = new Cart();
+ //Logged in customers get a "real" cart
+ if(is_null($objCart) && !is_null($intCustomerid))
+ {
+ $objCart = Cart::InitializeCart();
+ Yii::app()->user->setState('cartid',$objCart->id);
+ }
} else {
$objCart = Cart::model()->findByPk($intCartId);
if (!$objCart) {
//something has happened to the database object
Yii::log("Could not find cart ".$intCartId.", creating new one.", 'error', 'application.'.__CLASS__.".".__FUNCTION__);
- //unset(Yii::app()->session['cartid']);
$objCart = Cart::InitializeCart();
- //Yii::app()->session['cartid'] = $objCart->id;
Yii::app()->user->setState('cartid',$objCart->id);
}
@@ -80,6 +82,34 @@ public function getModel()
return $this->_model;
}
+
+ /**
+ * Since calling our model doesn't necessarily really create a db record (to avoid blank carts all over the place),
+ * this function purposely creates a record when we need one (i.e. when adding a product to the cart)
+ */
+ protected function createCart()
+ {
+ $intCartId = Yii::app()->user->getState('cartid');
+
+ if(empty($intCartId)) {
+
+ $objCustomer = Customer::GetCurrent();
+ $intCustomerid = null;
+
+ if ($objCustomer instanceof Customer)
+ $intCustomerid = $objCustomer->id;
+
+ $objCart = null;
+ if (!is_null($intCustomerid))
+ $objCart = Cart::LoadLastCartInProgress($intCustomerid);
+ if (is_null($objCart))
+ $objCart = Cart::InitializeCart();
+
+ $this->_model = $objCart;
+ Yii::app()->user->setState('cartid',$objCart->id);
+ }
+ }
+
public function getIsActive()
{
if (!$this->_model)
@@ -105,7 +135,8 @@ public function loginMerge($objCartToMerge = null)
$arrPastItems = $objCartInProgress->cartItems;
//Merge in any new items we had in our cart from this session
- if (count($arrPastItems)>0) {
+ if (count($arrPastItems)>0)
+ {
foreach($arrPastItems as $objItem) {
$objProduct = Product::model()->findbyPk($objItem->product_id);
$this->model->AddToCart($objProduct,$objItem->qty,$objItem->description,
@@ -117,6 +148,7 @@ public function loginMerge($objCartToMerge = null)
Yii::app()->user->setFlash('success',Yii::t('cart','Your prior cart has been restored.'));
$objCartInProgress->delete();
}
+ $this->model->UpdateMissingProducts();
}
}
@@ -245,12 +277,18 @@ public function setTaxCodeId($id)
*/
public function addProduct($mixProduct,$intQuantity = 1,$intGiftItemId = null, $auto=null)
{
+ $cartid=Yii::app()->user->getState('cartid');
+ if (empty($cartid))
+ $this->createCart();
if ($mixProduct instanceof Product)
$objProduct = $mixProduct;
else
$objProduct = Product::model()->findByPk($mixProduct);
+ if(!(_xls_get_conf('QTY_FRACTION_PURCHASE')))
+ $intQuantity = intval($intQuantity);
+
if ($objProduct instanceof Product)
{
$this->clearCachedShipping();
@@ -287,9 +325,16 @@ public function cartItems()
*/
public function save()
{
- return $this->model->save();
+ $retVal = $this->model->save();
+ if (!$retVal)
+ Yii::log("Error saving cart ".print_r($this->model->getErrors()), 'error', 'application.'.__CLASS__.".".__FUNCTION__);
+ return $retVal;
}
+ public function getErrors()
+ {
+ return $this->model->getErrors();
+ }
/**
* Create a Link to view the cart after checkout. Used for receipt viewing.
* @return mixed
@@ -326,6 +371,16 @@ public function clearCart()
return true;
}
+
+ public function UpdateMissingProducts()
+ {
+
+ if( Yii::app()->user->getState('cartid')>0)
+ $this->model->UpdateMissingProducts();
+
+ }
+
+
/**
* Disassociate the cart with the current session. Should be done after payment
* is complete but before redirecting to receipt.
@@ -485,6 +540,11 @@ public function __get($strName) {
case 'TaxTotal':
return $this->model->TaxTotal;
+ case 'subtotal':
+ if (empty($this->model->subtotal))
+ return 0;
+ else return $this->model->subtotal;
+
case 'Taxes':
return $this->model->Taxes;
View
18 protected/components/helpers.php
@@ -54,6 +54,22 @@ function _xls_site_url($strUrlPath = '') {
return _xls_site_dir($usessl) . '/' . $strUrlPath;
}
+function _xls_regionalize($str)
+{
+ $c = Yii::app()->params['DEFAULT_COUNTRY'];
+ switch ($str)
+ {
+ case 'color':
+ if ($c==224) return 'color'; else return 'colour';
+
+ case 'check':
+ if ($c==224) return 'check'; else return 'cheque';
+
+ default:
+ return $str;
+ }
+}
+
/**
* Return the Base URL for the site
* Also perform http/https conversion if need be.
@@ -134,7 +150,7 @@ function _xls_raise_events($strEvent,$objEvent)
//Raise events
foreach ($objModules as $objModule) {
- Yii::log('Running event '.$objEvent->onAction.' '.$objModule->module, 'info', 'application.'.__CLASS__.".".__FUNCTION__);
+ Yii::log('Running event '.$strEvent.' '.$objModule->module, 'info', 'application.'.__CLASS__.".".__FUNCTION__);
$objModule->instanceHandle->raiseEvent($objEvent->onAction,$objEvent);
}
}
View
4 protected/config/_main.php
@@ -26,8 +26,8 @@
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=>'Web Store',
//'theme'=>'brooklyn', //pulled from wsconfig
- 'language' => 'en_us',
- 'sourceLanguage' => 'en_us',
+ //'language' => 'en', //pulled from wsconfig
+ 'sourceLanguage' => 'en',
// preloading 'log' component
'preload'=>array(
View
2 protected/config/wsver.php
@@ -1,4 +1,4 @@
<?php
-define('XLSWS_VERSION', '3.0.0fc1');
+define('XLSWS_VERSION', '3.0.0fc4');
define('XLSWS_VERSIONBUILD', 3000);
View
39 protected/controllers/CartController.php
@@ -422,11 +422,6 @@ public function actionEmail()
public function actionCheckout()
{
-
- Yii::app()->clientScript->registerScriptFile(
- Yii::app()->baseUrl.'/js/checkout.js'
- );
-
//We shouldn't be in this controller if we don't have any products in our cart
if (!Yii::app()->shoppingcart->itemCount)
{
@@ -876,18 +871,27 @@ public function actionCheckout()
$objPaymentModule = Modules::model()->findByPk($model->paymentProvider);
if ($objPaymentModule instanceof Modules)
{
- $subForm = Yii::app()->getComponent($objPaymentModule->module)->subform;
- if(isset($subForm))
- if (isset($_POST[$subForm]))
- {
- $paymentForms[$objPaymentModule->id]->attributes = $_POST[$subForm];
- $paymentForms[$objPaymentModule->id]->validate();
- }
+ $objModule = Yii::app()->getComponent($objPaymentModule->module);
+ if (!$objModule)
+ {
+ Yii::log("Error missing module ".$objPaymentModule->module, 'error', 'application.'.__CLASS__.".".__FUNCTION__);
+ $model->paymentProvider=null;
+ }
+ else
+ {
+ $subForm = $objModule->subform;
+ if(isset($subForm))
+ if (isset($_POST[$subForm]))
+ {
+ $paymentForms[$objPaymentModule->id]->attributes = $_POST[$subForm];
+ $paymentForms[$objPaymentModule->id]->validate();
+ }
- Yii::app()->clientScript->registerScript('payment',
- '$(document).ready(function(){
- changePayment(\''.$objPaymentModule->id.'\')
- });');
+ Yii::app()->clientScript->registerScript('payment',
+ '$(document).ready(function(){
+ changePayment(\''.$objPaymentModule->id.'\')
+ });');
+ }
} else $model->paymentProvider=null;
}
@@ -1101,7 +1105,7 @@ public function EmailReceipts($objCart)
if (_xls_get_conf('EMAIL_SEND_STORE',0)==1) {
$strHtmlBody =$this->renderPartial('/mail/_customerreceipt', array('cart'=>$objCart), true);
$strSubject = _xls_format_email_subject(
- 'EMAIL_SUBJECT_CUSTOMER',$objCart->customer->first_name.' '.$objCart->customer->last_name,
+ 'EMAIL_SUBJECT_OWNER',$objCart->customer->first_name.' '.$objCart->customer->last_name,
$objCart->id_str
);
@@ -1400,6 +1404,7 @@ public function actionApplyPromocode()
}
+
/**
* Called by AJAX function from checkout for Calculate Shipping. Builds a grid of shipping scenarios including
* shipping price and cart total prices. The results are cached client-side in the browser allowing the
View
245 protected/controllers/InstallController.php
@@ -19,6 +19,7 @@ class InstallController extends Controller
public function init() {
+ set_time_limit(300);
//We override init() to keep our system from trying to autoload stuff we haven't finished converting yet
}
@@ -33,7 +34,11 @@ public function init() {
public function beforeAction($action)
{
- if (strlen(_xls_get_conf('LSKEY'))>0 && $action->id != "exportconfig" && $action->id != "upgrade" && $action->id != "fixlink")
+ if (strlen(_xls_get_conf('LSKEY'))>0 &&
+ $action->id != "exportconfig" &&
+ $action->id != "upgrade" &&
+ $action->id != "fixlink" &&
+ $action->id != "migratephotos")
{
error_log("stopped because key was "._xls_get_conf('LSKEY')." on action ".$action->id);
@@ -86,17 +91,21 @@ public function actionUpgrade()
$this->online = _xls_number_only($_POST['online']);
- if ($this->online==1) $retval = $this->actionConvertStepZero();
- if ($this->online >=2 && $this->online<=17) $retval = $this->actionConvertStep1();
- if ($this->online==18) $retval = $this->actionConvertStep2();
+ if ($this->online==1) $retval = $this->actionConvertStart();
+ if ($this->online >=2 && $this->online<=17) $retval = $this->actionConvertAddressBook();
+ if ($this->online==18) $retval = $this->actionConvertModules();
if ($this->online>=19 && $this->online<=23) $retval = $this->actionConvertGoogle();
- if ($this->online==24) $retval = $this->actionConvertStep3();
- if ($this->online==25) $retval = $this->actionConvertStep4();
- if ($this->online==26) $retval = $this->actionConvertStep5();
- if ($this->online==28) $retval = $this->actionConvertStep6();
- if ($this->online==29) $retval = $this->actionConvertStep7();
- if ($this->online>=32 && $this->online<=44) $retval = $this->actionConvertStep8();
- if ($this->online==45) $retval = $this->actionConvertStep9();
+ if ($this->online==24) $retval = $this->actionConvertKeywordsToTags();
+ if ($this->online==25) $retval = $this->actionConvertFamilies();
+ if ($this->online==26) $retval = $this->actionConvertClasses();
+ if ($this->online==28) $retval = $this->actionConvertDestinationTables();
+ if ($this->online==29) $retval = $this->actionDropcartfields();
+ if ($this->online==30) $retval = $this->actionConvertProductSEO();
+ if ($this->online>=32 && $this->online<=44) $retval = $this->actionImportAmazon();
+ if ($this->online==45) $retval = $this->actionDropcustomerfields();
+ if ($this->online==46) $retval = $this->actionDropProductFields();
+ if ($this->online==47) $retval = $this->actionCalculateInventory();
+ if ($this->online==48) $retval = $this->actionUpdateConfiguration();
echo $retval;
@@ -107,17 +116,21 @@ public function actionUpgrade()
/**
* Before we do anything else, write our config table to our params file for faster access
*/
- protected function actionConvertStepZero()
+ protected function actionConvertStart()
{
+
+ Configuration::exportConfig();
+ Configuration::exportLogging();
+
return json_encode(array('result'=>"success",'makeline'=>2,'total'=>50));
}
/**
* Extract shipping and billing address information, create address book and map to the carts
*/
- protected function actionConvertStep1()
+ protected function actionConvertAddressBook()
{
$sql = "select * from xlsws_cart where billaddress_id IS NULL and address_bill IS NOT NULL order by id limit 500";
@@ -380,7 +393,7 @@ protected function actionConvertStep1()
/**
* Rename modules, load google
*/
- protected function actionConvertStep2()
+ protected function actionConvertModules()
{
//Change country to ID instead of text string based on xlsws_countries
$strCountry = _xls_get_conf('DEFAULT_COUNTRY');
@@ -573,8 +586,11 @@ protected function actionConvertGoogle()
}
-
- protected function actionConvertStep3()
+ /**
+ * 24: Convert the keyword columns into the new tags table
+ * @return string
+ */
+ protected function actionConvertKeywordsToTags()
{
@@ -618,10 +634,10 @@ protected function actionConvertStep3()
}
/**
- * Convert families into Ids and attach
+ * 25: Convert families into Ids and attach
* @return string
*/
- protected function actionConvertStep4()
+ protected function actionConvertFamilies()
{
//families
$sql = "insert ignore into xlsws_family (family) select distinct family from xlsws_product where coalesce(family,'')<>'' order by family";
@@ -639,10 +655,10 @@ protected function actionConvertStep4()
}
/**
- * Convert classes into Ids and attach
+ * 26 Convert classes into Ids and attach
* @return string
*/
- public function actionConvertStep5()
+ public function actionConvertClasses()
{
//class
$sql = "insert ignore into xlsws_classes (class_name) select distinct class_name from xlsws_product where coalesce(class_name,'')<>'' order by class_name";
@@ -658,9 +674,9 @@ public function actionConvertStep5()
/**
- * Change destination tables and map to country/state ids
+ * 28 Change destination tables and map to country/state ids
*/
- protected function actionConvertStep6()
+ protected function actionConvertDestinationTables()
{
//Convert Wish List items to new formats
//Ship to me
@@ -705,9 +721,9 @@ protected function actionConvertStep6()
}
/**
- * Drop fields no longer needed
+ * 29 Drop fields no longer needed
*/
- protected function actionConvertStep7()
+ protected function actionDropCartfields()
{
$sqlstrings = "ALTER TABLE `xlsws_cart` DROP `first_name`;
@@ -742,43 +758,7 @@ protected function actionConvertStep7()
ALTER TABLE `xlsws_cart` DROP `tracking_number`;
ALTER TABLE `xlsws_cart` DROP `email`;
ALTER TABLE `xlsws_cart` DROP `cost_total`;
- ALTER TABLE `xlsws_cart` DROP `sell_total`;
-
- ALTER TABLE `xlsws_customer` DROP `address1_1`;
- ALTER TABLE `xlsws_customer` DROP `address1_2`;
- ALTER TABLE `xlsws_customer` DROP `address2_1`;
- ALTER TABLE `xlsws_customer` DROP `address_2_2`;
- ALTER TABLE `xlsws_customer` DROP `city1`;
- ALTER TABLE `xlsws_customer` DROP `city2`;
- ALTER TABLE `xlsws_customer` DROP `country1`;
- ALTER TABLE `xlsws_customer` DROP `country2`;
- ALTER TABLE `xlsws_customer` DROP `homepage`;
- ALTER TABLE `xlsws_customer` DROP `phone1`;
- ALTER TABLE `xlsws_customer` DROP `phonetype1`;
- ALTER TABLE `xlsws_customer` DROP `phone2`;
- ALTER TABLE `xlsws_customer` DROP `phonetype2`;
- ALTER TABLE `xlsws_customer` DROP `phone3`;
- ALTER TABLE `xlsws_customer` DROP `phonetype3`;
- ALTER TABLE `xlsws_customer` DROP `phone4`;
- ALTER TABLE `xlsws_customer` DROP `phonetype4`;
- ALTER TABLE `xlsws_customer` DROP `state1`;
- ALTER TABLE `xlsws_customer` DROP `state2`;
- ALTER TABLE `xlsws_customer` DROP `zip1`;
- ALTER TABLE `xlsws_customer` DROP `zip2`;
- ALTER TABLE `xlsws_customer` DROP `mainname`;
-
- ALTER TABLE `xlsws_product` DROP `family`;
- ALTER TABLE `xlsws_product` DROP `class_name`;
- ALTER TABLE `xlsws_product` DROP `web_keyword1`;
- ALTER TABLE `xlsws_product` DROP `web_keyword2`;
- ALTER TABLE `xlsws_product` DROP `web_keyword3`;
- ALTER TABLE `xlsws_product` DROP `meta_desc`;
- ALTER TABLE `xlsws_product` DROP `meta_keyword`;
- ALTER TABLE `xlsws_wishlist_item` DROP `registry_status`;
-
- ALTER TABLE `xlsws_wishlist_item` ADD CONSTRAINT `xlsws_wishlist_item_ibfk_1` FOREIGN KEY (`registry_id`) REFERENCES `xlsws_wishlist` (`id`);
-
- DROP TABLE `xlsws_gift_registry_receipents`;";
+ ALTER TABLE `xlsws_cart` DROP `sell_total`;";
$arrSql = explode(";",$sqlstrings);
@@ -788,16 +768,41 @@ protected function actionConvertStep7()
- return json_encode(array('result'=>"success",'makeline'=>32,'tag'=>'Installing Amazon categories (group 1 of 14)','total'=>50));
+ return json_encode(array('result'=>"success",'makeline'=>30,'tag'=>'Creating SEO-friendly URLs','total'=>50));
+
+ }
+
+
+ /**
+ * 30 Create request_urls and export any photos (from pre 2.5 installs)
+ */
+ public function actionConvertProductSEO()
+ {
+ //First, run our request_url creation if needed
+ Product::ConvertSEO(-1);
+ Category::ConvertSEO();
+
+ $matches=Yii::app()->db->createCommand('SELECT count(*) FROM '.Product::model()->tableName().' WHERE request_url IS NULL AND title is not null')->queryScalar();
+ if ($matches>0)
+ return json_encode(array('result'=>"success",'makeline'=>30,'tag'=>'Creating SEO-friendly URLs '.$matches.' remaining','total'=>50));
+ else
+ {
+ //Getting ready for photo convert, drop any orphaned images with blobs
+ _dbx("delete a from xlsws_images as a left join xlsws_product as b on a.id=b.image_id where image_path is null and a.id=a.parent and b.id is null;");
+ echo json_encode(array('result'=>"success",'makeline'=>32,'tag'=>'Installing Amazon categories (group 1 of 14)','total'=>50));
+
+ }
+
}
+
/**
- * load amazon, 24 files starts at online 32
+ * 32-44 load amazon, 24 files
* @return string
*/
- protected function actionConvertStep8()
+ protected function actionImportAmazon()
{
$arr = array();
@@ -855,11 +860,108 @@ protected function actionConvertStep8()
return json_encode(array('result'=>"success",'makeline'=>$this->online,'tag'=>'Installing Amazon categories (group '.($this->online-31)." of 14)", 'total'=>50));
}
+
+ /**
+ * 45 Drop unused customer fields
+ * @return string
+ */
+ protected function actionDropcustomerfields()
+ {
+
+ $sqlstrings =
+ "ALTER TABLE `xlsws_customer` DROP `address1_1`;
+ ALTER TABLE `xlsws_customer` DROP `address1_2`;
+ ALTER TABLE `xlsws_customer` DROP `address2_1`;
+ ALTER TABLE `xlsws_customer` DROP `address_2_2`;
+ ALTER TABLE `xlsws_customer` DROP `city1`;
+ ALTER TABLE `xlsws_customer` DROP `city2`;
+ ALTER TABLE `xlsws_customer` DROP `country1`;
+ ALTER TABLE `xlsws_customer` DROP `country2`;
+ ALTER TABLE `xlsws_customer` DROP `homepage`;
+ ALTER TABLE `xlsws_customer` DROP `phone1`;
+ ALTER TABLE `xlsws_customer` DROP `phonetype1`;
+ ALTER TABLE `xlsws_customer` DROP `phone2`;
+ ALTER TABLE `xlsws_customer` DROP `phonetype2`;
+ ALTER TABLE `xlsws_customer` DROP `phone3`;
+ ALTER TABLE `xlsws_customer` DROP `phonetype3`;
+ ALTER TABLE `xlsws_customer` DROP `phone4`;
+ ALTER TABLE `xlsws_customer` DROP `phonetype4`;
+ ALTER TABLE `xlsws_customer` DROP `state1`;
+ ALTER TABLE `xlsws_customer` DROP `state2`;
+ ALTER TABLE `xlsws_customer` DROP `zip1`;
+ ALTER TABLE `xlsws_customer` DROP `zip2`;
+ ALTER TABLE `xlsws_customer` DROP `mainname`;";
+
+ $arrSql = explode(";",$sqlstrings);
+
+ foreach ($arrSql as $strSql)
+ if (!empty($strSql))
+ Yii::app()->db->createCommand($strSql)->execute();
+
+
+
+ return json_encode(array('result'=>"success",'makeline'=>46,'tag'=>'Removing unused database fields','total'=>50));
+
+ }
+
+
+ /**
+ * 46 Drop product fields
+ * @return string
+ */
+ protected function actionDropProductFields()
+ {
+
+ $sqlstrings = "ALTER TABLE `xlsws_product` DROP `family`;
+ ALTER TABLE `xlsws_product` DROP `class_name`;
+ ALTER TABLE `xlsws_product` DROP `web_keyword1`;
+ ALTER TABLE `xlsws_product` DROP `web_keyword2`;
+ ALTER TABLE `xlsws_product` DROP `web_keyword3`;
+ ALTER TABLE `xlsws_product` DROP `meta_desc`;
+ ALTER TABLE `xlsws_product` DROP `meta_keyword`;
+ ALTER TABLE `xlsws_wishlist_item` DROP `registry_status`;
+
+ ALTER TABLE `xlsws_wishlist_item` ADD CONSTRAINT `xlsws_wishlist_item_ibfk_1` FOREIGN KEY (`registry_id`) REFERENCES `xlsws_wishlist` (`id`);";
+
+ $arrSql = explode(";",$sqlstrings);
+
+ foreach ($arrSql as $strSql)
+ if (!empty($strSql))
+ Yii::app()->db->createCommand($strSql)->execute();
+
+
+
+ return json_encode(array('result'=>"success",'makeline'=>47,'tag'=>'Calculating available inventory','total'=>50));
+
+ }
+
+ /**
+ * 47 Create request_urls and export any photos (from pre 2.5 installs)
+ */
+ public function actionCalculateInventory()
+ {
+ //First, run our request_url creation if needed
+ $matches = Product::RecalculateInventory();
+
+ if ($matches>0)
+ return json_encode(array('result'=>"success",'makeline'=>47,'tag'=>'Calculating available inventory '.$matches.' products remaining','total'=>50));
+ else
+ {
+ return json_encode(array('result'=>"success",'makeline'=>48,'tag'=>'Final cleanup','total'=>50));
+
+ }
+
+
+ }
+
+
+
+
/**
- * Cleanup details, config options that have changed, NULL where we had 0's, etc.
+ * 48 Cleanup details, config options that have changed, NULL where we had 0's, etc.
* @return string
*/
- protected function actionConvertStep9()
+ protected function actionUpdateConfiguration()
{
@@ -896,6 +998,8 @@ protected function actionConvertStep9()
_dbx("update xlsws_wishlist_item set cart_item_id=null where cart_item_id=0;");
_dbx("update xlsws_wishlist_item set purchased_by=null where purchased_by=0;");
+ _dbx("update xlsws_wishlist set visibility=".Wishlist::PERSONALLIST);
+ _dbx("ALTER TABLE `xlsws_wishlist` DROP `registry_password`;");
_dbx("update xlsws_promo_code set valid_from=null where valid_from='0000-00-00';");
_dbx("update xlsws_promo_code set valid_until=null where valid_until='0000-00-00';");
_dbx("delete from xlsws_configuration where `key_name`='PHONE_TYPES';");
@@ -924,7 +1028,7 @@ protected function actionConvertStep9()
_dbx("update xlsws_configuration set sort_order=sort_order+8 where configuration_type_id=19");
_dbx("update xlsws_configuration set `key_name`='THEME',title='Site Theme',options='THEME',
configuration_type_id=0,sort_order=2,param=0 where `key_name`='DEFAULT_TEMPLATE'");
- _dbx("update xlsws_configuration set `key_name`='CHILD_THEME',title='Theme color scheme',
+ _dbx("update xlsws_configuration set `key_name`='CHILD_THEME',title='Theme {color} scheme',
options='CHILD_THEME',sort_order=3,param=0,configuration_type_id=0 where `key_name`='DEFAULT_TEMPLATE_THEME'");
_dbx("INSERT INTO `xlsws_configuration`
(`title`, `key_name`, `key_value`, `helper_text`, `configuration_type_id`, `sort_order`, `options`, `template_specific`, `param`, `required`)
@@ -950,12 +1054,13 @@ protected function actionConvertStep9()
_dbx("UPDATE `xlsws_configuration` SET `key_value`='300' where `key_name`='DATABASE_SCHEMA_VERSION'");
_dbx("UPDATE `xlsws_customer` SET `pricing_level`=1 where pricing_level is null");
- _dbx("INSERT INTO `xlsws_modules` (`active`, `module`, `category`, `version`, `name`, `sort_order`,
- `configuration`, `modified`, `created`)
+ _dbx("INSERT INTO `xlsws_modules` (`active`, `module`, `category`, `version`, `name`, `sort_order`, `configuration`, `modified`, `created`)
VALUES (1, 'wsamazon', 'CEventProduct,CEventPhoto,CEventOrder', 1, 'Amazon MWS', 2, NULL, '2013-04-04 11:34:38', NULL);");
-
return json_encode(array('result'=>"success",'makeline'=>50,'total'=>50));
}
+
+
+
}
View
29 protected/controllers/LegacysoapController.php
@@ -493,10 +493,8 @@ public function update_inventory(
// Now save the product
try {
- $objProduct->inventory_reserved=$objProduct->CalculateReservedInventory();
- $objProduct->inventory_avail=$objProduct->Inventory;
$objProduct->save();
-
+ $objProduct->SetAvailableInventory();
//Create event
$objEvent = new CEventProduct('LegacysoapController','onUpdateInventory',$objProduct);
_xls_raise_events('CEventProduct',$objEvent);
@@ -674,10 +672,6 @@ public function save_product(
$objProduct->web = $blnOnWeb;
$objProduct->featured = $blnFeatured;
- $objProduct->request_url =
- _xls_seo_url(_xls_get_conf('SEO_URL_CODES' , 0) ?
- _xls_parse_language($strName)."-".$strCode : _xls_parse_language($strName));
-
$fltReserved = $objProduct->CalculateReservedInventory();
@@ -795,6 +789,9 @@ public function save_product(
}
+ Product::ConvertSEO($intRowid); //Build request_url
+
+
Yii::app()->db->createCommand('SET FOREIGN_KEY_CHECKS=1;')->execute();
$objEvent = new CEventProduct('LegacysoapController','onSaveProduct',$objProduct);
@@ -2029,13 +2026,7 @@ public function add_order($passkey
if ($objCart instanceof Cart)
$objDocument->cart_id = $objCart->id;
-// $objDocument->Email = $strEmail;
-// $objDocument->Phone = _xls_number_only($strPhone);
-// $objDocument->ShippingSell = $fltShippingSell;
-// $objDocument->ShippingCost = $fltShippingCost;
-//
$objDocument->status = $strStatus;
- //$objDocument->Zipcode = $strZipcode;
if (!$objDocument->save())
{
@@ -2047,6 +2038,11 @@ public function add_order($passkey
$objCart->save();
}
+ if (substr($strId,0,3)=="WO-")
+ Configuration::SetHighestWO();
+
+
+
return self::OK;
}
@@ -2098,12 +2094,7 @@ public function add_order_item($passkey
if (!$retVal)
return self::UNKNOWN_ERROR;
- $objProduct->inventory_reserved=$objProduct->CalculateReservedInventory();
- //Since $objProduct->Inventory isn't the real inventory column, it's a calculation,
- //just pass it to the Avail so we have it for queries elsewhere
- $objProduct->inventory_avail=$objProduct->Inventory;
- $objProduct->save();
-
+ $objProduct->SetAvailableInventory();
return self::OK;
}
View
9 protected/controllers/MyaccountController.php
@@ -91,13 +91,15 @@ public function actionEdit()
}
if ($model->scenario=="create") $model->record_type = Customer::NORMAL_USER;
- if (!$model->save()) {
+ if (!$model->save())
+ {
//Put plain text passwords back for form refresh
$model->password = $strPassword;
$model->password_repeat = $strPassword;
Yii::log("Error creating new user ".print_r($model->getErrors(),true), 'error', 'application.'.__CLASS__.".".__FUNCTION__);
}
- else {
+ else
+ {
if (Yii::app()->user->isGuest)
{
@@ -196,8 +198,9 @@ public function actionCreate()
protected function triggerEmailCampaign($objCustomer,$strTrigger)
{
+
$objEvent = new CEventCustomer('MyAccountController',$strTrigger,$objCustomer);
- _xls_raise_events($strTrigger,$objEvent);
+ _xls_raise_events('CEventCustomer',$objEvent);
}
View
8 protected/controllers/ProductController.php
@@ -68,11 +68,6 @@ public function actionView() {
if ($model->request_url != Yii::app()->getRequest()->getQuery('name'))
_xls_301($model->Link);
- if(!empty($model->image_id))
- $strPrimaryImage = CHtml::image(Images::GetLink($model->image_id,ImagesType::pdetail));
- else $strPrimaryImage='';
-
-
//Set breadcrumbs
$this->breadcrumbs = $model->Breadcrumbs;
$this->pageImageUrl = _xls_site_url($model->SmallImage,true);
@@ -94,11 +89,10 @@ public function actionView() {
$this->setPageTitle($model->PageTitle);
$this->CanonicalUrl = $this->createAbsoluteUrl($model->Link);
$this->returnUrl = $this->CanonicalUrl;
- $dataProvider = $model->GetSliderDataProvider();
+ $model->intQty=1;
$this->render('index',array(
'model'=>$model,
'WishlistAddForm'=>$objWishlistAddForm,
- 'dataProviderRelated'=>$dataProvider,
));
}
View
8 protected/controllers/SiteController.php
@@ -230,6 +230,14 @@ public function actionForgotpassword()
$objCustomer = Customer::model()->findByAttributes(array('record_type'=>Customer::REGISTERED,'email'=>$model->email));
if($objCustomer instanceof Customer)
{
+ if (is_null($objCustomer->password))
+ {
+ $response_array = array(
+ 'status'=>"failure",
+ 'message'=> Yii::t('global','Your email address was found but only as a registered Facebook user. Log in via Facebook.'));
+ echo json_encode($response_array);
+ return;
+ }
$strHtmlBody =$this->renderPartial('/mail/_forgotpassword',array('model'=>$objCustomer), true);
$strSubject = Yii::t('global','Password reminder');
View
16 protected/controllers/WishlistController.php