From 5c684c504dce069d149bb7233734da2c1002faf7 Mon Sep 17 00:00:00 2001 From: geraldbullard Date: Wed, 12 Mar 2014 13:03:48 -0400 Subject: [PATCH 01/15] hard coded text for "Checkout" in header nav, replaced with lang define --- catalog/templates/core/header.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalog/templates/core/header.php b/catalog/templates/core/header.php index 47b92ac6a..c09d8c64b 100644 --- a/catalog/templates/core/header.php +++ b/catalog/templates/core/header.php @@ -202,7 +202,7 @@ echo lc_link_object($lC_Template->getBranding('social_linkedin'), lc_image(DIR_WS_IMAGES . 'icons/in-ico.png', 'title', null, null, 'class="small-margin-right social-nav-in"'), 'target="_blank"'); } ?> - + From 5292b544b6e5150edd9c6538709fbad7a00b3e6e Mon Sep 17 00:00:00 2001 From: geraldbullard Date: Wed, 12 Mar 2014 13:06:44 -0400 Subject: [PATCH 02/15] added addslashes() to main js file for breaking in french language. --- catalog/includes/javascript/general.js.php | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/catalog/includes/javascript/general.js.php b/catalog/includes/javascript/general.js.php index 86c9755f3..574037b86 100644 --- a/catalog/includes/javascript/general.js.php +++ b/catalog/includes/javascript/general.js.php @@ -14,7 +14,7 @@ function setMaintenanceMode(s) { if (s == 'on') { - $("#loaded7").mask('get('text_site_maintenance_message'); ?>'); + $("#loaded7").mask('get('text_site_maintenance_message')); ?>'); $('.loadmask-msg').css({'top':'200px'}); } else { $("body").unmask(); @@ -54,14 +54,14 @@ function setMaintenanceMode(s) { include_once($lC_Vqmod->modCheck('templates/' . $lC_Template->getCode() . '/classes/output.php')); if (lC_Template_output::getProductsStock($id) < 1) { ?> - $(":contains('get('button_buy_now'); ?>')").closest('button').removeClass("btn-success").addClass("btn-default").addClass("disabled").html('get('out_of_stock'); ?>'); + $(":contains('get('button_buy_now')); ?>')").closest('button').removeClass("btn-success").addClass("btn-default").addClass("disabled").html('get('out_of_stock')); ?>'); $("input[name='quantity']").hide().parent().hide(); - $(":contains('get('out_of_stock'); ?>')").closest('button').removeClass("btn-success").addClass("btn-default"); + $(":contains('get('out_of_stock')); ?>')").closest('button').removeClass("btn-success").addClass("btn-default"); }); @@ -144,21 +144,21 @@ function (data) { if (data.rpcStatus != 1) { $('#coupon_code').val(''); if (data.rpcStatus == -2) { - alert('get('ms_error_coupon_not_found'); ?>'); + alert('get('ms_error_coupon_not_found')); ?>'); } else if (data.rpcStatus == -3) { - alert('get('ms_error_coupon_not_valid'); ?>'); + alert('get('ms_error_coupon_not_valid')); ?>'); } else if (data.rpcStatus == -4) { - alert('get('ms_error_coupon_purchase_not_over_1'); ?> ' + data.msg + ' get('ms_error_coupon_purchase_not_over_2'); ?>'); + alert('get('ms_error_coupon_purchase_not_over_1')); ?> ' + data.msg + ' get('ms_error_coupon_purchase_not_over_2')); ?>'); } else if (data.rpcStatus == -5) { - alert('get('ms_error_coupon_start_date'); ?> ' + data.msg + '. get('ms_error_coupon_check_coupon'); ?>'); + alert('get('ms_error_coupon_start_date')); ?> ' + data.msg + '. get('ms_error_coupon_check_coupon')); ?>'); } else if (data.rpcStatus == -6) { - alert('get('ms_error_coupon_expires_date'); ?> ' + data.msg + '. get('ms_error_coupon_check_coupon'); ?>'); + alert('get('ms_error_coupon_expires_date')); ?> ' + data.msg + '. get('ms_error_coupon_check_coupon')); ?>'); } else if (data.rpcStatus == -7) { - alert('get('ms_error_coupon_max_uses'); ?>'); + alert('get('ms_error_coupon_max_uses')); ?>'); } else if (data.rpcStatus == -8) { - alert('get('ms_error_coupon_max_uses'); ?>'); + alert('get('ms_error_coupon_max_uses')); ?>'); } else { - alert('get('ms_error_action_not_performed'); ?>'); + alert('get('ms_error_action_not_performed')); ?>'); } return false; } @@ -173,7 +173,7 @@ function removeCoupon(code) { $.getJSON(jsonLink.replace('CODE', code).split('amp;').join(''), function (data) { if (data.rpcStatus != 1) { - alert('get('ms_error_action_not_performed'); ?>'); + alert('get('ms_error_action_not_performed')); ?>'); return false; } window.location.href = window.location.href; @@ -264,7 +264,7 @@ function (data) { $.getJSON(jsonLink, function (data) { if (data.rpcStatus != 1) { - $.modal.alert('get('ms_error_action_not_performed'); ?>'); + $.modal.alert('get('ms_error_action_not_performed')); ?>'); return false; } $('#ShowQRCode').html(data.html); From 56defac0ab15b1dc9de8e94500b6d8569e6db9b2 Mon Sep 17 00:00:00 2001 From: datazen Date: Thu, 13 Mar 2014 10:33:20 -0400 Subject: [PATCH 03/15] [2606] added login as customer supporting files --- .../applications/customers/classes/customers.php | 11 +++++++++-- .../applications/customers/js/customers.js.php | 4 ++-- .../admin/includes/languages/en_US/customers.php | 2 +- catalog/includes/content/account/logoff.php | 1 + catalog/includes/languages/en_US.xml | 5 +++++ catalog/templates/core/content/account/login.php | 13 ++++++++++++- catalog/templates/core/header.php | 3 ++- 7 files changed, 32 insertions(+), 7 deletions(-) diff --git a/catalog/admin/includes/applications/customers/classes/customers.php b/catalog/admin/includes/applications/customers/classes/customers.php index 4a7ea9413..36c8c03e1 100644 --- a/catalog/admin/includes/applications/customers/classes/customers.php +++ b/catalog/admin/includes/applications/customers/classes/customers.php @@ -122,8 +122,15 @@ public static function getAll() { $group = '' . lc_get_customer_groups_name($Qcustomers->valueInt('customers_group_id')) . ''; $date = '' . lC_DateTime::getShort($Qcustomers->value('date_account_created')) . ''; $action = ' - ' . '   - '; + + ' . (($media === 'mobile-portrait' || $media === 'mobile-landscape') ? NULL : $lC_Language->get('icon_edit')) . ' + + + + + + + '; $result['aaData'][] = array("$check", "$gender", "$name", "$email", "$order_count", "$group", "$date", "$action"); $cnt++; } diff --git a/catalog/admin/includes/applications/customers/js/customers.js.php b/catalog/admin/includes/applications/customers/js/customers.js.php index e137829dc..97e2d67fa 100644 --- a/catalog/admin/includes/applications/customers/js/customers.js.php +++ b/catalog/admin/includes/applications/customers/js/customers.js.php @@ -26,11 +26,11 @@ "aoColumns": [{ "sWidth": "10px", "bSortable": false, "sClass": "hide-on-mobile dataColCheck" }, { "sWidth": "10px", "bSortable": false, "sClass": "hide-on-mobile dataColIcon" }, { "sWidth": "22%", "bSortable": true, "sClass": "dataColLast" }, - { "sWidth": "30%", "bSortable": true, "sClass": "hide-on-mobile hide-on-tablet dataColEmail" }, + { "sWidth": "25%", "bSortable": true, "sClass": "hide-on-mobile hide-on-tablet dataColEmail" }, { "sWidth": "8%", "bSortable": true, "sClass": "hide-on-mobile-portrait dataColFirst" }, { "sWidth": "10%", "bSortable": true, "sClass": "hide-on-mobile-portrait dataColGroup" }, { "sWidth": "10%", "bSortable": true, "sClass": "hide-on-tablet hide-on-mobile dataColDate" }, - { "sWidth": "20%", "bSortable": false, "sClass": "dataColAction" }] + { "sWidth": "25%", "bSortable": false, "sClass": "dataColAction" }] }); setTimeout('hideElements()', 800); // because of server-side processing we need to delay for race condition diff --git a/catalog/admin/includes/languages/en_US/customers.php b/catalog/admin/includes/languages/en_US/customers.php index 1651c0d51..7c193c6f5 100644 --- a/catalog/admin/includes/languages/en_US/customers.php +++ b/catalog/admin/includes/languages/en_US/customers.php @@ -97,4 +97,4 @@ text_new_address_saved = New Address Saved text_changes_saved = Changes Saved -button_continue_title_tag = Add address +button_continue_title_tag = Add address \ No newline at end of file diff --git a/catalog/includes/content/account/logoff.php b/catalog/includes/content/account/logoff.php index 263dea52e..799c3f071 100644 --- a/catalog/includes/content/account/logoff.php +++ b/catalog/includes/content/account/logoff.php @@ -35,6 +35,7 @@ protected function _process() { $lC_ShoppingCart->reset(); $lC_Coupons->reset(); $lC_Customer->reset(); + if (isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === TRUE) unset($_SESSION['admin_login']); } } ?> \ No newline at end of file diff --git a/catalog/includes/languages/en_US.xml b/catalog/includes/languages/en_US.xml index f9ec1ef77..e234fb82d 100644 --- a/catalog/includes/languages/en_US.xml +++ b/catalog/includes/languages/en_US.xml @@ -2900,5 +2900,10 @@ Your friend, %s, thought that you would be interested in %s from %s.]]> general + + text_admin_session_active + + general + \ No newline at end of file diff --git a/catalog/templates/core/content/account/login.php b/catalog/templates/core/content/account/login.php index 2685a34d9..1b5c1c1da 100644 --- a/catalog/templates/core/content/account/login.php +++ b/catalog/templates/core/content/account/login.php @@ -46,5 +46,16 @@ - + + \ No newline at end of file diff --git a/catalog/templates/core/header.php b/catalog/templates/core/header.php index c09d8c64b..47f3536ea 100644 --- a/catalog/templates/core/header.php +++ b/catalog/templates/core/header.php @@ -8,6 +8,7 @@ @license https://github.com/loadedcommerce/loaded7/blob/master/LICENSE.txt @version $Id: header.php v1.0 2013-08-08 datazen $ */ +if (isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === TRUE) echo '
' . $lC_Language->get('text_admin_session_active') . '
'; ?>
@@ -202,7 +203,7 @@ echo lc_link_object($lC_Template->getBranding('social_linkedin'), lc_image(DIR_WS_IMAGES . 'icons/in-ico.png', 'title', null, null, 'class="small-margin-right social-nav-in"'), 'target="_blank"'); } ?> - + From 68831bc10a5ea603ee170bbef53427564f621037 Mon Sep 17 00:00:00 2001 From: datazen Date: Fri, 14 Mar 2014 09:41:16 -0400 Subject: [PATCH 04/15] [B2810] repaired currencies issue with amounts over a thousand --- catalog/includes/classes/currencies.php | 13 ++++++++----- catalog/includes/version.txt | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/catalog/includes/classes/currencies.php b/catalog/includes/classes/currencies.php index 3ad911624..2380306a9 100644 --- a/catalog/includes/classes/currencies.php +++ b/catalog/includes/classes/currencies.php @@ -60,19 +60,18 @@ public function formatRaw($number, $currency_code = '', $currency_value = '') { public function addTaxRateToPrice($price, $tax_rate, $quantity = 1) { global $lC_Tax; - + $price = $this->santizePrice($price); $price = lc_round($price, $this->currencies[DEFAULT_CURRENCY]['decimal_places']); if ( (DISPLAY_PRICE_WITH_TAX == '1') && ($tax_rate > 0) ) { $price += lc_round($price * ($tax_rate / 100), $this->currencies[DEFAULT_CURRENCY]['decimal_places']); } - return lc_round($price * $quantity, $this->currencies[DEFAULT_CURRENCY]['decimal_places']); } public function displayPrice($price, $tax_class_id, $quantity = 1, $currency_code = null, $currency_value = null) { global $lC_Tax; - + $price = $this->santizePrice($price); $price = lc_round($price, $this->currencies[DEFAULT_CURRENCY]['decimal_places']); if ( (DISPLAY_PRICE_WITH_TAX == '1') && ($tax_class_id > 0) ) { @@ -84,15 +83,19 @@ public function displayPrice($price, $tax_class_id, $quantity = 1, $currency_cod public function displayPriceWithTaxRate($price, $tax_rate, $quantity = 1, $force = false, $currency_code = '', $currency_value = '') { global $lC_Tax; - + $price = $this->santizePrice($price); $price = lc_round($price, $this->currencies[DEFAULT_CURRENCY]['decimal_places']); if ( (($force === true) || (DISPLAY_PRICE_WITH_TAX == '1')) && ($tax_rate > 0) ) { $price += lc_round($price * ($tax_rate / 100), $this->currencies[DEFAULT_CURRENCY]['decimal_places']); } - return $this->format($price * $quantity, $currency_code, $currency_value); } + + public function santizePrice($price){ + //santize the prise string + return(str_replace(",", "", $price)); + } public function exists($code) { if (isset($this->currencies[$code])) { diff --git a/catalog/includes/version.txt b/catalog/includes/version.txt index a32df4de4..540367d20 100644 --- a/catalog/includes/version.txt +++ b/catalog/includes/version.txt @@ -1 +1 @@ -7.002.1.3|03/11/2014 +7.002.1.4|03/14/2014 From ef27a7c0439a9c4b463e370a2494efa53cb332e1 Mon Sep 17 00:00:00 2001 From: datazen Date: Fri, 14 Mar 2014 09:50:18 -0400 Subject: [PATCH 05/15] B2810 - merged currencies fix from hotfix 1.4 --- catalog/includes/classes/currencies.php | 13 ++++++++----- catalog/includes/version.txt | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/catalog/includes/classes/currencies.php b/catalog/includes/classes/currencies.php index 3ad911624..2380306a9 100644 --- a/catalog/includes/classes/currencies.php +++ b/catalog/includes/classes/currencies.php @@ -60,19 +60,18 @@ public function formatRaw($number, $currency_code = '', $currency_value = '') { public function addTaxRateToPrice($price, $tax_rate, $quantity = 1) { global $lC_Tax; - + $price = $this->santizePrice($price); $price = lc_round($price, $this->currencies[DEFAULT_CURRENCY]['decimal_places']); if ( (DISPLAY_PRICE_WITH_TAX == '1') && ($tax_rate > 0) ) { $price += lc_round($price * ($tax_rate / 100), $this->currencies[DEFAULT_CURRENCY]['decimal_places']); } - return lc_round($price * $quantity, $this->currencies[DEFAULT_CURRENCY]['decimal_places']); } public function displayPrice($price, $tax_class_id, $quantity = 1, $currency_code = null, $currency_value = null) { global $lC_Tax; - + $price = $this->santizePrice($price); $price = lc_round($price, $this->currencies[DEFAULT_CURRENCY]['decimal_places']); if ( (DISPLAY_PRICE_WITH_TAX == '1') && ($tax_class_id > 0) ) { @@ -84,15 +83,19 @@ public function displayPrice($price, $tax_class_id, $quantity = 1, $currency_cod public function displayPriceWithTaxRate($price, $tax_rate, $quantity = 1, $force = false, $currency_code = '', $currency_value = '') { global $lC_Tax; - + $price = $this->santizePrice($price); $price = lc_round($price, $this->currencies[DEFAULT_CURRENCY]['decimal_places']); if ( (($force === true) || (DISPLAY_PRICE_WITH_TAX == '1')) && ($tax_rate > 0) ) { $price += lc_round($price * ($tax_rate / 100), $this->currencies[DEFAULT_CURRENCY]['decimal_places']); } - return $this->format($price * $quantity, $currency_code, $currency_value); } + + public function santizePrice($price){ + //santize the prise string + return(str_replace(",", "", $price)); + } public function exists($code) { if (isset($this->currencies[$code])) { diff --git a/catalog/includes/version.txt b/catalog/includes/version.txt index 01f08e3f1..540367d20 100644 --- a/catalog/includes/version.txt +++ b/catalog/includes/version.txt @@ -1 +1 @@ -7.002.1.3|03/10/2014 +7.002.1.4|03/14/2014 From cb06949f25990954d9f44f6b3c3c6bdc3999c6b9 Mon Sep 17 00:00:00 2001 From: datazen Date: Fri, 14 Mar 2014 12:34:56 -0400 Subject: [PATCH 06/15] 2813 - repaired currency issue --- catalog/includes/classes/currencies.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/catalog/includes/classes/currencies.php b/catalog/includes/classes/currencies.php index 2380306a9..b42247c52 100644 --- a/catalog/includes/classes/currencies.php +++ b/catalog/includes/classes/currencies.php @@ -12,7 +12,7 @@ class lC_Currencies { // class constructor public function lC_Currencies() { - global $lC_Database; + global $lC_Database, $lC_Language; $Qcurrencies = $lC_Database->query('select * from :table_currencies'); $Qcurrencies->bindTable(':table_currencies', TABLE_CURRENCIES); @@ -20,10 +20,13 @@ public function lC_Currencies() { $Qcurrencies->execute(); while ($Qcurrencies->next()) { + $symbol_left = ($lC_Language->get('charset') == 'utf-8') ? lc_output_utf8_decoded($Qcurrencies->value('symbol_left')) : $Qcurrencies->value('symbol_left'); + $symbol_right = ($lC_Language->get('charset') == 'utf-8') ? lc_output_utf8_decoded($Qcurrencies->value('symbol_right')) : $Qcurrencies->value('symbol_right'); + $this->currencies[$Qcurrencies->value('code')] = array('id' => $Qcurrencies->valueInt('currencies_id'), 'title' => $Qcurrencies->value('title'), - 'symbol_left' => utf8_decode($Qcurrencies->value('symbol_left')), - 'symbol_right' => utf8_decode($Qcurrencies->value('symbol_right')), + 'symbol_left' => $symbol_left, + 'symbol_right' => $symbol_right, 'decimal_places' => $Qcurrencies->valueInt('decimal_places'), 'value' => $Qcurrencies->valueDecimal('value')); } From 1b1d71079807e9607b78a236547a888ac533be02 Mon Sep 17 00:00:00 2001 From: datazen Date: Fri, 14 Mar 2014 12:35:55 -0400 Subject: [PATCH 07/15] B2813 - repaired currencies issue --- catalog/includes/classes/currencies.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/catalog/includes/classes/currencies.php b/catalog/includes/classes/currencies.php index 2380306a9..b42247c52 100644 --- a/catalog/includes/classes/currencies.php +++ b/catalog/includes/classes/currencies.php @@ -12,7 +12,7 @@ class lC_Currencies { // class constructor public function lC_Currencies() { - global $lC_Database; + global $lC_Database, $lC_Language; $Qcurrencies = $lC_Database->query('select * from :table_currencies'); $Qcurrencies->bindTable(':table_currencies', TABLE_CURRENCIES); @@ -20,10 +20,13 @@ public function lC_Currencies() { $Qcurrencies->execute(); while ($Qcurrencies->next()) { + $symbol_left = ($lC_Language->get('charset') == 'utf-8') ? lc_output_utf8_decoded($Qcurrencies->value('symbol_left')) : $Qcurrencies->value('symbol_left'); + $symbol_right = ($lC_Language->get('charset') == 'utf-8') ? lc_output_utf8_decoded($Qcurrencies->value('symbol_right')) : $Qcurrencies->value('symbol_right'); + $this->currencies[$Qcurrencies->value('code')] = array('id' => $Qcurrencies->valueInt('currencies_id'), 'title' => $Qcurrencies->value('title'), - 'symbol_left' => utf8_decode($Qcurrencies->value('symbol_left')), - 'symbol_right' => utf8_decode($Qcurrencies->value('symbol_right')), + 'symbol_left' => $symbol_left, + 'symbol_right' => $symbol_right, 'decimal_places' => $Qcurrencies->valueInt('decimal_places'), 'value' => $Qcurrencies->valueDecimal('value')); } From c80cd75ee1d3f72dab0b829c7ef1df7c0964f808 Mon Sep 17 00:00:00 2001 From: datazen Date: Fri, 14 Mar 2014 13:33:00 -0400 Subject: [PATCH 08/15] [IC] repaired currency symbol issue --- .../applications/currencies/classes/currencies.php | 4 ++-- .../admin/includes/applications/currencies/modal/edit.php | 2 +- catalog/includes/classes/currencies.php | 7 ++----- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/catalog/admin/includes/applications/currencies/classes/currencies.php b/catalog/admin/includes/applications/currencies/classes/currencies.php index 4bd2018b2..5c09d3168 100644 --- a/catalog/admin/includes/applications/currencies/classes/currencies.php +++ b/catalog/admin/includes/applications/currencies/classes/currencies.php @@ -89,8 +89,8 @@ public static function getData($id, $key = null) { if ( $Qcurrency->numberOfRows() === 1 ) { $result = $Qcurrency->toArray(); - $result['symbol_left'] = utf8_decode($Qcurrency->value('symbol_left')); - $result['symbol_right'] = utf8_decode($Qcurrency->value('symbol_right')); + $result['symbol_left'] = $Qcurrency->value('symbol_left'); + $result['symbol_right'] = $Qcurrency->value('symbol_right'); if ( !empty($key) && isset($result[$key]) ) { $result = $result[$key]; diff --git a/catalog/admin/includes/applications/currencies/modal/edit.php b/catalog/admin/includes/applications/currencies/modal/edit.php index fa33665d2..199fe43d7 100644 --- a/catalog/admin/includes/applications/currencies/modal/edit.php +++ b/catalog/admin/includes/applications/currencies/modal/edit.php @@ -113,7 +113,7 @@ function (rdata) { } }, buttonsLowPadding: true - }); + }); $("#editTitle").val(data.currencyData.title); $("#editCode").val(data.currencyData.code); $("#editSymbolLeft").val(data.currencyData.symbol_left); diff --git a/catalog/includes/classes/currencies.php b/catalog/includes/classes/currencies.php index b42247c52..33b87250e 100644 --- a/catalog/includes/classes/currencies.php +++ b/catalog/includes/classes/currencies.php @@ -20,13 +20,10 @@ public function lC_Currencies() { $Qcurrencies->execute(); while ($Qcurrencies->next()) { - $symbol_left = ($lC_Language->get('charset') == 'utf-8') ? lc_output_utf8_decoded($Qcurrencies->value('symbol_left')) : $Qcurrencies->value('symbol_left'); - $symbol_right = ($lC_Language->get('charset') == 'utf-8') ? lc_output_utf8_decoded($Qcurrencies->value('symbol_right')) : $Qcurrencies->value('symbol_right'); - $this->currencies[$Qcurrencies->value('code')] = array('id' => $Qcurrencies->valueInt('currencies_id'), 'title' => $Qcurrencies->value('title'), - 'symbol_left' => $symbol_left, - 'symbol_right' => $symbol_right, + 'symbol_left' => $Qcurrencies->value('symbol_left'), + 'symbol_right' => $Qcurrencies->value('symbol_right'), 'decimal_places' => $Qcurrencies->valueInt('decimal_places'), 'value' => $Qcurrencies->valueDecimal('value')); } From 2fe97575010c1b2b41d73c4177e7e7e1300dbb9c Mon Sep 17 00:00:00 2001 From: geraldbullard Date: Mon, 17 Mar 2014 11:24:02 -0400 Subject: [PATCH 09/15] adjusted to handle empty parent_categories in products import. --- .../classes/products_import_export.php | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/catalog/admin/includes/applications/products_import_export/classes/products_import_export.php b/catalog/admin/includes/applications/products_import_export/classes/products_import_export.php index cdd1bf221..065a08aa5 100644 --- a/catalog/admin/includes/applications/products_import_export/classes/products_import_export.php +++ b/catalog/admin/includes/applications/products_import_export/classes/products_import_export.php @@ -176,7 +176,7 @@ public static function getProducts($pfilter, $pgtype, $pgformat) { $product['products_date_added'] = lC_Datetime::getShort($product['products_date_added']); foreach ($product as $column_output) { - $content .= "\"" . trim(preg_replace('/\s+/', ' ', $column_output)) . "\"" . $delim; + $content .= trim(preg_replace('/\s+/', ' ', $column_output)) . $delim; } // categories @@ -192,7 +192,7 @@ public static function getProducts($pfilter, $pgtype, $pgformat) { $categories[] = $Qcategories->value('categories_name'); $catids[] = $Qcategories->value('categories_id'); } - $content .= "\"" . implode($seperator, $categories) . "\"" . $delim; + $content .= implode($seperator, $categories) . $delim; foreach ($catids as $cat) { $path = ''; @@ -202,14 +202,14 @@ public static function getProducts($pfilter, $pgtype, $pgformat) { $pArr = array_reverse(array_filter($pathParts)); unset($catids); - $content .= "\"" . implode($seperator, $pArr) . "\"" . $delim; + $content .= implode($seperator, $pArr) . $delim; $Qimage = $lC_Database->query("SELECT * FROM :table_products_images WHERE products_id = :products_id"); $Qimage->bindTable(':table_products_images', TABLE_PRODUCTS_IMAGES); $Qimage->bindInt(':products_id', $product['products_id']); $Qimage->execute(); - $content .= "\"" . $Qimage->value('image') . "\"" . $delim; + $content .= $Qimage->value('image') . $delim; $content .= "\n"; @@ -321,7 +321,7 @@ public static function getCategories($cfilter, $cgformat) { foreach ($categories as $category) { $category['date_added'] = lC_Datetime::getShort($category['date_added']); foreach ($category as $column_output) { - $content .= "\"" . trim(preg_replace('/\s+/', ' ', $column_output)) . "\"" . $delim; + $content .= trim(preg_replace('/\s+/', ' ', $column_output)) . $delim; } $content .= "\n"; } @@ -401,7 +401,7 @@ public static function getOptionGroups($ofilter, $ogformat) { $content = ''; foreach ($optiongroups as $optiongroup) { foreach ($optiongroup as $column_output) { - $content .= "\"" . trim(preg_replace('/\s+/', ' ', $column_output)) . "\"" . $delim; + $content .= trim(preg_replace('/\s+/', ' ', $column_output)) . $delim; } $content .= "\n"; } @@ -480,7 +480,7 @@ public static function getOptionVariants($ofilter, $ogformat) { $content = ''; foreach ($optionvariants as $optionvariant) { foreach ($optionvariant as $column_output) { - $content .= "\"" . trim(preg_replace('/\s+/', ' ', $column_output)) . "\"" . $delim; + $content .= trim(preg_replace('/\s+/', ' ', $column_output)) . $delim; } $content .= "\n"; } @@ -564,7 +564,7 @@ public static function getOptionProducts($ofilter, $ogformat) { $content = ''; foreach ($optionproducts as $optionproduct) { foreach ($optionproduct as $column_output) { - $content .= "\"" . trim(preg_replace('/\s+/', ' ', $column_output)) . "\"" . $delim; + $content .= trim(preg_replace('/\s+/', ' ', $column_output)) . $delim; } $content .= "\n"; } @@ -700,6 +700,7 @@ public static function importProducts($filename, $pwizard, $ptype, $pbackup, $pm $product['categories'] = explode(",", $product['categories']); foreach ($product['categories'] as $catName) { if ($catName != '') { + $catCheck = $lC_Database->query("select cd.* from :table_categories_description cd left join :table_categories c on (cd.categories_id = c.categories_id) where cd.categories_name = :categories_name" . $ifParent); if ($product['parent_categories'] != '') { $parentCheck = $lC_Database->query("select categories_id from :table_categories_description where categories_name = :categories_name and language_id = :language_id"); $parentCheck->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION); @@ -707,14 +708,13 @@ public static function importProducts($filename, $pwizard, $ptype, $pbackup, $pm $parentCheck->bindInt(':language_id', $product['language_id']); $parentCheck->execute(); - $ifParent = ' and c.parent_id = :parent_id'; + $ifParent = ' and c.parent_id = :parent_id'; + $catCheck->bindInt(':parent_id', $parentCheck->value('categories_id')); } - $catCheck = $lC_Database->query("select cd.* from :table_categories_description cd left join :table_categories c on (cd.categories_id = c.categories_id) where cd.categories_name = :categories_name" . $ifParent); $catCheck->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION); $catCheck->bindTable(':table_categories', TABLE_CATEGORIES); $catCheck->bindValue(':categories_name', $catName); - $catCheck->bindInt(':parent_id', $parentCheck->value('categories_id')); $catCheck->execute(); if ($catCheck->numberOfRows()) { From cab999e4bd1d9a4daf6b1b394ea5500ca23467c3 Mon Sep 17 00:00:00 2001 From: geraldbullard Date: Mon, 17 Mar 2014 15:56:28 -0400 Subject: [PATCH 10/15] html safe currency symbols for install sql --- catalog/install/loadedcommerce.sql | 4 ++-- catalog/install/loadedcommerce_innodb.sql | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/catalog/install/loadedcommerce.sql b/catalog/install/loadedcommerce.sql index 3258dfc17..5f809d416 100644 --- a/catalog/install/loadedcommerce.sql +++ b/catalog/install/loadedcommerce.sql @@ -6158,9 +6158,9 @@ INSERT INTO lc_credit_cards (id, credit_card_name, pattern, credit_card_status, INSERT INTO lc_credit_cards (id, credit_card_name, pattern, credit_card_status, sort_order) VALUES(12, 'Maestro', '/^(50|56|57|58|6)/', '0', 0); INSERT INTO lc_credit_cards (id, credit_card_name, pattern, credit_card_status, sort_order) VALUES(13, 'Smartpay', '/^4\\d{12}(\\d{3})?$/', '0', 0); -INSERT INTO lc_currencies (currencies_id, title, code, symbol_left, symbol_right, decimal_places, value, last_updated) VALUES(2, 'Euro', 'EUR', '€', '', '2', 0.726579, '2014-03-03 09:59:23'); +INSERT INTO lc_currencies (currencies_id, title, code, symbol_left, symbol_right, decimal_places, value, last_updated) VALUES(2, 'Euro', 'EUR', '€', '', '2', 0.726579, '2014-03-03 09:59:23'); INSERT INTO lc_currencies (currencies_id, title, code, symbol_left, symbol_right, decimal_places, value, last_updated) VALUES(1, 'US Dollar', 'USD', '$', '', '2', 1.00000000, '2014-03-03 09:59:23'); -INSERT INTO lc_currencies (currencies_id, title, code, symbol_left, symbol_right, decimal_places, value, last_updated) VALUES(3, 'British Pounds', 'GBP', '£', '', '2', 0.598311, '2014-03-03 09:59:23'); +INSERT INTO lc_currencies (currencies_id, title, code, symbol_left, symbol_right, decimal_places, value, last_updated) VALUES(3, 'British Pounds', 'GBP', '£', '', '2', 0.598311, '2014-03-03 09:59:23'); INSERT INTO lc_customers_groups (customers_group_id, language_id, customers_group_name) VALUES(1, 1, 'Registered'); INSERT INTO lc_customers_groups (customers_group_id, language_id, customers_group_name) VALUES(2, 1, 'Wholesale'); diff --git a/catalog/install/loadedcommerce_innodb.sql b/catalog/install/loadedcommerce_innodb.sql index b1349a6d7..986a4784f 100644 --- a/catalog/install/loadedcommerce_innodb.sql +++ b/catalog/install/loadedcommerce_innodb.sql @@ -6157,9 +6157,9 @@ INSERT INTO lc_credit_cards (id, credit_card_name, pattern, credit_card_status, INSERT INTO lc_credit_cards (id, credit_card_name, pattern, credit_card_status, sort_order) VALUES(12, 'Maestro', '/^(50|56|57|58|6)/', '0', 0); INSERT INTO lc_credit_cards (id, credit_card_name, pattern, credit_card_status, sort_order) VALUES(13, 'Smartpay', '/^4\\d{12}(\\d{3})?$/', '0', 0); -INSERT INTO lc_currencies (currencies_id, title, code, symbol_left, symbol_right, decimal_places, value, last_updated) VALUES(2, 'Euro', 'EUR', '€', '', '2', 0.726579, '2014-03-03 09:59:23'); +INSERT INTO lc_currencies (currencies_id, title, code, symbol_left, symbol_right, decimal_places, value, last_updated) VALUES(2, 'Euro', 'EUR', '€', '', '2', 0.726579, '2014-03-03 09:59:23'); INSERT INTO lc_currencies (currencies_id, title, code, symbol_left, symbol_right, decimal_places, value, last_updated) VALUES(1, 'US Dollar', 'USD', '$', '', '2', 1.00000000, '2014-03-03 09:59:23'); -INSERT INTO lc_currencies (currencies_id, title, code, symbol_left, symbol_right, decimal_places, value, last_updated) VALUES(3, 'British Pounds', 'GBP', '£', '', '2', 0.598311, '2014-03-03 09:59:23'); +INSERT INTO lc_currencies (currencies_id, title, code, symbol_left, symbol_right, decimal_places, value, last_updated) VALUES(3, 'British Pounds', 'GBP', '£', '', '2', 0.598311, '2014-03-03 09:59:23'); INSERT INTO lc_customers_groups (customers_group_id, language_id, customers_group_name) VALUES(1, 1, 'Registered'); INSERT INTO lc_customers_groups (customers_group_id, language_id, customers_group_name) VALUES(2, 1, 'Wholesale'); From fbc1dd79ec32953612c54c689a43c2902bd7b4f6 Mon Sep 17 00:00:00 2001 From: geraldbullard Date: Mon, 17 Mar 2014 16:24:50 -0400 Subject: [PATCH 11/15] updated currency edit and add with page refresh --- catalog/admin/includes/applications/currencies/modal/edit.php | 3 ++- catalog/admin/includes/applications/currencies/modal/new.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/catalog/admin/includes/applications/currencies/modal/edit.php b/catalog/admin/includes/applications/currencies/modal/edit.php index 199fe43d7..eb0542d3b 100644 --- a/catalog/admin/includes/applications/currencies/modal/edit.php +++ b/catalog/admin/includes/applications/currencies/modal/edit.php @@ -107,7 +107,8 @@ function (rdata) { oTable.fnReloadAjax(); } } ); - win.closeModal(); + //win.closeModal(); + win.location.href = win.location.href; } } } diff --git a/catalog/admin/includes/applications/currencies/modal/new.php b/catalog/admin/includes/applications/currencies/modal/new.php index 5bf6487aa..f6440abae 100644 --- a/catalog/admin/includes/applications/currencies/modal/new.php +++ b/catalog/admin/includes/applications/currencies/modal/new.php @@ -103,7 +103,8 @@ function (rdata) { } } ); - win.closeModal(); + //win.closeModal(); + win.location.href = win.location.href; } } } From 5bbd2ed9692dd2440e6078bf2b3b97b5ca470869 Mon Sep 17 00:00:00 2001 From: Gerald Bullard Jr Date: Tue, 18 Mar 2014 10:59:46 -0400 Subject: [PATCH 12/15] update for js currency formatting --- .../core/content/checkout/shopping_cart.php | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/catalog/templates/core/content/checkout/shopping_cart.php b/catalog/templates/core/content/checkout/shopping_cart.php index b6275ca54..73bf318e1 100644 --- a/catalog/templates/core/content/checkout/shopping_cart.php +++ b/catalog/templates/core/content/checkout/shopping_cart.php @@ -206,6 +206,9 @@ function _update(row, qty) { $('#btn-checkout').attr('onclick', ''); var decimals = ''; var currencySymbolLeft = 'getSymbolLeft(); ?>'; + var currencySymbolRight = 'getSymbolRight(); ?>'; + var decimalSep = 'getData('numeric_separator_decimal'); ?>'; + var thousandsSep = 'getData('numeric_separator_thousands'); ?>'; var dPrice = parseFloat($('#display-price-' + row).text().replace(currencySymbolLeft, '')); var jsonLink = ''; $.getJSON(jsonLink.replace('ITEM', row).replace('QTY', qty).split('amp;').join(''), @@ -215,16 +218,23 @@ function (data) { window.location = location.href; } - if (data.priceData.price != undefined && data.priceData.price > 0) { - newPrice = (parseFloat(data.priceData.price) + parseFloat(data.priceData.tax)).toFixed(decimals); - } else { + if (data.priceData.price != undefined) { + price = parseFloat(data.priceData.price.replace(',', '')); + if (price > 0) { + newPrice = (price + parseFloat(data.priceData.tax)).toFixed(decimals); + } else { + newPrice = dPrice.toFixed(decimals); + } + } else { newPrice = dPrice.toFixed(decimals); } - newTotal = (newPrice * qty).toFixed(decimals); - + + newTotal = (newPrice * qty).toFixed(decimals).replace(/(\d)(?=(\d{3})+\b)/g, '$1,').replace('.', decimalSep).replace(',', thousandsSep); + newPrice = newPrice.replace(/(\d)(?=(\d{3})+\b)/g, '$1,').replace('.', decimalSep).replace(',', thousandsSep); + $('#products_' + row).val(qty); - $('#display-price-' + row).text(currencySymbolLeft + newPrice.toString()); - $('#total-price-' + row).html(currencySymbolLeft + newTotal.toString()); + $('#display-price-' + row).text(currencySymbolLeft + newPrice.toString() + currencySymbolRight); + $('#total-price-' + row).html(currencySymbolLeft + newTotal.toString() + currencySymbolRight); $('#content-shopping-cart-order-totals-right').html(data.otText); // enable checkout button @@ -235,4 +245,4 @@ function (data) { return true; } - \ No newline at end of file + From 9e0abb6489365f89021a12cdee7f86259589770a Mon Sep 17 00:00:00 2001 From: Gerald Bullard Jr Date: Tue, 18 Mar 2014 14:33:22 -0400 Subject: [PATCH 13/15] update for js currency formatting --- .../templates/core/content/checkout/shopping_cart.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/catalog/templates/core/content/checkout/shopping_cart.php b/catalog/templates/core/content/checkout/shopping_cart.php index 73bf318e1..06c6a2c00 100644 --- a/catalog/templates/core/content/checkout/shopping_cart.php +++ b/catalog/templates/core/content/checkout/shopping_cart.php @@ -205,8 +205,9 @@ function _update(row, qty) { var href = $('#btn-checkout').attr('onclick'); $('#btn-checkout').attr('onclick', ''); var decimals = ''; - var currencySymbolLeft = 'getSymbolLeft(); ?>'; - var currencySymbolRight = 'getSymbolRight(); ?>'; + var currencyValue = 'value($lC_Currencies->getCode()); ?>'; + var currencySymbolLeft = 'getSessionSymbolLeft(); ?>'; + var currencySymbolRight = 'getSessionSymbolRight(); ?>'; var decimalSep = 'getData('numeric_separator_decimal'); ?>'; var thousandsSep = 'getData('numeric_separator_thousands'); ?>'; var dPrice = parseFloat($('#display-price-' + row).text().replace(currencySymbolLeft, '')); @@ -221,7 +222,7 @@ function (data) { if (data.priceData.price != undefined) { price = parseFloat(data.priceData.price.replace(',', '')); if (price > 0) { - newPrice = (price + parseFloat(data.priceData.tax)).toFixed(decimals); + newPrice = ((price * currencyValue) + parseFloat(data.priceData.tax)).toFixed(decimals); } else { newPrice = dPrice.toFixed(decimals); } @@ -233,7 +234,7 @@ function (data) { newPrice = newPrice.replace(/(\d)(?=(\d{3})+\b)/g, '$1,').replace('.', decimalSep).replace(',', thousandsSep); $('#products_' + row).val(qty); - $('#display-price-' + row).text(currencySymbolLeft + newPrice.toString() + currencySymbolRight); + $('#display-price-' + row).html(currencySymbolLeft + newPrice.toString() + currencySymbolRight); $('#total-price-' + row).html(currencySymbolLeft + newTotal.toString() + currencySymbolRight); $('#content-shopping-cart-order-totals-right').html(data.otText); From 861b68c9eca3f9b2cb72fb9e19d31f6fc2cd77ab Mon Sep 17 00:00:00 2001 From: Gerald Bullard Jr Date: Tue, 18 Mar 2014 14:34:38 -0400 Subject: [PATCH 14/15] added sessionSymbolRight function --- catalog/includes/classes/currencies.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/catalog/includes/classes/currencies.php b/catalog/includes/classes/currencies.php index 33b87250e..2ef656563 100644 --- a/catalog/includes/classes/currencies.php +++ b/catalog/includes/classes/currencies.php @@ -167,6 +167,14 @@ public function getSessionSymbolLeft() { return $value['symbol_left']; } } + } + + public function getSessionSymbolRight() { + foreach ($this->currencies as $key => $value) { + if ($key == $_SESSION['currency']) { + return $value['symbol_right']; + } + } } } -?> \ No newline at end of file +?> From 82385e47d6dbc610d3e30d00606c0e590a8fbe67 Mon Sep 17 00:00:00 2001 From: datazen Date: Tue, 18 Mar 2014 17:13:08 -0400 Subject: [PATCH 15/15] [IC] updated runafter --- catalog/includes/work/updates/runAfter/controller.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/catalog/includes/work/updates/runAfter/controller.php b/catalog/includes/work/updates/runAfter/controller.php index 0607be854..41764529d 100644 --- a/catalog/includes/work/updates/runAfter/controller.php +++ b/catalog/includes/work/updates/runAfter/controller.php @@ -206,6 +206,11 @@ public static function updateDB() { $lC_Database->simpleQuery("ALTER IGNORE TABLE `" . $pf . "branding` ADD `homepage_text` VARCHAR(20000) NOT NULL DEFAULT '' AFTER `language_id`;"); parent::log("Database Update: ALTER IGNORE TABLE `" . $pf . "branding` ADD `homepage_text` VARCHAR(20000) NOT NULL DEFAULT '' AFTER `language_id`;"); + $lC_Database->simpleQuery("UPDATE `" . $pf . "currencies` SET `symbol_left` = '€' where `code` = 'EUR'"); + parent::log("Database Update: UPDATE `" . $pf . "currencies` SET `symbol_left` = '€' where `code` = 'EUR'"); + + $lC_Database->simpleQuery("UPDATE `" . $pf . "currencies` SET `symbol_left` = '£' where `code` = 'GBP'"); + parent::log("Database Update: UPDATE `" . $pf . "currencies` SET `symbol_left` = '£' where `code` = 'GBP'"); } } ?> \ No newline at end of file