From 729f7680acae03a858d32c8a0b9b997622f401ed Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Wed, 11 Feb 2015 11:43:11 +0100 Subject: [PATCH 01/16] Starting 2.1.12 hotfix branch --- system/modules/isotope/docs/CHANGELOG-2.1.md | 5 +++++ system/modules/isotope/library/Isotope/Isotope.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index cf101fb838..4b25d6f6a3 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -1,6 +1,11 @@ Isotope eCommerce Changelog =========================== +Version 2.1.12-stable (2015-??-??) +---------------------------------- + + + Version 2.1.11-stable (2015-02-10) ---------------------------------- diff --git a/system/modules/isotope/library/Isotope/Isotope.php b/system/modules/isotope/library/Isotope/Isotope.php index 48525b4a58..ed00736958 100644 --- a/system/modules/isotope/library/Isotope/Isotope.php +++ b/system/modules/isotope/library/Isotope/Isotope.php @@ -36,7 +36,7 @@ class Isotope extends \Controller /** * Isotope version */ - const VERSION = '2.1.11'; + const VERSION = '2.1.12'; /** * True if the system has been initialized From 37daa05b6a4067b1d2682b167c466d870e38dac8 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Wed, 11 Feb 2015 11:47:03 +0100 Subject: [PATCH 02/16] Updated list of Postfinance SHA-OUT parameters --- .../Isotope/Model/Payment/Postfinance.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/system/modules/isotope/library/Isotope/Model/Payment/Postfinance.php b/system/modules/isotope/library/Isotope/Model/Payment/Postfinance.php index 8076fc779d..73375ddf08 100644 --- a/system/modules/isotope/library/Isotope/Model/Payment/Postfinance.php +++ b/system/modules/isotope/library/Isotope/Model/Payment/Postfinance.php @@ -43,17 +43,24 @@ class Postfinance extends PSP implements IsotopePayment, IsotopePostsale ( 'AAVADDRESS', 'AAVCHECK', + 'AAVMAIL', + 'AAVNAME', + 'AAVPHONE', 'AAVZIP', 'ACCEPTANCE', 'ALIAS', 'AMOUNT', + 'BIC', 'BIN', 'BRAND', 'CARDNO', 'CCCTY', 'CN', + 'COLLECTOR_BIC', + 'COLLECTOR_IBAN', 'COMPLUS', 'CREATION_STATUS', + 'CREDITDEBIT', 'CURRENCY', 'CVCCHECK', 'DCC_COMMPERCENTAGE', @@ -68,25 +75,27 @@ class Postfinance extends PSP implements IsotopePayment, IsotopePostsale 'DIGESTCARDNO', 'ECI', 'ED', + 'EMAIL', 'ENCCARDNO', 'FXAMOUNT', 'FXCURRENCY', 'IP', 'IPCTY', + 'MANDATEID', + 'MOBILEMODE', 'NBREMAILUSAGE', 'NBRIPUSAGE', 'NBRIPUSAGE_ALLTX', 'NBRUSAGE', 'NCERROR', - 'NCERRORCARDNO', - 'NCERRORCN', - 'NCERRORCVC', - 'NCERRORED', 'ORDERID', 'PAYID', + 'PAYMENT_REFERENCE', 'PM', 'SCO_CATEGORY', 'SCORING', + 'SEQUENCETYPE', + 'SIGNDATE', 'STATUS', 'SUBBRAND', 'SUBSCRIPTION_ID', From ba742ec003cbad4a8dbeec3ec2e53ce656773382 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Wed, 11 Feb 2015 11:48:16 +0100 Subject: [PATCH 03/16] Use raw data to calculate hashes in postfinance payment method --- system/modules/isotope/docs/CHANGELOG-2.1.md | 2 ++ .../modules/isotope/library/Isotope/Model/Payment/PSP.php | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index 4b25d6f6a3..9a0eebff67 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -4,6 +4,8 @@ Isotope eCommerce Changelog Version 2.1.12-stable (2015-??-??) ---------------------------------- +### Improved +- Better Postfinance postsale handling Version 2.1.11-stable (2015-02-10) diff --git a/system/modules/isotope/library/Isotope/Model/Payment/PSP.php b/system/modules/isotope/library/Isotope/Model/Payment/PSP.php index a49ff06496..e5c8005d0c 100644 --- a/system/modules/isotope/library/Isotope/Model/Payment/PSP.php +++ b/system/modules/isotope/library/Isotope/Model/Payment/PSP.php @@ -119,7 +119,7 @@ public function getPostsaleOrder() return null; } - return Order::findByPk($this->getRequestData('orderID')); + return Order::findByPk((int) $this->getRequestData('orderID')); } /** @@ -199,10 +199,10 @@ protected function preparePSPParams($objOrder, $objModule) private function getRequestData($strKey) { if ($this->psp_http_method == 'GET') { - return \Input::get($strKey); + return $_GET[$strKey]; } - return \Input::post($strKey); + return $_POST[$strKey]; } From b8fba25c30eb9d91d47bcda5501b289f025f143c Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Wed, 11 Feb 2015 12:26:06 +0100 Subject: [PATCH 04/16] Make sure database tables are always unlocked --- .../Isotope/Model/ProductCollection.php | 56 +++++++++++-------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/system/modules/isotope/library/Isotope/Model/ProductCollection.php b/system/modules/isotope/library/Isotope/Model/ProductCollection.php index 252e1c83aa..ccc8d85937 100644 --- a/system/modules/isotope/library/Isotope/Model/ProductCollection.php +++ b/system/modules/isotope/library/Isotope/Model/ProductCollection.php @@ -1338,30 +1338,38 @@ protected function generateDocumentNumber($strPrefix, $intDigits) // Lock tables so no other order can get the same ID \Database::getInstance()->lockTables(array(static::$strTable => 'WRITE')); - // Retrieve the highest available order ID - $objMax = \Database::getInstance()->prepare(" - SELECT document_number - FROM " . static::$strTable . " - WHERE - type=? - " . ($strPrefix != '' ? " AND document_number LIKE '$strPrefix%'" : '') . " - AND store_id=? - ORDER BY CAST(" . ($strPrefix != '' ? "SUBSTRING(document_number, " . ($intPrefix+1) . ")" : 'document_number') . " AS UNSIGNED) DESC - ")->limit(1)->execute( - array_search(get_called_class(), static::getModelTypes()), - Isotope::getCart()->store_id - ); - - $intMax = (int) substr($objMax->document_number, $intPrefix); - - $this->arrData['document_number'] = $strPrefix . str_pad($intMax + 1, $intDigits, '0', STR_PAD_LEFT); - } - - \Database::getInstance()->prepare(" - UPDATE " . static::$strTable . " SET document_number=? WHERE id=? - ")->execute($this->arrData['document_number'], $this->id); - - \Database::getInstance()->unlockTables(); + try { + // Retrieve the highest available order ID + $objMax = \Database::getInstance()->prepare(" + SELECT document_number + FROM " . static::$strTable . " + WHERE + type=? + " . ($strPrefix != '' ? " AND document_number LIKE '$strPrefix%'" : '') . " + AND store_id=? + ORDER BY CAST(" . ($strPrefix != '' ? "SUBSTRING(document_number, " . ($intPrefix + 1) . ")" : 'document_number') . " AS UNSIGNED) DESC + ")->limit(1)->execute( + array_search(get_called_class(), static::getModelTypes()), + Isotope::getCart()->store_id + ); + + $intMax = (int) substr($objMax->document_number, $intPrefix); + + $this->arrData['document_number'] = $strPrefix . str_pad($intMax + 1, $intDigits, '0', STR_PAD_LEFT); + + \Database::getInstance()->prepare(" + UPDATE " . static::$strTable . " SET document_number=? WHERE id=? + ")->execute($this->arrData['document_number'], $this->id); + + \Database::getInstance()->unlockTables(); + + } catch (\Exception $e) { + // Make sure tables are always unlocked + \Database::getInstance()->unlockTables(); + + throw $e; + } + } return $this->arrData['document_number']; } From b64e68b62c6307500bb263d8ee0fb58231da7294 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Wed, 11 Feb 2015 12:26:41 +0100 Subject: [PATCH 05/16] Use store_id of Order instead of Cart --- .../modules/isotope/library/Isotope/Model/ProductCollection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/modules/isotope/library/Isotope/Model/ProductCollection.php b/system/modules/isotope/library/Isotope/Model/ProductCollection.php index ccc8d85937..6d3a22d377 100644 --- a/system/modules/isotope/library/Isotope/Model/ProductCollection.php +++ b/system/modules/isotope/library/Isotope/Model/ProductCollection.php @@ -1350,7 +1350,7 @@ protected function generateDocumentNumber($strPrefix, $intDigits) ORDER BY CAST(" . ($strPrefix != '' ? "SUBSTRING(document_number, " . ($intPrefix + 1) . ")" : 'document_number') . " AS UNSIGNED) DESC ")->limit(1)->execute( array_search(get_called_class(), static::getModelTypes()), - Isotope::getCart()->store_id + $this->store_id ); $intMax = (int) substr($objMax->document_number, $intPrefix); From 7f964638096f8cfe0d43bd200f8f3cb2cf418b5f Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Fri, 20 Feb 2015 15:15:15 +0100 Subject: [PATCH 06/16] Do not set filter attribute in product if its not dynamic --- system/modules/isotope/docs/CHANGELOG-2.1.md | 3 +++ .../isotope/library/Isotope/Module/ProductList.php | 14 +++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index 9a0eebff67..53129adbf4 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -7,6 +7,9 @@ Version 2.1.12-stable (2015-??-??) ### Improved - Better Postfinance postsale handling +### Fixed +- Filter fields could overwrite product properties if property was not customer defined/variant option + Version 2.1.11-stable (2015-02-10) ---------------------------------- diff --git a/system/modules/isotope/library/Isotope/Module/ProductList.php b/system/modules/isotope/library/Isotope/Module/ProductList.php index f6ebc1c261..8970ed1ea3 100755 --- a/system/modules/isotope/library/Isotope/Module/ProductList.php +++ b/system/modules/isotope/library/Isotope/Module/ProductList.php @@ -16,6 +16,7 @@ use Haste\Generator\RowClass; use Haste\Http\Response\HtmlResponse; use Isotope\Isotope; +use Isotope\Model\Attribute; use Isotope\Model\Product; use Isotope\Model\ProductCache; use Isotope\Model\RequestCache; @@ -199,8 +200,7 @@ protected function compile() return; } - $arrBuffer = array(); - + $arrBuffer = array(); $arrDefaultOptions = $this->getDefaultProductOptions(); foreach ($arrProducts as $objProduct) { @@ -410,11 +410,19 @@ protected function getFiltersAndSorting($blnNativeSQL = true) */ protected function getDefaultProductOptions() { + $arrFields = array_merge(Attribute::getVariantOptionFields(), Attribute::getCustomerDefinedFields()); + + if (empty($arrFields)) { + return array(); + } + $arrOptions = array(); $arrFilters = Isotope::getRequestCache()->getFiltersForModules($this->iso_filterModules); foreach ($arrFilters as $arrConfig) { - if ($arrConfig['operator'] == '=' || $arrConfig['operator'] == '==' || $arrConfig['operator'] == 'eq') { + if (in_array($arrConfig['attribute'], $arrFields) + && ($arrConfig['operator'] == '=' || $arrConfig['operator'] == '==' || $arrConfig['operator'] == 'eq') + ) { $arrOptions[$arrConfig['attribute']] = $arrConfig['value']; } } From 1e83f9e4452421d6474ad1d59471adf8efa1fd2b Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Sun, 15 Mar 2015 15:24:35 +0100 Subject: [PATCH 07/16] Added missing collection ID to template (#1394) --- system/modules/isotope/docs/CHANGELOG-2.1.md | 1 + .../modules/isotope/library/Isotope/Model/ProductCollection.php | 1 + 2 files changed, 2 insertions(+) diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index 53129adbf4..d6ed843b69 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -9,6 +9,7 @@ Version 2.1.12-stable (2015-??-??) ### Fixed - Filter fields could overwrite product properties if property was not customer defined/variant option +- Added missing collection ID to template (#1394) Version 2.1.11-stable (2015-02-10) diff --git a/system/modules/isotope/library/Isotope/Model/ProductCollection.php b/system/modules/isotope/library/Isotope/Model/ProductCollection.php index 6d3a22d377..68dceb6d15 100644 --- a/system/modules/isotope/library/Isotope/Model/ProductCollection.php +++ b/system/modules/isotope/library/Isotope/Model/ProductCollection.php @@ -1133,6 +1133,7 @@ public function addToTemplate(\Isotope\Template $objTemplate, array $arrConfig = $arrGalleries = array(); $arrItems = $this->addItemsToTemplate($objTemplate, $arrConfig['sorting']); + $objTemplate->id = $this->id; $objTemplate->collection = $this; $objTemplate->config = ($this->getRelated('config_id') || Isotope::getConfig()); $objTemplate->surcharges = \Isotope\Frontend::formatSurcharges($this->getSurcharges()); From fe3d8cc094c85a04c82f8a02fbb01178bca4df7d Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Sun, 15 Mar 2015 15:26:28 +0100 Subject: [PATCH 08/16] Default value for tl_iso_config.cartMinSubtotal should be a decimal (#1367) --- system/modules/isotope/dca/tl_iso_config.php | 2 +- system/modules/isotope/docs/CHANGELOG-2.1.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/modules/isotope/dca/tl_iso_config.php b/system/modules/isotope/dca/tl_iso_config.php index ade690d72c..be42e2ec14 100755 --- a/system/modules/isotope/dca/tl_iso_config.php +++ b/system/modules/isotope/dca/tl_iso_config.php @@ -423,7 +423,7 @@ ( 'label' => &$GLOBALS['TL_LANG']['tl_iso_config']['cartMinSubtotal'], 'exclude' => true, - 'default' => '', + 'default' => '0.00', 'inputType' => 'text', 'eval' => array('mandatory'=>true, 'maxlength'=>13, 'rgpx'=>'price', 'tl_class'=>'w50'), 'sql' => "decimal(12,2) NOT NULL default '0.00'", diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index d6ed843b69..dde8eb3874 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -10,6 +10,7 @@ Version 2.1.12-stable (2015-??-??) ### Fixed - Filter fields could overwrite product properties if property was not customer defined/variant option - Added missing collection ID to template (#1394) +- Default value for tl_iso_config.cartMinSubtotal was empty instead of decimal (#1367) Version 2.1.11-stable (2015-02-10) From 5c4c2be14407cd929cde880234d45987e4dd0ca5 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Sun, 15 Mar 2015 15:32:59 +0100 Subject: [PATCH 09/16] Only filter by groups if one is set (fixes #1373) --- system/modules/isotope/docs/CHANGELOG-2.1.md | 1 + system/modules/isotope/drivers/DC_ProductData.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index dde8eb3874..756f3c017e 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -6,6 +6,7 @@ Version 2.1.12-stable (2015-??-??) ### Improved - Better Postfinance postsale handling +- Only filter by groups if one is set (fixes #1373) ### Fixed - Filter fields could overwrite product properties if property was not customer defined/variant option diff --git a/system/modules/isotope/drivers/DC_ProductData.php b/system/modules/isotope/drivers/DC_ProductData.php index 88bd1c27c4..8a05fb296c 100644 --- a/system/modules/isotope/drivers/DC_ProductData.php +++ b/system/modules/isotope/drivers/DC_ProductData.php @@ -136,7 +136,7 @@ public function showAll() $this->procedure[] = "language=''"; // Display products filtered by group - if (!$this->intId) { + if (!$this->intId && $this->intGroupId > 0) { $this->procedure[] = "gid IN(" . implode(',', array_map('intval', \Database::getInstance()->getChildRecords(array($this->intGroupId), \Isotope\Model\Group::getTable(), false, array($this->intGroupId)))) . ")"; } From 7f290621bde0737e960e9655fed6632ce63572a9 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Sun, 15 Mar 2015 15:56:21 +0100 Subject: [PATCH 10/16] Month and week reports were not correctly sorted across years (#1359) --- system/modules/isotope/docs/CHANGELOG-2.1.md | 1 + .../library/Isotope/Report/Sales.php | 8 ++++---- .../library/Isotope/Report/SalesTotal.php | 14 ++++++++------ .../templates/iso_report_sales_total.html5 | 7 +------ 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index 756f3c017e..45783b9c80 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -12,6 +12,7 @@ Version 2.1.12-stable (2015-??-??) - Filter fields could overwrite product properties if property was not customer defined/variant option - Added missing collection ID to template (#1394) - Default value for tl_iso_config.cartMinSubtotal was empty instead of decimal (#1367) +- Month and week reports were not correctly sorted across years (#1359) Version 2.1.11-stable (2015-02-10) diff --git a/system/modules/isotope_reports/library/Isotope/Report/Sales.php b/system/modules/isotope_reports/library/Isotope/Report/Sales.php index 9c06087634..146d4dec55 100644 --- a/system/modules/isotope_reports/library/Isotope/Report/Sales.php +++ b/system/modules/isotope_reports/library/Isotope/Report/Sales.php @@ -104,25 +104,25 @@ protected function getPeriodConfiguration($strPeriod) switch ($strPeriod) { case 'day': - $publicDate = 'd.m.y'; + $publicDate = '%d.%m.%y'; $privateDate = 'Ymd'; $sqlDate = '%Y%m%d'; break; case 'week': - $publicDate = '\K\W W/y'; + $publicDate = 'KW %U/%y'; $privateDate = 'YW'; $sqlDate = '%Y%u'; break; case 'month': - $publicDate = 'm/Y'; + $publicDate = '%m/%Y'; $privateDate = 'Ym'; $sqlDate = '%Y%m'; break; case 'year': - $publicDate = 'Y'; + $publicDate = '%Y'; $privateDate = 'Y'; $sqlDate = '%Y'; break; diff --git a/system/modules/isotope_reports/library/Isotope/Report/SalesTotal.php b/system/modules/isotope_reports/library/Isotope/Report/SalesTotal.php index a538cf05a8..fb4428e4c2 100644 --- a/system/modules/isotope_reports/library/Isotope/Report/SalesTotal.php +++ b/system/modules/isotope_reports/library/Isotope/Report/SalesTotal.php @@ -69,8 +69,8 @@ protected function compile() ")->execute($sqlDate); $arrCurrencies = array(); - $arrData = $this->initializeData($strPeriod, $intStart, $intStop, $privateDate, $publicDate); - $arrChart = $this->initializeChart($strPeriod, $intStart, $intStop, $privateDate, $publicDate); + $arrData = $this->initializeData($strPeriod, $intStart, $intStop, $privateDate); + $arrChart = $this->initializeChart($strPeriod, $intStart, $intStop, $privateDate); while ($objData->next()) { @@ -103,10 +103,12 @@ protected function compile() $this->Template->data = $arrData; $this->Template->chart = $arrChart; + $this->Template->period = $strPeriod; + $this->Template->dateFormat = $publicDate; } - protected function initializeData($strPeriod, $intStart, $intStop, $privateDate, $publicDate) + protected function initializeData($strPeriod, $intStart, $intStop, $privateDate) { $arrData = array('rows'=>array()); @@ -175,7 +177,7 @@ protected function initializeData($strPeriod, $intStart, $intStop, $privateDate, ( array ( - 'value' => $this->parseDate($publicDate, $intStart), + 'value' => $intStart, ), array ( @@ -209,7 +211,7 @@ protected function initializeData($strPeriod, $intStart, $intStop, $privateDate, } - protected function initializeChart($strPeriod, $intStart, $intStop, $privateDate, $publicDate) + protected function initializeChart($strPeriod, $intStart, $intStop, $privateDate) { $arrSession = \Session::getInstance()->get('iso_reports'); $intConfig = (int) $arrSession[$this->name]['iso_config']; @@ -232,7 +234,7 @@ protected function initializeChart($strPeriod, $intStart, $intStop, $privateDate { foreach ($arrCurrencies as $currency) { - $arrData[$currency]['data'][date($privateDate, $intStart)]['x'] = ($strPeriod == 'day' ? $intStart : $this->parseDate($publicDate, $intStart)); + $arrData[$currency]['data'][date($privateDate, $intStart)]['x'] = $intStart; $arrData[$currency]['data'][date($privateDate, $intStart)]['y'] = 0; } diff --git a/system/modules/isotope_reports/templates/iso_report_sales_total.html5 b/system/modules/isotope_reports/templates/iso_report_sales_total.html5 index 80c9be1c53..3831df63fa 100644 --- a/system/modules/isotope_reports/templates/iso_report_sales_total.html5 +++ b/system/modules/isotope_reports/templates/iso_report_sales_total.html5 @@ -92,12 +92,7 @@ window.addEvent('domready', function() { 'main': chart)); ?> }, '#report-data', { tickFormatX: function(x) { - // Timestamp, convert to day to fix sorting - if (x == parseInt(x, 10)) { - return new Date(x*1000).format('%d.%m.%y'); - } - - return x; + return new Date(x*1000).format('dateFormat; ?>'); } }); }); From 0138d6bb98182f016fc81b6eabfbff4154a5db4c Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Sun, 15 Mar 2015 16:10:21 +0100 Subject: [PATCH 11/16] Check transaction status for PayOne payments (#1392) --- system/modules/isotope/docs/CHANGELOG-2.1.md | 1 + .../library/Isotope/Model/Payment/Payone.php | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index 45783b9c80..584cbfd415 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -7,6 +7,7 @@ Version 2.1.12-stable (2015-??-??) ### Improved - Better Postfinance postsale handling - Only filter by groups if one is set (fixes #1373) +- Check transaction status for PayOne payments (#1392) ### Fixed - Filter fields could overwrite product properties if property was not customer defined/variant option diff --git a/system/modules/isotope/library/Isotope/Model/Payment/Payone.php b/system/modules/isotope/library/Isotope/Model/Payment/Payone.php index 5bdfd19cc8..790bede0c5 100644 --- a/system/modules/isotope/library/Isotope/Model/Payment/Payone.php +++ b/system/modules/isotope/library/Isotope/Model/Payment/Payone.php @@ -37,10 +37,15 @@ public function processPostsale(IsotopeProductCollection $objOrder) die('TSOK'); } - if (\Input::post('txaction') != 'paid' - && \Input::post('currency') != $objOrder->currency - && \Input::post('balance') > 0 + // Ignore all except these actions + if (\Input::post('txaction') != 'appointed' + && \Input::post('txaction') != 'capture' + && \Input::post('txaction') != 'paid' ) { + die('TSOK'); + } + + if (\Input::post('currency') != $objOrder->currency || \Input::post('balance') > 0) { \System::log('PayOne order data mismatch for Order ID "' . \Input::post('invoice') . '"', __METHOD__, TL_ERROR); die('TSOK'); } @@ -50,7 +55,10 @@ public function processPostsale(IsotopeProductCollection $objOrder) die('TSOK'); } - $objOrder->date_paid = time(); + if (\Input::post('txaction') == 'paid') { + $objOrder->date_paid = time(); + } + $objOrder->updateOrderStatus($this->new_order_status); $objOrder->save(); From 0e69825153ca6f75d0294665016f8ec84cfbfb0c Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Tue, 17 Mar 2015 09:06:56 +0100 Subject: [PATCH 12/16] Better logging when notification for order status was not found (#1391) --- system/modules/isotope/docs/CHANGELOG-2.1.md | 1 + .../library/Isotope/Model/ProductCollection/Order.php | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index 584cbfd415..5b8d058108 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -8,6 +8,7 @@ Version 2.1.12-stable (2015-??-??) - Better Postfinance postsale handling - Only filter by groups if one is set (fixes #1373) - Check transaction status for PayOne payments (#1392) +- Better logging when notification for order status was not found (#1391) ### Fixed - Filter fields could overwrite product properties if property was not customer defined/variant option diff --git a/system/modules/isotope/library/Isotope/Model/ProductCollection/Order.php b/system/modules/isotope/library/Isotope/Model/ProductCollection/Order.php index 3a982a2726..1c74f955c8 100644 --- a/system/modules/isotope/library/Isotope/Model/ProductCollection/Order.php +++ b/system/modules/isotope/library/Isotope/Model/ProductCollection/Order.php @@ -313,13 +313,12 @@ public function updateOrderStatus($intNewStatus) if (in_array(false, $arrResult)) { $blnNotificationError = true; + \System::log('Error sending status update notification for order ID ' . $this->id, __METHOD__, TL_ERROR); } elseif (!empty($arrResult)) { $blnNotificationError = false; } - } - - if ($blnNotificationError === true) { - \System::log('Error sending status update notification for order ID ' . $this->id, __METHOD__, TL_ERROR); + } else { + \System::log('Invalid notification for order status ID ' . $objNewStatus->id, __METHOD__, TL_ERROR); } } From f2bcaf50f4679c4f7287922d7c7e14463fa5452f Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Tue, 17 Mar 2015 09:41:22 +0100 Subject: [PATCH 13/16] CS --- system/modules/isotope/library/Isotope/Module/Module.php | 8 +++++--- .../isotope/library/Isotope/Module/RelatedProducts.php | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/system/modules/isotope/library/Isotope/Module/Module.php b/system/modules/isotope/library/Isotope/Module/Module.php index 1d67eb12bd..934bf0859e 100755 --- a/system/modules/isotope/library/Isotope/Module/Module.php +++ b/system/modules/isotope/library/Isotope/Module/Module.php @@ -12,6 +12,8 @@ namespace Isotope\Module; +use Haste\Input\Input; +use Haste\Util\Debug; use Isotope\Isotope; use Isotope\Model\Product; use Module as Contao_Module; @@ -57,8 +59,8 @@ public function __construct($objModule, $strColumn = 'main') if (TL_MODE == 'FE') { // Load Isotope javascript and css - $GLOBALS['TL_JAVASCRIPT'][] = \Haste\Util\Debug::uncompressedFile('system/modules/isotope/assets/js/isotope.min.js'); - $GLOBALS['TL_CSS'][] = \Haste\Util\Debug::uncompressedFile('system/modules/isotope/assets/css/isotope.min.css'); + $GLOBALS['TL_JAVASCRIPT'][] = Debug::uncompressedFile('system/modules/isotope/assets/js/isotope.min.js'); + $GLOBALS['TL_CSS'][] = Debug::uncompressedFile('system/modules/isotope/assets/css/isotope.min.css'); // Disable caching for pages with certain modules (eg. Cart) if ($this->blnDisableCache) { @@ -134,7 +136,7 @@ protected function findCategories() break; case 'product': - $objProduct = Product::findAvailableByIdOrAlias(\Haste\Input\Input::getAutoItem('product')); + $objProduct = Product::findAvailableByIdOrAlias(Input::getAutoItem('product')); if ($objProduct !== null) { $arrCategories = $objProduct->getCategories(true); diff --git a/system/modules/isotope/library/Isotope/Module/RelatedProducts.php b/system/modules/isotope/library/Isotope/Module/RelatedProducts.php index ac970fb4c6..afa9983c24 100644 --- a/system/modules/isotope/library/Isotope/Module/RelatedProducts.php +++ b/system/modules/isotope/library/Isotope/Module/RelatedProducts.php @@ -12,6 +12,7 @@ namespace Isotope\Module; +use Haste\Input\Input; use Isotope\Model\Product; use Isotope\Model\RelatedProduct; @@ -51,7 +52,7 @@ public function generate() return $objTemplate->parse(); } - if (!\Haste\Input\Input::getAutoItem('product', false, true)) { + if (!Input::getAutoItem('product', false, true)) { return ''; } @@ -77,7 +78,7 @@ protected function findProducts($arrCacheIds = null) { $arrIds = array(0); - $objProduct = Product::findAvailableByIdOrAlias(\Haste\Input\Input::getAutoItem('product')); + $objProduct = Product::findAvailableByIdOrAlias(Input::getAutoItem('product')); if (null === $objProduct) { return array(); From 01fa9af6f04096284ee062885df4437cf6ed6667 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Tue, 17 Mar 2015 10:03:10 +0100 Subject: [PATCH 14/16] Category scope "product" in product list module should not be cached (#1383) --- system/modules/isotope/docs/CHANGELOG-2.1.md | 1 + system/modules/isotope/library/Isotope/Module/ProductList.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index 5b8d058108..09f9ea3096 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -15,6 +15,7 @@ Version 2.1.12-stable (2015-??-??) - Added missing collection ID to template (#1394) - Default value for tl_iso_config.cartMinSubtotal was empty instead of decimal (#1367) - Month and week reports were not correctly sorted across years (#1359) +- Category scope "product" in product list module should not be cached (#1383) Version 2.1.11-stable (2015-02-10) diff --git a/system/modules/isotope/library/Isotope/Module/ProductList.php b/system/modules/isotope/library/Isotope/Module/ProductList.php index 8970ed1ea3..e9ab293ee3 100755 --- a/system/modules/isotope/library/Isotope/Module/ProductList.php +++ b/system/modules/isotope/library/Isotope/Module/ProductList.php @@ -75,7 +75,7 @@ public function generate() $this->iso_productcache = deserialize($this->iso_productcache, true); // Disable the cache in frontend preview or debug mode - if (BE_USER_LOGGED_IN === true || $GLOBALS['TL_CONFIG']['debugMode']) { + if (BE_USER_LOGGED_IN === true || $GLOBALS['TL_CONFIG']['debugMode'] || $this->iso_category_scope == 'product') { $this->blnCacheProducts = false; } From 590a8d014d949f29a6ecdbe31cafa1657a55c3ff Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Tue, 17 Mar 2015 11:14:00 +0100 Subject: [PATCH 15/16] Check if there are pages before checking access (fixes #1398) --- system/modules/isotope/docs/CHANGELOG-2.1.md | 1 + .../modules/isotope/library/Isotope/Frontend.php | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index 09f9ea3096..cd0d5190d1 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -16,6 +16,7 @@ Version 2.1.12-stable (2015-??-??) - Default value for tl_iso_config.cartMinSubtotal was empty instead of decimal (#1367) - Month and week reports were not correctly sorted across years (#1359) - Category scope "product" in product list module should not be cached (#1383) +- Warning if products are not assigned to any category (#1398) Version 2.1.11-stable (2015-02-10) diff --git a/system/modules/isotope/library/Isotope/Frontend.php b/system/modules/isotope/library/Isotope/Frontend.php index ac05fdbc77..5151a57282 100644 --- a/system/modules/isotope/library/Isotope/Frontend.php +++ b/system/modules/isotope/library/Isotope/Frontend.php @@ -529,6 +529,10 @@ public function storeCurrentArticle($objRow) */ public static function getPagesInCurrentRoot(array $arrPages, $objMember = null) { + if (empty($arrPages)) { + return $arrPages; + } + global $objPage; // $objPage not available, we dont know if the page is allowed @@ -549,7 +553,15 @@ public static function getPagesInCurrentRoot(array $arrPages, $objMember = null) } } - foreach (array_diff($arrPages, $arrAvailable, $arrUnavailable) as $intPage) { + if (!isset($arrAvailable[$intMember])) { + $arrAvailable[$intMember] = array(); + } + + if (!isset($arrUnavailable[$intMember])) { + $arrUnavailable[$intMember] = array(); + } + + foreach (array_diff($arrPages, $arrUnavailable[$intMember], $arrUnavailable[$intMember]) as $intPage) { $objPageDetails = \PageModel::findWithDetails($intPage); // Page is not in the current root From 85d4f9cda5a5746c40a10a58f3fe294e9249dc92 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Tue, 17 Mar 2015 11:23:22 +0100 Subject: [PATCH 16/16] Finishing 2.1.12 hotfix release --- system/modules/isotope/docs/CHANGELOG-2.1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index cd0d5190d1..f79c326adf 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -1,7 +1,7 @@ Isotope eCommerce Changelog =========================== -Version 2.1.12-stable (2015-??-??) +Version 2.1.12-stable (2015-03-17) ---------------------------------- ### Improved