Page MenuHomeIn-Portal Phabricator

in-commerce
No OneTemporary

File Metadata

Created
Wed, Feb 26, 6:36 PM

in-commerce

Index: branches/5.3.x/units/helpers/order_helper.php
===================================================================
--- branches/5.3.x/units/helpers/order_helper.php (revision 16547)
+++ branches/5.3.x/units/helpers/order_helper.php (revision 16548)
@@ -1,250 +1,248 @@
<?php
defined('FULL_PATH') or die('restricted access!');
class OrderHelper extends kHelper
{
/**
* Returns various information about given order
*
* @param OrdersItem $object
* @param string $currency
* @param bool $remove_errors
* @return Array
*/
function getOrderInfo(&$object, $currency, $remove_errors = true)
{
$errors = $this->Application->RecallVar('checkout_errors');
$ret = Array (
'order' => Array (
'CouponId' => (int)$object->GetDBField('CouponId'),
'CouponName' => (string)$object->GetDBField('CouponName'),
'GiftCertificateId' => (int)$object->GetDBField('GiftCertificateDiscount'),
'GiftCertificateDiscount' => $this->convertCurrency($object->GetDBField('GiftCertificateDiscount'), $currency),
'DiscountTotal' => $this->convertCurrency($object->GetDBField('DiscountTotal'), $currency),
'SubTotal' => $this->convertCurrency($object->GetDBField('SubTotal'), $currency),
),
'items' => Array (),
'errors' => $errors ? unserialize($errors) : Array (),
);
/** @var kDBList $items */
$items = $this->Application->recallObject('orditems', 'orditems_List', Array ('per_page' => -1));
$items->Query();
$items->GoFirst();
$ret['order']['ItemsInCart'] = array_sum( $items->GetCol('Quantity') );
if ( $items->EOL() ) {
return $ret;
}
/** @var kCatDBItem $product */
$product = $this->Application->recallObject('p', null, Array ('skip_autoload' => true));
$sql = $product->GetSelectSQL() . '
WHERE ' . $product->TableName . '.' . $product->IDField . ' IN (' . implode(',', $items->GetCol('ProductId')) . ')';
$products = $this->Conn->Query($sql, $product->IDField);
while ( !$items->EOL() ) {
// prepare product from order item
$product->LoadFromHash( $products[ $items->GetDBField('ProductId') ] );
$this->Application->SetVar('orditems_id', $items->GetID()); // for edit/delete links using GET
// weird code from orditems:PrintList
$this->Application->SetVar('p_id', $product->GetID());
$this->Application->SetVar('m_cat_id', $product->GetDBField('CategoryId'));
// collect order item info
$url_params = Array (
'p_id' => $product->GetID(),
'm_cat_id' => $product->GetDBField('CategoryId'),
'pass' => 'm,p',
);
$product_url = $this->Application->HREF('__default__', '', $url_params);
$item_data = $items->GetDBField('ItemData');
$item_data = $item_data ? unserialize($item_data) : Array ();
$row_index = $items->GetDBField('ProductId') . ':' . $items->GetDBField('OptionsSalt') . ':' . $items->GetDBField('BackOrderFlag');
/** @var ImageHelper $image_helper */
$image_helper = $this->Application->recallObject('ImageHelper');
// TODO: find a way to specify thumbnail size & default image
$ret['items'][$row_index] = Array (
'product_url' => $product_url,
'product_type' => $product->GetDBField('Type'),
'options' => isset($item_data['Options']) ? $item_data['Options'] : false,
'free_promo_shipping' => $this->eligibleForFreePromoShipping($items),
'fields' => Array (
'OrderItemId' => $items->GetDBField('OrderItemId'),
'ProductName' => $items->GetDBField('ProductName'),
'PrimaryImage' => $product->GetField('PrimaryImage', 'resize:58x58;default:img/no_picture.gif'),
'BackOrderFlag' => (int)$items->GetDBField('BackOrderFlag'),
'FlatPrice' => $this->convertCurrency($items->GetDBField('FlatPrice'), $currency),
'Price' => $this->convertCurrency($items->GetDBField('Price'), $currency),
'Quantity' => (int)$items->GetDBField('Quantity'),
'Virtual' => (int)$items->GetDBField('Virtual'),
'Type' => (int)$product->GetDBField('Type'),
'cust_Availability' => $product->GetDBField('cust_Availability'),
),
);
$items->GoNext();
}
if ( $remove_errors ) {
$this->Application->RemoveVar('checkout_errors');
}
return $ret;
}
function convertCurrency($amount, $currency)
{
/** @var CurrencyRates $converter */
$converter = $this->Application->recallObject('CurrencyRates');
// convert primary currency to selected (if they are the same, converter will just return)
return (float)$converter->Convert($amount, 'PRIMARY', $this->getISO($currency));
}
function getISO($currency)
{
if ($currency == 'selected') {
$iso = $this->Application->RecallVar('curr_iso');
}
elseif ($currency == 'primary' || $currency == '') {
$iso = $this->Application->GetPrimaryCurrency();
}
else { //explicit currency
$iso = strtoupper($currency);
}
return $iso;
}
/**
* Checks, that given order item is eligible for free promo shipping
*
* @param kDBItem|kDBList $order_item
* @return bool
*/
function eligibleForFreePromoShipping(&$order_item)
{
if ( $order_item->GetDBField('Type') != PRODUCT_TYPE_TANGIBLE ) {
return false;
}
$free_shipping = $order_item->GetDBField('MinQtyFreePromoShipping');
return $free_shipping > 0 && $free_shipping <= $order_item->GetDBField('Quantity');
}
/**
* Returns a template, that will be used to continue shopping from "shopping cart" template
*
* @param string $template
* @return string
* @access public
*/
public function getContinueShoppingTemplate($template = '')
{
if ( !$template || $template == '__default__' ) {
$template = $this->Application->RecallVar('continue_shopping');
}
if ( !$template ) {
$template = 'in-commerce/index';
}
return $template;
}
/**
* Detects credit card type by it's number.
*
* @param string $number Credit card number.
*
* @return integer
- * @deprecated
+ * @deprecated 5.2.2-B1
+ * @see OrderHelper::getCreditCardType()
*/
public function getCreditCartType($number)
{
- @trigger_error(
- 'Usage of deprecated method OrderHelper::getCreditCartType. Use OrderHelper::getCreditCardType.',
- E_USER_DEPRECATED
- );
+ kUtil::deprecatedMethod(__METHOD__, '5.2.2-B1', 'OrderHelper::getCreditCardType');
return $this->getCreditCardType($number);
}
/**
* Detects credit card type by it's number.
*
* @param string $number Credit card number.
*
* @return integer
*/
public function getCreditCardType($number)
{
// Get rid of any non-digits.
$number = preg_replace('/[^\d]/', '', $number);
$mapping = Array (
'/^4.{15}$|^4.{12}$/' => 1, // Visa
'/^5[1-5].{14}$/' => 2, // MasterCard
'/^3[47].{13}$/' => 3, // American Express
'/^6011.{12}$/' => 4, // Discover
'/^30[0-5].{11}$|^3[68].{12}$/' => 5, // Diners Club
'/^3.{15}$|^2131|1800.{11}$/' => 6, // JBC
);
foreach ($mapping as $number_regex => $card_type) {
if ( preg_match($number_regex, $number) ) {
return $card_type;
}
}
return false;
}
/**
* Extracts fields, used to created user from order
*
* @param OrdersItem $order
* @param string $field_prefix
* @return Array
* @access public
*/
public function getUserFields(&$order, $field_prefix = 'Billing')
{
$fields_hash = Array ();
$names = explode(' ', $order->GetDBField($field_prefix . 'To'), 2);
$fields_hash['FirstName'] = (string)getArrayValue($names, 0);
$fields_hash['LastName'] = (string)getArrayValue($names, 1);
$order_fields = Array (
'Company', 'Phone', 'Fax', 'Email', 'Address1' => 'Street',
'Address2' => 'Street2', 'City', 'State', 'Zip', 'Country'
);
foreach ($order_fields as $src_field => $dst_field) {
if ( is_numeric($src_field) ) {
$src_field = $dst_field;
}
$fields_hash[$dst_field] = $order->GetDBField($field_prefix . $src_field);
}
return $fields_hash;
}
}
Index: branches/5.3.x/units/shipping_quote_engines/shipping_quote_collector.php
===================================================================
--- branches/5.3.x/units/shipping_quote_engines/shipping_quote_collector.php (revision 16547)
+++ branches/5.3.x/units/shipping_quote_engines/shipping_quote_collector.php (revision 16548)
@@ -1,197 +1,196 @@
<?php
/**
* @version $Id$
* @package In-Commerce
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license Commercial License
* This software is protected by copyright law and international treaties.
* Unauthorized reproduction or unlicensed usage of the code of this program,
* or any portion of it may result in severe civil and criminal penalties,
* and will be prosecuted to the maximum extent possible under the law
* See http://www.in-portal.org/commercial-license for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
class ShippingQuoteCollector extends ShippingQuoteEngine {
function GetShippingQuotes($params)
{
/** @var kCountryStatesHelper $cs_helper */
$cs_helper = $this->Application->recallObject('CountryStatesHelper');
-
- $has_states = $cs_helper->CountryHasStates( $cs_helper->getCountryIso($params['dest_country'], true) );
+ $has_states = $cs_helper->CountryHasStates($params['dest_country']);
if (
!$params['dest_city'] || !$params['dest_country'] ||
($has_states && !$params['dest_state']) ||
!$params['dest_postal'] || !$params['packages']
) {
return Array ();
}
$cached_var_name = 'ShippingQuotes' . crc32(serialize($params));
$shipping_types = $this->Application->getDBCache($cached_var_name);
if ($shipping_types) {
return unserialize($shipping_types);
}
$quotes_valid = true;
$shipping_types = Array();
$classes = $this->getEngineClasses();
foreach ($classes as $class) {
/** @var ShippingQuoteEngine $object */
$object = $this->Application->recallObject($class);
$new_shipping_types = $object->GetShippingQuotes($params);
if (is_array($new_shipping_types)) {
$shipping_types = array_merge($shipping_types, $new_shipping_types);
}
else {
$quotes_valid = false;
}
}
uasort($shipping_types, Array(&$this, 'price_sort'));
// exclude not available shipping quotes by products
$limit_types = unserialize($params['limit_types']);
if (is_array($limit_types) && !in_array('ANY', $limit_types)) {
if (count($limit_types) == 0) {
break;
}
$available_types = Array ();
foreach ($shipping_types as $a_type) {
$include = false; // exclude by default
foreach ($limit_types as $limit) {
$include = $include || preg_match("/^$limit/", $a_type['ShippingId']);
if ($include) {
break;
}
}
if (!$include) {
continue;
}
$available_types[ $a_type['ShippingId'] ] = $a_type;
}
$shipping_types = $available_types;
}
// exclude Selected Products Only shipping types, not matching products
$available_types = Array();
foreach ($shipping_types as $a_type) {
if (getArrayValue($a_type, 'SelectedOnly')) {
if (!is_array($limit_types) || !in_array($a_type['ShippingId'], $limit_types)) {
continue;
}
}
$available_types[ $a_type['ShippingId'] ] = $a_type;
}
$shipping_types = $available_types;
if ($quotes_valid) {
$this->Application->setDBCache($cached_var_name, serialize($shipping_types), 24 * 3600);
}
return $shipping_types;
}
function GetAvailableShippingTypes()
{
$shipping_types = Array ();
$classes = $this->getEngineClasses();
foreach ($classes as $class) {
/** @var ShippingQuoteEngine $object */
$object = $this->Application->recallObject($class);
$new_shipping_types = $object->GetAvailableTypes();
$shipping_types = array_merge($shipping_types, $new_shipping_types);
}
uasort($shipping_types, Array(&$this, 'SortShippingTypes'));
return $shipping_types;
}
/**
* Returns all enabled shipping quote engine classes
*
* @return Array
*/
function getEngineClasses()
{
$sql = 'SELECT Classname
FROM ' . $this->Application->getUnitConfig('sqe')->getTableName() . '
WHERE Status = ' . STATUS_ACTIVE;
$classes = $this->Conn->GetCol($sql);
// always persists
$classes[] = 'CustomShippingQuoteEngine';
return $classes;
}
/**
* Returns shipping quote engine, that matches shipping type used in order
*
* @param Array $shipping_info
* @param int $package_num
* @return ShippingQuoteEngine
*/
function &GetClassByType($shipping_info, $package_num = 1)
{
if ( !$shipping_info || !array_key_exists($package_num, $shipping_info) ) {
return false;
}
$classes = $this->getEngineClasses();
$shipping_id = $shipping_info[$package_num]['ShippingId'];
foreach ($classes as $class) {
/** @var ShippingQuoteEngine $object */
$object = $this->Application->recallObject($class);
$shipping_types = $object->GetAvailableTypes();
foreach ($shipping_types as $index => $shipping_type) {
if ( preg_match('/^' . preg_quote($shipping_type['_Id'], '/') . '/', $shipping_id) ) {
return $class;
}
}
}
return false;
}
function SortShippingTypes($elem1, $elem2)
{
if ($elem1['_Name'] == $elem2['_Name']) {
return 0;
}
return $elem1['_Name'] < $elem2['_Name'] ? -1 : 1;
}
function price_sort($elem1, $elem2)
{
if ($elem1['TotalCost'] == $elem2['TotalCost']) {
return 0;
}
return $elem1['TotalCost'] < $elem2['TotalCost'] ? -1 : 1;
}
-}
\ No newline at end of file
+}
Index: branches/5.3.x/install/upgrades.sql
===================================================================
--- branches/5.3.x/install/upgrades.sql (revision 16547)
+++ branches/5.3.x/install/upgrades.sql (revision 16548)
@@ -1,310 +1,316 @@
# ===== v 4.3.9 =====
INSERT INTO ImportScripts VALUES (DEFAULT, 'Products from CSV file [In-Commerce]', '', 'p', 'In-Commerce', '', 'CSV', '1');
ALTER TABLE Products ADD OnSale TINYINT(1) NOT NULL default '0' AFTER Featured, ADD INDEX (OnSale);
UPDATE Phrase SET Module = 'In-Commerce' WHERE Phrase IN ('lu_comm_Images', 'lu_comm_ImagesHeader');
# ===== v 5.0.0 =====
UPDATE Category SET Template = '/in-commerce/designs/section' WHERE Template = 'in-commerce/store/category';
UPDATE Category SET CachedTemplate = '/in-commerce/designs/section' WHERE CachedTemplate = 'in-commerce/store/category';
UPDATE ConfigurationValues SET VariableValue = '/in-commerce/designs/section' WHERE VariableName = 'p_CategoryTemplate';
UPDATE ConfigurationValues SET VariableValue = 'in-commerce/designs/detail' WHERE VariableName = 'p_ItemTemplate';
DELETE FROM PersistantSessionData WHERE VariableName IN ('affil_columns_.', 'ap_columns_.', 'apayments_columns_.', 'apayments.log_columns_.', 'd_columns_.', 'coup_columns_.', 'file_columns_.', 'po_columns_.', 'z_columns_.', 'tax_columns_.');
DELETE FROM PersistantSessionData WHERE VariableName LIKE '%ord.%';
INSERT INTO Permissions VALUES (DEFAULT, 'in-commerce:products.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-commerce:setting_folder.view', 11, 1, 1, 0);
INSERT INTO ShippingQuoteEngines VALUES (DEFAULT, 'USPS.com', 0, 0, 0, 'a:21:{s:12:"AccountLogin";s:0:"";s:15:"AccountPassword";N;s:10:"UPSEnabled";N;s:10:"UPSAccount";s:0:"";s:11:"UPSInvoiced";N;s:10:"FDXEnabled";N;s:10:"FDXAccount";s:0:"";s:10:"DHLEnabled";N;s:10:"DHLAccount";s:0:"";s:11:"DHLInvoiced";N;s:10:"USPEnabled";N;s:10:"USPAccount";s:0:"";s:11:"USPInvoiced";N;s:10:"ARBEnabled";N;s:10:"ARBAccount";s:0:"";s:11:"ARBInvoiced";N;s:10:"1DYEnabled";N;s:10:"2DYEnabled";N;s:10:"3DYEnabled";N;s:10:"GNDEnabled";N;s:10:"ShipMethod";N;}', 'USPS');
INSERT INTO ConfigurationAdmin VALUES ('Comm_CompanyName', 'la_Text_ContactsGeneral', 'la_text_CompanyName', 'text', NULL, NULL, 10.01, 0, 0);
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Comm_CompanyName', '', 'In-Commerce', 'in-commerce:contacts');
UPDATE ConfigurationAdmin SET prompt = 'la_text_StoreName', DisplayOrder = 10.02 WHERE VariableName = 'Comm_StoreName';
INSERT INTO ConfigurationAdmin VALUES ('Comm_Contacts_Name', 'la_Text_ContactsGeneral', 'la_text_ContactName', 'text', NULL, NULL, 10.03, 0, 0);
INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Comm_Contacts_Name', '', 'In-Commerce', 'in-commerce:contacts');
UPDATE ConfigurationAdmin SET DisplayOrder = 10.04 WHERE VariableName = 'Comm_Contacts_Phone';
UPDATE ConfigurationAdmin SET DisplayOrder = 10.05 WHERE VariableName = 'Comm_Contacts_Fax';
UPDATE ConfigurationAdmin SET DisplayOrder = 10.06 WHERE VariableName = 'Comm_Contacts_Email';
UPDATE ConfigurationAdmin SET DisplayOrder = 10.07 WHERE VariableName = 'Comm_Contacts_Additional';
DELETE FROM Phrase WHERE Phrase IN ('la_fld_ManufacturerId', 'la_fld_DiscountId', 'la_fld_CouponId', 'la_fld_AffiliatePlanId', 'la_fld_AffiliateId', 'la_fld_ZoneId', 'la_fld_EngineId', 'la_fld_ShippingId', 'la_fld_ProductId', 'la_fld_OptionId', 'la_fld_CurrencyId', 'la_fld_Zone_Name');
UPDATE Phrase SET Module = 'In-Commerce' WHERE ((Phrase LIKE '%Product%' OR Phrase LIKE '%Shipping%' OR Phrase LIKE '%Coupon%' OR Phrase LIKE '%Discount%' OR Phrase LIKE '%Report%' OR Phrase LIKE '%Currency%' OR Phrase LIKE '%Cart%') AND (Module = 'Core'));
# ===== v 5.0.1 =====
UPDATE ConfigurationValues SET VariableValue = 'in-commerce/products/product_detail' WHERE VariableName = 'p_ItemTemplate';
UPDATE ConfigurationAdmin SET ValueList = '1=la_opt_Session,2=la_opt_PermanentCookie' WHERE VariableName = 'Comm_AffiliateStorageMethod';
UPDATE ConfigurationAdmin SET ValueList = 'ASC=la_common_Ascending,DESC=la_common_Descending'
WHERE VariableName IN ('product_OrderProductsByDir', 'product_OrderProductsThenByDir');
UPDATE ConfigurationAdmin SET ValueList = '1=la_opt_PriceCalculationByPrimary,2=la_opt_PriceCalculationByOptimal'
WHERE VariableName = 'Comm_PriceBracketCalculation';
UPDATE ConfigurationAdmin
SET ValueList = '1=la_opt_Sec,60=la_opt_Min,3600=la_opt_Hour,86400=la_opt_Day,604800=la_opt_Week,2419200=la_opt_Month,29030400=la_opt_Year'
WHERE VariableName IN ('product_ReviewDelay_Interval', 'product_RatingDelay_Interval');
UPDATE CustomField SET FieldLabel = 'la_fld_cust_p_ItemTemplate', Prompt = 'la_fld_cust_p_ItemTemplate' WHERE FieldName = 'p_ItemTemplate';
UPDATE Events SET Type = 1 WHERE Event = 'BACKORDER.FULLFILL';
UPDATE ConfigurationAdmin SET ValueList = 'style="width: 50px;"' WHERE VariableName IN ('product_RatingDelay_Value', 'product_ReviewDelay_Value');
# ===== v 5.0.2-B1 =====
ALTER TABLE AffiliatePayments
CHANGE Comment Comment text NULL,
CHANGE PaymentDate PaymentDate INT(10) UNSIGNED NULL DEFAULT NULL;
ALTER TABLE AffiliatePaymentTypes CHANGE Description Description text NULL;
ALTER TABLE Affiliates
CHANGE Comments Comments text NULL,
CHANGE CreatedOn CreatedOn INT(11) NULL DEFAULT NULL;
ALTER TABLE Manufacturers CHANGE Description Description text NULL;
ALTER TABLE Orders
CHANGE UserComment UserComment text NULL,
CHANGE AdminComment AdminComment text NULL,
CHANGE GWResult1 GWResult1 MEDIUMTEXT NULL,
CHANGE GWResult2 GWResult2 MEDIUMTEXT NULL,
CHANGE OrderDate OrderDate INT(10) UNSIGNED NULL DEFAULT NULL,
CHANGE PaymentExpires PaymentExpires INT(10) UNSIGNED NULL DEFAULT NULL;
ALTER TABLE PaymentTypes CHANGE PortalGroups PortalGroups text NULL;
ALTER TABLE ProductOptionCombinations CHANGE Combination Combination text NULL;
ALTER TABLE Products
CHANGE ShippingLimitation ShippingLimitation text NULL,
CHANGE PackageContent PackageContent MEDIUMTEXT NULL;
ALTER TABLE ShippingQuoteEngines CHANGE Properties Properties text NULL;
ALTER TABLE ShippingType CHANGE PortalGroups PortalGroups text NULL;
ALTER TABLE ProductFiles
CHANGE ProductId ProductId INT(11) NOT NULL DEFAULT '0',
CHANGE `Name` `Name` VARCHAR(255) NOT NULL DEFAULT '',
CHANGE Version Version VARCHAR(100) NOT NULL DEFAULT '',
CHANGE FilePath FilePath VARCHAR(255) NOT NULL DEFAULT '',
CHANGE RealPath RealPath VARCHAR(255) NOT NULL DEFAULT '',
CHANGE Size Size INT(11) NOT NULL DEFAULT '0',
CHANGE AddedOn AddedOn INT(11) NULL DEFAULT NULL;
ALTER TABLE UserFileAccess
CHANGE ProductId ProductId INT( 11 ) NOT NULL DEFAULT '0',
CHANGE PortalUserId PortalUserId INT( 11 ) NOT NULL DEFAULT '0';
ALTER TABLE GatewayConfigFields CHANGE ValueList ValueList MEDIUMTEXT NULL;
ALTER TABLE Currencies
CHANGE `Status` `Status` SMALLINT(6) NOT NULL DEFAULT '1',
CHANGE Modified Modified INT(11) NULL DEFAULT NULL;
ALTER TABLE GiftCertificates CHANGE `Status` `Status` TINYINT(1) NOT NULL DEFAULT '2';
ALTER TABLE UserDownloads
CHANGE StartedOn StartedOn INT(11) NULL DEFAULT NULL,
CHANGE EndedOn EndedOn INT(11) NULL DEFAULT NULL;
# ===== v 5.0.2-B2 =====
# ===== v 5.0.2-RC1 =====
# ===== v 5.0.2 =====
# ===== v 5.0.3-B1 =====
UPDATE Phrase
SET PhraseType = 1
WHERE Phrase IN (
'la_ship_All_Together', 'la_ship_Backorders_Upon_Avail', 'la_ship_Backorder_Separately',
'lu_ship_Shipment', 'lu_ship_ShippingType'
);
# ===== v 5.0.3-B2 =====
# ===== v 5.0.3-RC1 =====
# ===== v 5.0.3 =====
# ===== v 5.0.4-B1 =====
# ===== v 5.0.4-B2 =====
# ===== v 5.0.4 =====
# ===== v 5.1.0-B1 =====
UPDATE Modules SET Path = 'modules/in-commerce/' WHERE `Name` = 'In-Commerce';
UPDATE ConfigurationValues
SET ValueList = '0=lu_none||<SQL+>SELECT l%3$s_Name AS OptionName, IsoCode AS OptionValue FROM <PREFIX>CountryStates WHERE Type = 1 ORDER BY OptionName</SQL>'
WHERE ValueList = '0=lu_none||<SQL>SELECT DestName AS OptionName, DestAbbr AS OptionValue FROM <PREFIX>StdDestinations WHERE DestParentId IS NULL Order BY OptionName</SQL>';
ALTER TABLE SiteDomains
ADD COLUMN BillingCountry varchar(3) NOT NULL DEFAULT '',
ADD COLUMN ShippingCountry varchar(3) NOT NULL DEFAULT '',
ADD COLUMN PrimaryCurrencyId int(11) NOT NULL DEFAULT '0',
ADD COLUMN Currencies varchar(255) NOT NULL DEFAULT '',
ADD COLUMN PrimaryPaymentTypeId int(11) NOT NULL DEFAULT '0',
ADD COLUMN PaymentTypes varchar(255) NOT NULL DEFAULT '',
ADD INDEX (BillingCountry),
ADD INDEX (ShippingCountry),
ADD INDEX (PrimaryCurrencyId),
ADD INDEX (Currencies),
ADD INDEX (PrimaryPaymentTypeId),
ADD INDEX (PaymentTypes);
UPDATE Phrase SET Module = 'Core' WHERE Phrase IN ('la_btn_Add', 'la_fld_RecipientName', 'la_fld_SenderName');
DELETE FROM Permissions WHERE Permission LIKE 'in-commerce:incommerce_configemail%';
# ===== v 5.1.0-B2 =====
# ===== v 5.1.0-RC1 =====
UPDATE Phrase
SET PhraseType = 1
WHERE Phrase IN (
'la_col_Qty', 'la_col_QtyBackordered', 'la_ItemBackordered', 'la_ship_all_together',
'la_ship_backorders_upon_avail', 'la_ship_backorder_separately', 'la_tooltip_New_Coupon',
'la_tooltip_New_Discount'
);
DELETE FROM Phrase WHERE Phrase = 'la_comm_ProductsByManuf';
# ===== v 5.1.0 =====
ALTER TABLE Products CHANGE CachedRating CachedRating varchar(10) NOT NULL default '0';
# ===== v 5.1.1-B1 =====
ALTER TABLE Orders CHANGE ShippingOption ShippingOption TINYINT(4) NOT NULL DEFAULT '0';
ALTER TABLE ProductFiles CHANGE AddedById AddedById INT(11) NULL DEFAULT NULL;
UPDATE ProductFiles SET AddedById = NULL WHERE AddedById = 0;
ALTER TABLE Products
CHANGE CreatedById CreatedById INT(11) NULL DEFAULT NULL ,
CHANGE ModifiedById ModifiedById INT(11) NULL DEFAULT NULL;
UPDATE Products SET CreatedById = NULL WHERE CreatedById = 0;
UPDATE Products SET ModifiedById = NULL WHERE ModifiedById = 0;
# ===== v 5.1.1-B2 =====
# ===== v 5.1.1-RC1 =====
# ===== v 5.1.1 =====
# ===== v 5.1.2-B1 =====
DELETE FROM Phrase WHERE PhraseKey = 'LA_TITLE_ADDING_ORDER_ITEM';
# ===== v 5.1.2-B2 =====
UPDATE Phrase SET l<%PRIMARY_LANGUAGE%>_Translation = REPLACE(l<%PRIMARY_LANGUAGE%>_Translation, 'Discounts & Coupons', 'Discounts & Certificates') WHERE PhraseKey = 'LA_TAB_DISCOUNTSANDCOUPONS';
# ===== v 5.1.2-RC1 =====
UPDATE Phrase SET Module = 'Core' WHERE PhraseKey = 'LA_FLD_ISOCODE' OR PhraseKey = 'LA_COL_ISOCODE';
# ===== v 5.1.2 =====
# ===== v 5.1.3-B1 =====
ALTER TABLE AffiliatePlansBrackets CHANGE Percent Percent DECIMAL (10,2) NOT NULL DEFAULT '0.00';
# ===== v 5.1.3-B2 =====
# ===== v 5.1.3-RC1 =====
UPDATE ConfigurationValues
SET VariableValue = 'in-commerce/products/product_detail'
WHERE VariableName = 'p_ItemTemplate' AND VariableValue = 'in-commerce/designs/detail';
# ===== v 5.1.3-RC2 =====
# ===== v 5.1.3 =====
# ===== v 5.2.0-B1 =====
UPDATE SearchConfig
SET DisplayName = REPLACE(DisplayName, 'lu_', 'lc_')
WHERE DisplayName IN ('lu_field_descriptionex', 'lu_field_manufacturer', 'lu_field_qtysold', 'lu_field_topseller');
INSERT INTO SystemSettings VALUES(DEFAULT, 'OrderVATIncluded', '0', 'In-Commerce', 'in-commerce:general', 'la_Text_Orders', 'la_config_OrderVATIncluded', 'checkbox', NULL, NULL, 10.12, '0', '0', NULL);
ALTER TABLE Orders ADD VATIncluded TINYINT(1) UNSIGNED NOT NULL DEFAULT '0';
INSERT INTO ItemFilters VALUES
(DEFAULT, 'p', 'ManufacturerId', 'checkbox', 1, NULL),
(DEFAULT, 'p', 'Price', 'range', 1, 11),
(DEFAULT, 'p', 'EditorsPick', 'radio', 1, NULL);
DELETE FROM LanguageLabels WHERE PhraseKey = 'LA_COL_ITEMNAME';
DELETE FROM LanguageLabels
WHERE PhraseKey IN ('LA_ALLOWORDERINGINNONPRIMARYCURRENCY', 'LA_ALLOWORDERDIFFERENTTYPES');
DELETE FROM SystemSettings
WHERE VariableName IN ('Comm_AllowOrderingInNonPrimaryCurrency', 'Comm_Allow_Order_Different_Types');
UPDATE SystemSettings
SET DisplayOrder = 20.01
WHERE VariableName = 'Comm_ExchangeRateSource';
UPDATE SystemSettings
SET DisplayOrder = DisplayOrder - 0.01
WHERE VariableName IN (
'Comm_Enable_Backordering', 'Comm_Process_Backorders_Auto', 'Comm_Next_Order_Number', 'Comm_Order_Number_Format_P',
'Comm_Order_Number_Format_S', 'Comm_RecurringChargeInverval', 'Comm_AutoProcessRecurringOrders', 'MaxAddresses',
'Comm_MaskProcessedCreditCards', 'OrderVATIncluded'
);
INSERT INTO SystemSettings VALUES(DEFAULT, 'MaxCompareProducts', '3', 'In-Commerce', 'in-commerce:output', 'la_Text_Products', 'la_config_MaxCompareProducts', 'text', NULL, NULL, 10.12, 0, 1, NULL);
# ===== v 5.2.0-B2 =====
UPDATE Products main_table
SET main_table.CachedReviewsQty = (SELECT COUNT(*) FROM <%TABLE_PREFIX%>CatalogReviews review_table WHERE review_table.ItemId = main_table.ResourceId);
# ===== v 5.2.0-B3 =====
ALTER TABLE OrderItems CHANGE OptionsSalt OptionsSalt BIGINT(11) NULL DEFAULT '0';
UPDATE OrderItems
SET OptionsSalt = CAST((OptionsSalt & 0xFFFFFFFF) AS UNSIGNED INTEGER)
WHERE OptionsSalt < 0;
ALTER TABLE ProductOptionCombinations CHANGE CombinationCRC CombinationCRC BIGINT(11) NOT NULL DEFAULT '0';
UPDATE ProductOptionCombinations
SET CombinationCRC = CAST((CombinationCRC & 0xFFFFFFFF) AS UNSIGNED INTEGER)
WHERE CombinationCRC < 0;
# ===== v 5.2.0-RC1 =====
DELETE FROM Currencies WHERE ISO = 'NZD' LIMIT 1;
# ===== v 5.2.0 =====
INSERT INTO Permissions VALUES(DEFAULT, 'in-commerce:general.add', 11, 1, 1, 0);
INSERT INTO Permissions VALUES(DEFAULT, 'in-commerce:output.add', 11, 1, 1, 0);
INSERT INTO Permissions VALUES(DEFAULT, 'in-commerce:contacts.add', 11, 1, 1, 0);
# ===== v 5.2.1-B1 =====
ALTER TABLE Affiliates CHANGE PortalUserId PortalUserId INT(10) NULL DEFAULT NULL;
UPDATE Affiliates SET PortalUserId = NULL WHERE PortalUserId = 0;
# ===== v 5.2.1-B2 =====
UPDATE Modules
SET ClassNamespace = 'Intechnic\\InPortal\\Modules\\InCommerce'
WHERE `Name` = 'In-Commerce';
# ===== v 5.2.1-RC1 =====
# ===== v 5.2.1 =====
# ===== v 5.2.2-B1 =====
+# ===== v 5.2.2-B2 =====
+UPDATE Modules
+SET ClassNamespace = 'InPortal\\Modules\\InCommerce'
+WHERE `Name` = 'In-Commerce';
+
# ===== v 5.3.0-B1 =====
ALTER TABLE Affiliates DROP SSN;
DELETE FROM LanguageLabels WHERE PhraseKey IN ('LA_FLD_SSN', 'LU_COMM_SSNFIELD', 'LU_FLD_SSNFIELD');
-UPDATE Modules
-SET ClassNamespace = 'InPortal\\Modules\\InCommerce'
-WHERE `Name` = 'In-Commerce';
+# Backported in http://jira.in-portal.org/browse/INP-1690.
+# UPDATE Modules
+# SET ClassNamespace = 'InPortal\\Modules\\InCommerce'
+# WHERE `Name` = 'In-Commerce';
INSERT INTO SearchConfig VALUES ('Products', 'MetaKeywords', 0, 1, '', 'lc_field_MetaKeywords', 'In-Commerce', 'la_Text_Products', 24, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO SearchConfig VALUES ('Products', 'MetaDescription', 0, 1, '', 'lc_field_MetaDescription', 'In-Commerce', 'la_Text_Products', 25, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
Index: branches/5.3.x
===================================================================
--- branches/5.3.x (revision 16547)
+++ branches/5.3.x (revision 16548)
Property changes on: branches/5.3.x
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
Merged /w/in-commerce/branches/5.2.x:r16527,16536,16541

Event Timeline