Last active
March 21, 2017 09:32
-
-
Save digitalpianism/14a15cd52baede0e5d600e8c653f33e9 to your computer and use it in GitHub Desktop.
Diff between 1.9.3 and 1.9.2.4 + SUPEE-8788 / Don't mind the app/Mage.php autoloader patch ;)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/.htaccess b/.htaccess | |
index aca7f55..63e1729 100644 | |
--- a/.htaccess | |
+++ b/.htaccess | |
@@ -144,6 +144,21 @@ | |
RewriteCond %{REQUEST_METHOD} ^TRAC[EK] | |
RewriteRule .* - [L,R=405] | |
+<IfModule mod_setenvif.c> | |
+ <IfModule mod_headers.c> | |
+ | |
+ ############################################ | |
+ # X-Content-Type-Options: nosniff disable content-type sniffing on some browsers. | |
+ Header set X-Content-Type-Options: nosniff | |
+ | |
+ ############################################ | |
+ # This header forces to enables the Cross-site scripting (XSS) filter in browsers (if disabled) | |
+ BrowserMatch \bMSIE\s8 ie8 | |
+ Header set X-XSS-Protection: "1; mode=block" env=!ie8 | |
+ | |
+ </IfModule> | |
+</IfModule> | |
+ | |
############################################ | |
## redirect for mobile user agents | |
diff --git a/.htaccess.sample b/.htaccess.sample | |
index 383313a..4353f6b 100644 | |
--- a/.htaccess.sample | |
+++ b/.htaccess.sample | |
@@ -127,6 +127,21 @@ | |
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] | |
+<IfModule mod_setenvif.c> | |
+ <IfModule mod_headers.c> | |
+ | |
+ ############################################ | |
+ # X-Content-Type-Options: nosniff disable content-type sniffing on some browsers. | |
+ Header set X-Content-Type-Options: nosniff | |
+ | |
+ ############################################ | |
+ # This header forces to enables the Cross-site scripting (XSS) filter in browsers (if disabled) | |
+ BrowserMatch \bMSIE\s8 ie8 | |
+ Header set X-XSS-Protection: "1; mode=block" env=!ie8 | |
+ | |
+ </IfModule> | |
+</IfModule> | |
+ | |
############################################ | |
## always send 404 on missing files in these folders | |
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt | |
index abedf96..d237e58 100644 | |
--- a/RELEASE_NOTES.txt | |
+++ b/RELEASE_NOTES.txt | |
@@ -1,3 +1,13 @@ | |
+==== 1.9.3.0 ==== | |
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
+] NOTE: Current Release Notes are maintained at: [ | |
+] [ | |
+] http://merch.docs.magento.com/ce/user_guide/magento/release-notes-ce-1.9.3.0.html [ | |
+] [ | |
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
+ | |
==== 1.9.2.4 ==== | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
@@ -53,7 +63,7 @@ | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
] NOTE: Current Release Notes are maintained at: [ | |
] [ | |
-] http://www.magentocommerce.com/knowledge-base/entry/ce-19-later-release-notes [ | |
+] http://devdocs.magento.com/guides/m1x/ce18-ee113/ce1.9_release-notes.html [ | |
] [ | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
diff --git a/api.php b/api.php | |
index 1b6c612..e40400b 100644 | |
--- a/api.php | |
+++ b/api.php | |
@@ -74,8 +74,11 @@ if (in_array($apiAlias, Mage_Api2_Model_Server::getApiTypes())) { | |
} else { | |
/* @var $server Mage_Api_Model_Server */ | |
$server = Mage::getSingleton('api/server'); | |
- $adapterCode = $server->getAdapterCodeByAlias($apiAlias); | |
- | |
+ if (!$apiAlias) { | |
+ $adapterCode = 'default'; | |
+ } else { | |
+ $adapterCode = $server->getAdapterCodeByAlias($apiAlias); | |
+ } | |
// if no adapters found in aliases - find it by default, by code | |
if (null === $adapterCode) { | |
$adapterCode = $apiAlias; | |
diff --git a/app/Mage.php b/app/Mage.php | |
index 2ec7216..ca15775 100644 | |
--- a/app/Mage.php | |
+++ b/app/Mage.php | |
@@ -53,14 +53,6 @@ if (defined('COMPILER_INCLUDE_PATH')) { | |
Varien_Autoload::register(); | |
-/** AUTOLOADER PATCH **/ | |
-if (file_exists($autoloaderPath = BP . DS . '../vendor/autoload.php') || | |
- file_exists($autoloaderPath = BP . DS . 'vendor/autoload.php') | |
-) { | |
- require $autoloaderPath; | |
-} | |
-/** AUTOLOADER PATCH **/ | |
- | |
/** | |
* Main Mage hub class | |
* | |
@@ -178,8 +170,8 @@ final class Mage | |
return array( | |
'major' => '1', | |
'minor' => '9', | |
- 'revision' => '2', | |
- 'patch' => '4', | |
+ 'revision' => '3', | |
+ 'patch' => '0', | |
'stability' => '', | |
'number' => '', | |
); | |
diff --git a/app/code/core/Mage/Admin/Model/User.php b/app/code/core/Mage/Admin/Model/User.php | |
index 439085e..f1d193c 100644 | |
--- a/app/code/core/Mage/Admin/Model/User.php | |
+++ b/app/code/core/Mage/Admin/Model/User.php | |
@@ -640,8 +640,8 @@ class Mage_Admin_Model_User extends Mage_Core_Model_Abstract | |
return true; | |
} | |
- $dayDifference = floor(($currentTimestamp - $tokenTimestamp) / (24 * 60 * 60)); | |
- if ($dayDifference >= $tokenExpirationPeriod) { | |
+ $hoursDifference = floor(($currentTimestamp - $tokenTimestamp) / (60 * 60)); | |
+ if ($hoursDifference >= $tokenExpirationPeriod) { | |
return true; | |
} | |
@@ -665,7 +665,7 @@ class Mage_Admin_Model_User extends Mage_Core_Model_Abstract | |
/** | |
* Simple sql format date | |
* | |
- * @param string $format | |
+ * @param string | boolean $dayOnly | |
* @return string | |
*/ | |
protected function _getDateNow($dayOnly = false) | |
diff --git a/app/code/core/Mage/Admin/etc/config.xml b/app/code/core/Mage/Admin/etc/config.xml | |
index ccc27b9..d22e814 100644 | |
--- a/app/code/core/Mage/Admin/etc/config.xml | |
+++ b/app/code/core/Mage/Admin/etc/config.xml | |
@@ -85,7 +85,7 @@ | |
<emails> | |
<forgot_email_template>admin_emails_forgot_email_template</forgot_email_template> | |
<forgot_email_identity>general</forgot_email_identity> | |
- <password_reset_link_expiration_period>1</password_reset_link_expiration_period> | |
+ <password_reset_link_expiration_period>2</password_reset_link_expiration_period> | |
</emails> | |
</admin> | |
</default> | |
diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Crosssell.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Crosssell.php | |
index 5b32d48..e54f68a 100644 | |
--- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Crosssell.php | |
+++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Crosssell.php | |
@@ -207,14 +207,15 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Crosssell extends Mage_Admin | |
$this->addColumn('position', array( | |
- 'header' => Mage::helper('catalog')->__('Position'), | |
- 'name' => 'position', | |
- 'width' => 60, | |
- 'type' => 'number', | |
- 'validate_class' => 'validate-number', | |
- 'index' => 'position', | |
- 'editable' => !$this->isReadonly(), | |
- 'edit_only' => !$this->_getProduct()->getId() | |
+ 'header' => Mage::helper('catalog')->__('Position'), | |
+ 'name' => 'position', | |
+ 'width' => 60, | |
+ 'type' => 'number', | |
+ 'validate_class' => 'validate-number', | |
+ 'index' => 'position', | |
+ 'editable' => !$this->isReadonly(), | |
+ 'edit_only' => !$this->_getProduct()->getId(), | |
+ 'filter_condition_callback' => array($this, '_addLinkModelFilterCallback') | |
)); | |
return parent::_prepareColumns(); | |
diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group.php | |
index ba8de8f..e786341 100644 | |
--- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group.php | |
+++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group.php | |
@@ -93,4 +93,13 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Group | |
return parent::_prepareLayout(); | |
} | |
+ /** | |
+ * Get is percent flag | |
+ * | |
+ * @return int | |
+ */ | |
+ public function getIsPercent() { | |
+ return $this->getData('is_percent') ? $this->getData('is_percent') : 0; | |
+ } | |
+ | |
} | |
diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Related.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Related.php | |
index ca37fb9..bf7e4a8 100644 | |
--- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Related.php | |
+++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Related.php | |
@@ -203,14 +203,15 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Related extends Mage_Adminht | |
)); | |
$this->addColumn('position', array( | |
- 'header' => Mage::helper('catalog')->__('Position'), | |
- 'name' => 'position', | |
- 'type' => 'number', | |
- 'validate_class' => 'validate-number', | |
- 'index' => 'position', | |
- 'width' => 60, | |
- 'editable' => !$this->_getProduct()->getRelatedReadonly(), | |
- 'edit_only' => !$this->_getProduct()->getId() | |
+ 'header' => Mage::helper('catalog')->__('Position'), | |
+ 'name' => 'position', | |
+ 'type' => 'number', | |
+ 'validate_class' => 'validate-number', | |
+ 'index' => 'position', | |
+ 'width' => 60, | |
+ 'editable' => !$this->_getProduct()->getRelatedReadonly(), | |
+ 'edit_only' => !$this->_getProduct()->getId(), | |
+ 'filter_condition_callback' => array($this, '_addLinkModelFilterCallback') | |
)); | |
return parent::_prepareColumns(); | |
diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Group.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Group.php | |
index 420b903..9ff8ad3 100644 | |
--- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Group.php | |
+++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Group.php | |
@@ -156,7 +156,8 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Group extends Mage_Adm | |
'validate_class' => 'validate-number', | |
'index' => 'qty', | |
'width' => '1', | |
- 'editable' => true | |
+ 'editable' => true, | |
+ 'filter_condition_callback' => array($this, '_addLinkModelFilterCallback') | |
)); | |
$this->addColumn('position', array( | |
@@ -167,7 +168,8 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Group extends Mage_Adm | |
'index' => 'position', | |
'width' => '1', | |
'editable' => true, | |
- 'edit_only' => !$this->_getProduct()->getId() | |
+ 'edit_only' => !$this->_getProduct()->getId(), | |
+ 'filter_condition_callback' => array($this, '_addLinkModelFilterCallback') | |
)); | |
return parent::_prepareColumns(); | |
diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Upsell.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Upsell.php | |
index e030ebb..4bf6fbb 100644 | |
--- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Upsell.php | |
+++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Upsell.php | |
@@ -203,14 +203,15 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Upsell extends Mage_Adminhtm | |
)); | |
$this->addColumn('position', array( | |
- 'header' => Mage::helper('catalog')->__('Position'), | |
- 'name' => 'position', | |
- 'type' => 'number', | |
- 'width' => 60, | |
- 'validate_class' => 'validate-number', | |
- 'index' => 'position', | |
- 'editable' => !$this->_getProduct()->getUpsellReadonly(), | |
- 'edit_only' => !$this->_getProduct()->getId() | |
+ 'header' => Mage::helper('catalog')->__('Position'), | |
+ 'name' => 'position', | |
+ 'type' => 'number', | |
+ 'width' => 60, | |
+ 'validate_class' => 'validate-number', | |
+ 'index' => 'position', | |
+ 'editable' => !$this->_getProduct()->getUpsellReadonly(), | |
+ 'edit_only' => !$this->_getProduct()->getId(), | |
+ 'filter_condition_callback' => array($this, '_addLinkModelFilterCallback') | |
)); | |
return parent::_prepareColumns(); | |
diff --git a/app/code/core/Mage/Adminhtml/Block/Notification/Curl.php b/app/code/core/Mage/Adminhtml/Block/Notification/Curl.php | |
new file mode 100644 | |
index 0000000..77b08c8 | |
--- /dev/null | |
+++ b/app/code/core/Mage/Adminhtml/Block/Notification/Curl.php | |
@@ -0,0 +1,96 @@ | |
+<?php | |
+/** | |
+ * Magento | |
+ * | |
+ * NOTICE OF LICENSE | |
+ * | |
+ * This source file is subject to the Open Software License (OSL 3.0) | |
+ * that is bundled with this package in the file LICENSE.txt. | |
+ * It is also available through the world-wide-web at this URL: | |
+ * http://opensource.org/licenses/osl-3.0.php | |
+ * If you did not receive a copy of the license and are unable to | |
+ * obtain it through the world-wide-web, please send an email | |
+ * to [email protected] so we can send you a copy immediately. | |
+ * | |
+ * DISCLAIMER | |
+ * | |
+ * Do not edit or add to this file if you wish to upgrade Magento to newer | |
+ * versions in the future. If you wish to customize Magento for your | |
+ * needs please refer to http://www.magento.com for more information. | |
+ * | |
+ * @category Mage | |
+ * @package Mage_Adminhtml | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
+ */ | |
+ | |
+/** | |
+ * Class Mage_Adminhtml_Block_Notification_Curl | |
+ */ | |
+class Mage_Adminhtml_Block_Notification_Curl extends Mage_Adminhtml_Block_Template | |
+{ | |
+ /** | |
+ * Required version of cURL. | |
+ */ | |
+ const REQUIRED_CURL_VERSION = '7.34.0'; | |
+ | |
+ /** | |
+ * Information about cURL version. | |
+ * | |
+ * @var array | |
+ */ | |
+ protected $_curlVersion; | |
+ | |
+ public function __construct() | |
+ { | |
+ $this->_curlVersion = curl_version(); | |
+ } | |
+ | |
+ /** | |
+ * Check cURL version and return true if system must show notification message. | |
+ * | |
+ * @return bool | |
+ */ | |
+ protected function _canShow() | |
+ { | |
+ $result = false; | |
+ if ( | |
+ $this->getRequest()->getParam('section') == 'payment' | |
+ && !version_compare($this->_curlVersion['version'], $this::REQUIRED_CURL_VERSION, '>=') | |
+ ) { | |
+ $result = true; | |
+ } | |
+ | |
+ return $result; | |
+ } | |
+ | |
+ /** | |
+ * Returns a message that should be displayed. | |
+ * | |
+ * @return string | |
+ */ | |
+ public function getMessage() | |
+ { | |
+ $message = $this->helper('adminhtml')->__( | |
+ "Your current version of cURL php5 module is %s, which can prevent services that require TLS v1.2 from working correctly. It is recommended to update your cURL php5 module to version %s or higher.", | |
+ $this->_curlVersion['version'], | |
+ $this::REQUIRED_CURL_VERSION | |
+ ); | |
+ | |
+ return $message; | |
+ } | |
+ | |
+ /** | |
+ * Prepare html output. | |
+ * | |
+ * @return string | |
+ */ | |
+ protected function _toHtml() | |
+ { | |
+ if (!$this->_canShow()) { | |
+ return ''; | |
+ } | |
+ | |
+ return parent::_toHtml(); | |
+ } | |
+} | |
diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Abstract.php | |
index 7010838..e08aa19 100644 | |
--- a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Abstract.php | |
+++ b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Abstract.php | |
@@ -217,6 +217,7 @@ class Mage_Adminhtml_Block_Report_Grid_Abstract extends Mage_Adminhtml_Block_Wid | |
->isTotals(true); | |
$this->_addOrderStatusFilter($totalsCollection, $filterData); | |
+ $this->_addCustomFilter($totalsCollection, $filterData); | |
if (count($totalsCollection->getItems()) < 1 || !$filterData->getData('from')) { | |
$this->setTotals(new Varien_Object()); | |
diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Tabs.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Tabs.php | |
index 8219eb1..da4125d 100644 | |
--- a/app/code/core/Mage/Adminhtml/Block/System/Config/Tabs.php | |
+++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Tabs.php | |
@@ -147,7 +147,7 @@ class Mage_Adminhtml_Block_System_Config_Tabs extends Mage_Adminhtml_Block_Widge | |
} | |
} | |
- Mage::helper('adminhtml')->addPageHelpUrl($current.'/'); | |
+ Mage::helper('adminhtml')->addPageHelpUrl('/section/' . $current); | |
return $this; | |
} | |
diff --git a/app/code/core/Mage/Adminhtml/Block/System/Variable/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/System/Variable/Edit/Form.php | |
index 538a805..3affa5a 100644 | |
--- a/app/code/core/Mage/Adminhtml/Block/System/Variable/Edit/Form.php | |
+++ b/app/code/core/Mage/Adminhtml/Block/System/Variable/Edit/Form.php | |
@@ -78,7 +78,9 @@ class Mage_Adminhtml_Block_System_Variable_Edit_Form extends Mage_Adminhtml_Bloc | |
$useDefault = false; | |
if ($this->getVariable()->getId() && $this->getVariable()->getStoreId()) { | |
- $useDefault = !((bool)$this->getVariable()->getStoreHtmlValue()); | |
+ $useDefault = !((bool)$this->getVariable()->getStoreHtmlValue() | |
+ || (bool)$this->getVariable()->getStorePlainValue() | |
+ ); | |
$this->getVariable()->setUseDefaultValue((int)$useDefault); | |
$fieldset->addField('use_default_value', 'select', array( | |
'name' => 'use_default_value', | |
diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php | |
index 6e6226b..278ffa2 100644 | |
--- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php | |
+++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php | |
@@ -477,6 +477,23 @@ class Mage_Adminhtml_Block_Widget_Grid extends Mage_Adminhtml_Block_Widget | |
} | |
/** | |
+ * Add link model filter from grid column to collection | |
+ * | |
+ * @param Mage_Catalog_Model_Resource_Product_Link_Product_Collection $collection | |
+ * @param Mage_Adminhtml_Block_Widget_Grid_Column $column | |
+ * | |
+ * @return Mage_Adminhtml_Block_Widget_Grid | |
+ */ | |
+ protected function _addLinkModelFilterCallback($collection, $column) | |
+ { | |
+ $field = ($column->getFilterIndex()) ? $column->getFilterIndex() : $column->getIndex(); | |
+ $condition = $column->getFilter()->getCondition(); | |
+ $collection->addLinkModelFieldToFilter($field, $condition); | |
+ | |
+ return $this; | |
+ } | |
+ | |
+ /** | |
* Sets sorting order by some column | |
* | |
* @param Mage_Adminhtml_Block_Widget_Grid_Column $column | |
diff --git a/app/code/core/Mage/Adminhtml/Controller/Rss/Abstract.php b/app/code/core/Mage/Adminhtml/Controller/Rss/Abstract.php | |
new file mode 100644 | |
index 0000000..65f598a | |
--- /dev/null | |
+++ b/app/code/core/Mage/Adminhtml/Controller/Rss/Abstract.php | |
@@ -0,0 +1,77 @@ | |
+<?php | |
+/** | |
+ * Magento | |
+ * | |
+ * NOTICE OF LICENSE | |
+ * | |
+ * This source file is subject to the Open Software License (OSL 3.0) | |
+ * that is bundled with this package in the file LICENSE.txt. | |
+ * It is also available through the world-wide-web at this URL: | |
+ * http://opensource.org/licenses/osl-3.0.php | |
+ * If you did not receive a copy of the license and are unable to | |
+ * obtain it through the world-wide-web, please send an email | |
+ * to [email protected] so we can send you a copy immediately. | |
+ * | |
+ * DISCLAIMER | |
+ * | |
+ * Do not edit or add to this file if you wish to upgrade Magento to newer | |
+ * versions in the future. If you wish to customize Magento for your | |
+ * needs please refer to http://www.magento.com for more information. | |
+ * | |
+ * @category Mage | |
+ * @package Mage_Adminhtml | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
+ */ | |
+ | |
+/** | |
+ * Adminhtml abstract Rss controller | |
+ * | |
+ * @category Mage | |
+ * @package Mage_Adminhtml | |
+ * @author Magento Core Team <[email protected]> | |
+ */ | |
+class Mage_Adminhtml_Controller_Rss_Abstract extends Mage_Adminhtml_Controller_Action | |
+{ | |
+ /** | |
+ * Check feed enabled in config | |
+ * | |
+ * @param string $code | |
+ * @return boolean | |
+ */ | |
+ protected function isFeedEnable($code) | |
+ { | |
+ return $this->_getHelper('rss')->isRssEnabled() | |
+ && Mage::getStoreConfig('rss/'. $code); | |
+ } | |
+ | |
+ /** | |
+ * Do check feed enabled and prepare response | |
+ * | |
+ * @param string $code | |
+ * @return boolean | |
+ */ | |
+ protected function checkFeedEnable($code) | |
+ { | |
+ if ($this->isFeedEnable($code)) { | |
+ $this->getResponse()->setHeader('Content-type', 'text/xml; charset=UTF-8'); | |
+ return true; | |
+ } else { | |
+ $this->getResponse()->setHeader('HTTP/1.1', '404 Not Found'); | |
+ $this->getResponse()->setHeader('Status', '404 File not found'); | |
+ $this->_forward('noRoute'); | |
+ return false; | |
+ } | |
+ } | |
+ | |
+ /** | |
+ * Retrieve helper instance | |
+ * | |
+ * @param string $name | |
+ * @return Mage_Core_Helper_Abstract | |
+ */ | |
+ protected function _getHelper($name) | |
+ { | |
+ return Mage::helper($name); | |
+ } | |
+} | |
diff --git a/app/code/core/Mage/Adminhtml/Helper/Data.php b/app/code/core/Mage/Adminhtml/Helper/Data.php | |
index b92e164..e92e1c5 100644 | |
--- a/app/code/core/Mage/Adminhtml/Helper/Data.php | |
+++ b/app/code/core/Mage/Adminhtml/Helper/Data.php | |
@@ -31,7 +31,7 @@ | |
* @package Mage_Adminhtml | |
* @author Magento Core Team <[email protected]> | |
*/ | |
-class Mage_Adminhtml_Helper_Data extends Mage_Core_Helper_Abstract | |
+class Mage_Adminhtml_Helper_Data extends Mage_Adminhtml_Helper_Help_Mapping | |
{ | |
const XML_PATH_ADMINHTML_ROUTER_FRONTNAME = 'admin/routers/adminhtml/args/frontName'; | |
const XML_PATH_USE_CUSTOM_ADMIN_URL = 'default/admin/url/use_custom'; | |
@@ -40,15 +40,29 @@ class Mage_Adminhtml_Helper_Data extends Mage_Core_Helper_Abstract | |
protected $_pageHelpUrl; | |
- public function getPageHelpUrl() | |
+ /** | |
+ * Get mapped help pages url | |
+ * | |
+ * @param null|string $url | |
+ * @param null|string $suffix | |
+ * @return mixed | |
+ */ | |
+ public function getPageHelpUrl($url = null, $suffix = null) | |
{ | |
if (!$this->_pageHelpUrl) { | |
- $this->setPageHelpUrl(); | |
+ $this->setPageHelpUrl($url, $suffix); | |
} | |
return $this->_pageHelpUrl; | |
} | |
- public function setPageHelpUrl($url=null) | |
+ /** | |
+ * Set help page url | |
+ * | |
+ * @param null|string $url | |
+ * @param null|string $suffix | |
+ * @return $this | |
+ */ | |
+ public function setPageHelpUrl($url = null, $suffix = null) | |
{ | |
if (is_null($url)) { | |
$request = Mage::app()->getRequest(); | |
@@ -62,11 +76,17 @@ class Mage_Adminhtml_Helper_Data extends Mage_Core_Helper_Abstract | |
$frontModule = $frontModule[0]; | |
} | |
} | |
- $url = 'http://www.magentocommerce.com/gethelp/'; | |
- $url.= Mage::app()->getLocale()->getLocaleCode().'/'; | |
- $url.= $frontModule.'/'; | |
- $url.= $request->getControllerName().'/'; | |
- $url.= $request->getActionName().'/'; | |
+ $url = "http://merch.docs.magento.com/{$this->getHelpTargetVersion()}/user_guide/"; | |
+ | |
+ $moduleName = $frontModule; | |
+ $controllerName = $request->getControllerName(); | |
+ $actionName = $request->getActionName() . (!is_null($suffix) ? $suffix : ''); | |
+ | |
+ if ($mappingUrl = $this->findInMapping($moduleName, $controllerName, $actionName)) { | |
+ $url .= $mappingUrl; | |
+ } else { | |
+ $url = 'http://magento.com/help/documentation'; | |
+ } | |
$this->_pageHelpUrl = $url; | |
} | |
@@ -75,9 +95,15 @@ class Mage_Adminhtml_Helper_Data extends Mage_Core_Helper_Abstract | |
return $this; | |
} | |
+ /** | |
+ * Add suffix for help page url | |
+ * | |
+ * @param string $suffix | |
+ * @return $this | |
+ */ | |
public function addPageHelpUrl($suffix) | |
{ | |
- $this->_pageHelpUrl = $this->getPageHelpUrl().$suffix; | |
+ $this->_pageHelpUrl = $this->getPageHelpUrl(null, $suffix); | |
return $this; | |
} | |
diff --git a/app/code/core/Mage/Adminhtml/Helper/Help/Mapping.php b/app/code/core/Mage/Adminhtml/Helper/Help/Mapping.php | |
new file mode 100644 | |
index 0000000..9d05262 | |
--- /dev/null | |
+++ b/app/code/core/Mage/Adminhtml/Helper/Help/Mapping.php | |
@@ -0,0 +1,255 @@ | |
+<?php | |
+/** | |
+ * Magento | |
+ * | |
+ * NOTICE OF LICENSE | |
+ * | |
+ * This source file is subject to the Open Software License (OSL 3.0) | |
+ * that is bundled with this package in the file LICENSE.txt. | |
+ * It is also available through the world-wide-web at this URL: | |
+ * http://opensource.org/licenses/osl-3.0.php | |
+ * If you did not receive a copy of the license and are unable to | |
+ * obtain it through the world-wide-web, please send an email | |
+ * to [email protected] so we can send you a copy immediately. | |
+ * | |
+ * DISCLAIMER | |
+ * | |
+ * Do not edit or add to this file if you wish to upgrade Magento to newer | |
+ * versions in the future. If you wish to customize Magento for your | |
+ * needs please refer to http://www.magento.com for more information. | |
+ * | |
+ * @category Mage | |
+ * @package Mage_Adminhtml | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
+ */ | |
+ | |
+/** | |
+ * Adminhtml help url mapper | |
+ * | |
+ * @category Mage | |
+ * @package Mage_Adminhtml | |
+ */ | |
+ | |
+abstract class Mage_Adminhtml_Helper_Help_Mapping extends Mage_Core_Helper_Abstract | |
+{ | |
+ /** | |
+ * Mapping of help page urls depending on module and page route | |
+ * | |
+ * @var array | |
+ */ | |
+ protected $_moduleMappings = array( | |
+ 'Mage_Adminhtml' => array( | |
+ /* Dashboard */ | |
+ 'dashboard' => 'store-operations/reports-dashboard.html', | |
+ /* Sales */ | |
+ 'sales_order' => 'order-processing/order-manage.html', | |
+ 'sales_invoice' => 'order-processing/order-invoice.html', | |
+ 'sales_shipment' => 'order-processing/order-ship.html', | |
+ 'sales_creditmemo' => 'order-processing/credit-refunds.html', | |
+ 'sales_transactions' => 'order-processing/sales-transactions.html', | |
+ 'sales_recurring_profile' => 'catalog/product-recurring-profile.html', | |
+ 'sales_billing_agreement' => 'payment/paypal-billing-agreements.html', | |
+ 'checkout_agreement' => 'order-processing/terms-conditions.html', | |
+ /* Sales → Tax */ | |
+ 'tax_rule' => 'tax/tax-rules.html', | |
+ 'tax_rate' => 'tax/tax-zones-rates.html', | |
+ 'tax_rate/importExport' => 'tax/tax-rates-import-export.html', | |
+ 'tax_class_customer' => 'tax/tax-class-customer.html', | |
+ 'tax_class_product' => 'tax/tax-class-product.html', | |
+ /* Catalog */ | |
+ 'catalog_product' => 'catalog/product-create.html', | |
+ 'catalog_category/edit' => 'catalog/category-create.html', | |
+ 'urlrewrite' => 'search_seo/seo-url-redirect.html', | |
+ 'catalog_search' => 'search_seo/search-terms.html', | |
+ 'sitemap' => 'marketing/google-sitemap.html', | |
+ /* Catalog → Attributes */ | |
+ 'catalog_product_attribute' => 'catalog/attributes.html', | |
+ 'catalog_product_set' => 'catalog/attribute-set.html', | |
+ /* Catalog → Reviews and Ratings → Customer Reviews */ | |
+ 'catalog_product_review/pending' => 'marketing/product-reviews.html', | |
+ 'catalog_product_review' => 'marketing/product-reviews.html', | |
+ 'rating' => 'marketing/product-reviews-ratings.html', | |
+ /* Catalog → Tags */ | |
+ 'tag' => 'marketing/tags.html', | |
+ 'tag/pending' => 'marketing/tags-moderate.html', | |
+ /* Customers */ | |
+ 'customer' => 'customers/customer-account-create.html', | |
+ 'customer_group' => 'customers/customer-group-create.html', | |
+ 'customer_online' => 'order-processing/customers-online.html', | |
+ /* Promotions */ | |
+ 'promo_catalog' => 'marketing/price-rules-catalog.html', | |
+ 'promo_quote' => 'marketing/price-rules-shopping-cart.html', | |
+ /* Newsletter */ | |
+ 'newsletter_template' => 'marketing/newsletter-templates.html', | |
+ 'newsletter_queue' => 'marketing/newsletter-queue.html', | |
+ 'newsletter_subscriber' => 'marketing/newsletter.html', | |
+ 'newsletter_problem' => 'marketing/newsletter.html', | |
+ /* CMS */ | |
+ 'cms_page' => 'cms/pages.html', | |
+ 'cms_block' => 'cms/blocks.html', | |
+ 'poll' => 'marketing/polls.html', | |
+ /* Reports → Sales */ | |
+ 'report_sales/sales' => 'store-operations/reports-generating.html', | |
+ 'report_sales/tax' =>'store-operations/reports-available.html', | |
+ 'report_sales/invoiced' =>'store-operations/reports-available.html', | |
+ 'report_sales/shipping' =>'store-operations/reports-available.html', | |
+ 'report_sales/refunded' =>'store-operations/reports-available.html', | |
+ 'report_sales/coupons' =>'store-operations/reports-available.html', | |
+ /* Reports → Shopping Cart */ | |
+ 'report_shopcart/product' =>'store-operations/reports-available.html', | |
+ 'report_shopcart/abandoned' =>'store-operations/reports-available.html', | |
+ /* Reports → Products */ | |
+ 'report_sales/bestsellers' =>'store-operations/reports-available.html', | |
+ 'report_product/sold' =>'store-operations/reports-available.html', | |
+ 'report_product/viewed' =>'store-operations/reports-available.html', | |
+ 'report_product/lowstock' =>'store-operations/reports-available.html', | |
+ 'report_product/downloads' =>'store-operations/reports-available.html', | |
+ /* Reports → Customers */ | |
+ 'report_customer/accounts' =>'store-operations/reports-available.html', | |
+ 'report_customer/totals' =>'store-operations/reports-available.html', | |
+ 'report_customer/orders' =>'store-operations/reports-available.html', | |
+ /* Reports → Tags */ | |
+ 'report_tag/customer' =>'store-operations/reports-available.html', | |
+ 'report_tag/product' =>'store-operations/reports-available.html', | |
+ 'report_tag/popular' =>'store-operations/reports-available.html', | |
+ /* Reports → Reviews */ | |
+ 'report_review/customer' =>'store-operations/reports-available.html', | |
+ 'report_review/product' =>'store-operations/reports-available.html', | |
+ /* Search Terms */ | |
+ 'report/search' =>'store-operations/reports-available.html', | |
+ /* Refresh statistics */ | |
+ 'report_statistics' =>'store-operations/reports-refresh.html', | |
+ /* My Account */ | |
+ 'system_account' => 'store-operations/admin-my-account.html', | |
+ /* Notifications */ | |
+ 'notification' => 'store-operations/admin-messages.html', | |
+ /* Tools → Backup */ | |
+ 'system_backup' => 'system-operations/server-backup-rollback.html', | |
+ /* Web Services */ | |
+ 'api_user' => 'system-operations/web-services.html', | |
+ 'api_role' => 'system-operations/web-services.html', | |
+ 'api2_role' => 'system-operations/web-services.html', | |
+ /* System → Design */ | |
+ 'system_design' => 'design/themes.html', | |
+ /* System → Import/Export */ | |
+ 'system_convert_gui' => 'store-operations/dataflow.html', | |
+ 'system_convert_profile' => 'store-operations/dataflow.html', | |
+ /* System → Manage Currency */ | |
+ 'system_currency' => 'store-operations/currency-rates.html', | |
+ 'system_currencysymbol' => 'store-operations/currency-symbols.html', | |
+ /* System → Transactional emails */ | |
+ 'system_email_template' => 'store-operations/email-transactional.html', | |
+ /* System → Custom Variables */ | |
+ 'system_variable' => 'cms/variables-custom.html', | |
+ /* System → Permissions */ | |
+ 'permissions_user' => 'store-operations/permissions-user-new.html', | |
+ 'permissions_role' => 'store-operations/permissions-role-custom.html', | |
+ /* System → Cache Management */ | |
+ 'cache' => 'system-operations/cache-management.html', | |
+ /* System → Stores Management */ | |
+ 'system_store' => 'store-operations/store-hierarchy.html', | |
+ /* System → Order statuses */ | |
+ 'sales_order_status' => 'order-processing/order-status.html', | |
+ /* System → Configuration */ | |
+ 'system_config/edit/section/general' => 'configuration/general/general.html', | |
+ 'system_config/edit/section/web' => 'configuration/general/web.html', | |
+ 'system_config/edit/section/design' => 'configuration/general/design.html', | |
+ 'system_config/edit/section/currency' => 'configuration/general/currency-setup.html', | |
+ 'system_config/edit/section/trans_email' => 'configuration/general/store-email-addresses.html', | |
+ 'system_config/edit/section/contacts' => 'configuration/general/contacts.html', | |
+ 'system_config/edit/section/reports' => 'configuration/general/reports.html', | |
+ 'system_config/edit/section/cms' => 'configuration/general/content-management.html', | |
+ 'system_config/edit/section/catalog' => 'configuration/catalog/catalog.html', | |
+ 'system_config/edit/section/configswatches' => 'configuration/catalog/configurable-swatches.html', | |
+ 'system_config/edit/section/cataloginventory' => 'configuration/catalog/inventory.html', | |
+ 'system_config/edit/section/sitemap' => 'configuration/catalog/google-sitemap.html', | |
+ 'system_config/edit/section/rss' => 'configuration/catalog/rss-feeds.html', | |
+ 'system_config/edit/section/sendfriend' => 'configuration/catalog/email-to-a-friend.html', | |
+ 'system_config/edit/section/newsletter' => 'configuration/customers/newsletter.html', | |
+ 'system_config/edit/section/customer' => 'configuration/customers/customer-configuration.html', | |
+ 'system_config/edit/section/wishlist' => 'configuration/customers/wishlist.html', | |
+ 'system_config/edit/section/promo' => 'configuration/customers/promotions.html', | |
+ 'system_config/edit/section/persistent' => 'configuration/customers/persistent-shopping-cart.html', | |
+ 'system_config/edit/section/sales' => 'configuration/sales/sales.html', | |
+ 'system_config/edit/section/sales_email' => 'configuration/sales/sales-emails.html', | |
+ 'system_config/edit/section/sales_pdf' => 'configuration/sales/pdf-print-outs.html', | |
+ 'system_config/edit/section/tax' => 'configuration/sales/tax.html', | |
+ 'system_config/edit/section/checkout' => 'configuration/sales/checkout.html', | |
+ 'system_config/edit/section/shipping' => 'configuration/sales/shipping-settings.html', | |
+ 'system_config/edit/section/carriers' => 'configuration/sales/shipping-methods.html', | |
+ 'system_config/edit/section/google' => 'configuration/sales/google-api.html', | |
+ 'system_config/edit/section/payment' => 'configuration/sales/payment-methods.html', | |
+ 'system_config/edit/section/payment_services' => 'configuration/sales/payment-services.html', | |
+ 'system_config/edit/section/moneybookers' => 'payment/gateways.html', | |
+ 'system_config/edit/section/api' => 'configuration/services/magento-core-api.html', | |
+ 'system_config/edit/section/oauth' => 'configuration/services/oauth.html', | |
+ 'system_config/edit/section/admin' => 'configuration/advanced/admin.html', | |
+ 'system_config/edit/section/system' => 'configuration/advanced/system.html', | |
+ 'system_config/edit/section/advanced' => 'configuration/advanced/advanced.html', | |
+ 'system_config/edit/section/dev' => 'configuration/advanced/developer.html', | |
+ ), | |
+ 'Mage_Widget_Adminhtml' => array( | |
+ 'widget_instance' => 'cms/widgets.html', | |
+ ), | |
+ 'Mage_Paypal_Adminhtml' => array( | |
+ 'paypal_reports' => 'store-operations/reports-available.html', | |
+ ), | |
+ 'Mage_Compiler_Adminhtml' => array( | |
+ 'compiler_process' => 'system-operations/system-tools-compilation.html', | |
+ ), | |
+ 'Mage_Api2_Adminhtml' => array( | |
+ 'api2_attribute' => 'system-operations/web-services.html', | |
+ ), | |
+ 'Mage_Oauth_Adminhtml' => array( | |
+ 'oauth_consumer' => 'system-operations/web-services.html', | |
+ 'oauth_authorizedTokens' => 'system-operations/web-services.html', | |
+ 'oauth_admin_token' => 'system-operations/web-services.html', | |
+ ), | |
+ 'Mage_ImportExport_Adminhtml' => array( | |
+ 'import' => 'store-operations/data-import.html', | |
+ 'export' => 'store-operations/data-export.html', | |
+ ), | |
+ 'Mage_Connect_Adminhtml' => array( | |
+ 'extension_custom/edit' => 'magento/magento-connect.html' | |
+ ), | |
+ 'Mage_Index_Adminhtml' => array( | |
+ 'process/list' => 'system-operations/index-management.html' | |
+ ), | |
+ ); | |
+ | |
+ /** | |
+ * Compose reconstructed URL using mapping | |
+ * | |
+ * @param string $frontModule | |
+ * @param string $controllerName | |
+ * @param string $actionName | |
+ * @return string|bool | |
+ */ | |
+ protected function findInMapping($frontModule, $controllerName, $actionName) | |
+ { | |
+ if ($actionName === 'index' ) { | |
+ $targetToFind = $controllerName; | |
+ } else { | |
+ $targetToFind = $controllerName . '/' . $actionName; | |
+ } | |
+ if (isset($this->_moduleMappings[$frontModule]) | |
+ && isset($this->_moduleMappings[$frontModule][$targetToFind]) | |
+ ) { | |
+ return $this->_moduleMappings[$frontModule][$targetToFind]; | |
+ } | |
+ | |
+ return false; | |
+ } | |
+ | |
+ /** | |
+ * Determine which version of docs should target onto | |
+ * | |
+ * @return string | |
+ */ | |
+ protected function getHelpTargetVersion() | |
+ { | |
+ return Mage::getConfig()->getNode('default/help/target_version'); | |
+ } | |
+ | |
+} | |
diff --git a/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php b/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php | |
index 334d8b3..76ee575 100644 | |
--- a/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php | |
+++ b/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php | |
@@ -596,6 +596,9 @@ class Mage_Adminhtml_Model_Sales_Order_Create extends Varien_Object implements M | |
if (is_string($cartItem)) { | |
Mage::throwException($cartItem); | |
} | |
+ if ($cartItem->getParentItem()) { | |
+ $cartItem = $cartItem->getParentItem(); | |
+ } | |
$cartItem->setPrice($item->getProduct()->getPrice()); | |
$this->_needCollectCart = true; | |
$removeItem = true; | |
diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Customer/Forgotpassword.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Customer/Forgotpassword.php | |
new file mode 100644 | |
index 0000000..a5c82b6 | |
--- /dev/null | |
+++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Customer/Forgotpassword.php | |
@@ -0,0 +1,51 @@ | |
+<?php | |
+/** | |
+ * Magento | |
+ * | |
+ * NOTICE OF LICENSE | |
+ * | |
+ * This source file is subject to the Open Software License (OSL 3.0) | |
+ * that is bundled with this package in the file LICENSE.txt. | |
+ * It is also available through the world-wide-web at this URL: | |
+ * http://opensource.org/licenses/osl-3.0.php | |
+ * If you did not receive a copy of the license and are unable to | |
+ * obtain it through the world-wide-web, please send an email | |
+ * to [email protected] so we can send you a copy immediately. | |
+ * | |
+ * DISCLAIMER | |
+ * | |
+ * Do not edit or add to this file if you wish to upgrade Magento to newer | |
+ * versions in the future. If you wish to customize Magento for your | |
+ * needs please refer to http://www.magento.com for more information. | |
+ * | |
+ * @category Mage | |
+ * @package Mage_Adminhtml | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
+ */ | |
+ | |
+/** | |
+ * Source model of forgot password flow requests options types | |
+ * | |
+ * @category Mage | |
+ * @package Mage_Adminhtml | |
+ * @author Magento Core Team <[email protected]> | |
+ */ | |
+class Mage_Adminhtml_Model_System_Config_Source_Customer_Forgotpassword | |
+{ | |
+ const FORGOTPASS_FLOW_DISABLED = 0; | |
+ const FORGOTPASS_FLOW_IP_EMAIL = 1; | |
+ const FORGOTPASS_FLOW_IP = 2; | |
+ const FORGOTPASS_FLOW_EMAIL = 3; | |
+ | |
+ public function toOptionArray() | |
+ { | |
+ return array( | |
+ array('value' => self::FORGOTPASS_FLOW_DISABLED, 'label' => Mage::helper('adminhtml')->__('Disabled')), | |
+ array('value' => self::FORGOTPASS_FLOW_IP_EMAIL, 'label' => Mage::helper('adminhtml')->__('By IP and Email')), | |
+ array('value' => self::FORGOTPASS_FLOW_IP, 'label' => Mage::helper('adminhtml')->__('By IP')), | |
+ array('value' => self::FORGOTPASS_FLOW_EMAIL, 'label' => Mage::helper('adminhtml')->__('By Email')), | |
+ ); | |
+ } | |
+ | |
+} | |
diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/AttributeController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/AttributeController.php | |
index 7ae3fb6..95fe677 100644 | |
--- a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/AttributeController.php | |
+++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/AttributeController.php | |
@@ -37,6 +37,21 @@ class Mage_Adminhtml_Catalog_Product_AttributeController extends Mage_Adminhtml_ | |
protected $_entityTypeId; | |
+ /** | |
+ * List of tags from setting | |
+ */ | |
+ const XML_PATH_ALLOWED_TAGS = 'system/catalog/frontend/allowed_html_tags_list'; | |
+ | |
+ /** | |
+ * Get list of allowed text formatted as array | |
+ * | |
+ * @return array | |
+ */ | |
+ protected function _getAllowedTags() | |
+ { | |
+ return explode(',', Mage::getStoreConfig(self::XML_PATH_ALLOWED_TAGS)); | |
+ } | |
+ | |
public function preDispatch() | |
{ | |
parent::preDispatch(); | |
@@ -164,7 +179,17 @@ class Mage_Adminhtml_Catalog_Product_AttributeController extends Mage_Adminhtml_ | |
if (!empty($data['option']) && !empty($data['option']['value']) && is_array($data['option']['value'])) { | |
foreach ($data['option']['value'] as $key => $values) { | |
- $data['option']['value'][$key] = array_map(array($helperCatalog, 'stripTags'), $values); | |
+ $isHtmlAllowedOnFrontend = isset($data['is_html_allowed_on_front']) | |
+ && $data['is_html_allowed_on_front']; | |
+ $data['option']['value'][$key] = array_map( | |
+ array($helperCatalog, 'stripTags'), | |
+ $values, | |
+ array_fill( | |
+ 0, | |
+ count($values), | |
+ $isHtmlAllowedOnFrontend ? sprintf('<%s>', implode('><', $this->_getAllowedTags())): null | |
+ ) | |
+ ); | |
} | |
} | |
} | |
diff --git a/app/code/core/Mage/Adminhtml/controllers/Cms/Wysiwyg/ImagesController.php b/app/code/core/Mage/Adminhtml/controllers/Cms/Wysiwyg/ImagesController.php | |
index ce53168..6baa56c 100644 | |
--- a/app/code/core/Mage/Adminhtml/controllers/Cms/Wysiwyg/ImagesController.php | |
+++ b/app/code/core/Mage/Adminhtml/controllers/Cms/Wysiwyg/ImagesController.php | |
@@ -188,7 +188,10 @@ class Mage_Adminhtml_Cms_Wysiwyg_ImagesController extends Mage_Adminhtml_Control | |
if ($thumb !== false) { | |
$image = Varien_Image_Adapter::factory('GD2'); | |
$image->open($thumb); | |
+ ob_start(); | |
$image->display(); | |
+ $this->getResponse()->setBody(ob_get_contents()); | |
+ ob_end_clean(); | |
} else { | |
// todo: genearte some placeholder | |
} | |
diff --git a/app/code/core/Mage/Adminhtml/controllers/Cms/WysiwygController.php b/app/code/core/Mage/Adminhtml/controllers/Cms/WysiwygController.php | |
index 28f8783..7a93bc0 100644 | |
--- a/app/code/core/Mage/Adminhtml/controllers/Cms/WysiwygController.php | |
+++ b/app/code/core/Mage/Adminhtml/controllers/Cms/WysiwygController.php | |
@@ -46,22 +46,14 @@ class Mage_Adminhtml_Cms_WysiwygController extends Mage_Adminhtml_Controller_Act | |
try { | |
$image = Varien_Image_Adapter::factory('GD2'); | |
$image->open($url); | |
- $image->display(); | |
} catch (Exception $e) { | |
$image = Varien_Image_Adapter::factory('GD2'); | |
$image->open(Mage::getSingleton('cms/wysiwyg_config')->getSkinImagePlaceholderPath()); | |
- $image->display(); | |
- /* | |
- $image = imagecreate(100, 100); | |
- $bkgrColor = imagecolorallocate($image,10,10,10); | |
- imagefill($image,0,0,$bkgrColor); | |
- $textColor = imagecolorallocate($image,255,255,255); | |
- imagestring($image, 4, 10, 10, 'Skin image', $textColor); | |
- header('Content-type: image/png'); | |
- imagepng($image); | |
- imagedestroy($image); | |
- */ | |
} | |
+ ob_start(); | |
+ $image->display(); | |
+ $this->getResponse()->setBody(ob_get_contents()); | |
+ ob_end_clean(); | |
} | |
/** | |
diff --git a/app/code/core/Mage/Adminhtml/controllers/Rss/CatalogController.php b/app/code/core/Mage/Adminhtml/controllers/Rss/CatalogController.php | |
index a296f3d..d9a494a 100644 | |
--- a/app/code/core/Mage/Adminhtml/controllers/Rss/CatalogController.php | |
+++ b/app/code/core/Mage/Adminhtml/controllers/Rss/CatalogController.php | |
@@ -32,7 +32,7 @@ | |
* @author Magento Core Team <[email protected]> | |
*/ | |
-class Mage_Adminhtml_Rss_CatalogController extends Mage_Adminhtml_Controller_Action | |
+class Mage_Adminhtml_Rss_CatalogController extends Mage_Adminhtml_Controller_Rss_Abstract | |
{ | |
/** | |
* Check is allowed access to action | |
@@ -53,15 +53,17 @@ class Mage_Adminhtml_Rss_CatalogController extends Mage_Adminhtml_Controller_Act | |
public function notifystockAction() | |
{ | |
- $this->getResponse()->setHeader('Content-type', 'text/xml; charset=UTF-8'); | |
- $this->loadLayout(false); | |
- $this->renderLayout(); | |
+ if ($this->checkFeedEnable('admin_catalog/notifystock')) { | |
+ $this->loadLayout(false); | |
+ $this->renderLayout(); | |
+ } | |
} | |
public function reviewAction() | |
{ | |
- $this->getResponse()->setHeader('Content-type', 'text/xml; charset=UTF-8'); | |
- $this->loadLayout(false); | |
- $this->renderLayout(); | |
+ if ($this->checkFeedEnable('admin_catalog/review')) { | |
+ $this->loadLayout(false); | |
+ $this->renderLayout(); | |
+ } | |
} | |
} | |
diff --git a/app/code/core/Mage/Adminhtml/controllers/Rss/OrderController.php b/app/code/core/Mage/Adminhtml/controllers/Rss/OrderController.php | |
index bc4fedd..ddf69e3 100644 | |
--- a/app/code/core/Mage/Adminhtml/controllers/Rss/OrderController.php | |
+++ b/app/code/core/Mage/Adminhtml/controllers/Rss/OrderController.php | |
@@ -32,15 +32,15 @@ | |
* @author Magento Core Team <[email protected]> | |
*/ | |
-class Mage_Adminhtml_Rss_OrderController extends Mage_Adminhtml_Controller_Action | |
+class Mage_Adminhtml_Rss_OrderController extends Mage_Adminhtml_Controller_Rss_Abstract | |
{ | |
public function newAction() | |
{ | |
- Mage::helper('rss')->authAdmin('sales/order'); | |
- $this->getResponse()->setHeader('Content-type', 'text/xml; charset=UTF-8'); | |
- $this->loadLayout(false); | |
- $this->renderLayout(); | |
+ if ($this->checkFeedEnable('order/new')) { | |
+ $this->loadLayout(false); | |
+ $this->renderLayout(); | |
+ } | |
} | |
/** | |
diff --git a/app/code/core/Mage/Adminhtml/controllers/UrlrewriteController.php b/app/code/core/Mage/Adminhtml/controllers/UrlrewriteController.php | |
index cabd6e3..49c9992 100644 | |
--- a/app/code/core/Mage/Adminhtml/controllers/UrlrewriteController.php | |
+++ b/app/code/core/Mage/Adminhtml/controllers/UrlrewriteController.php | |
@@ -135,7 +135,7 @@ class Mage_Adminhtml_UrlrewriteController extends Mage_Adminhtml_Controller_Acti | |
->setTargetPath($this->getRequest()->getParam('target_path')) | |
->setOptions($this->getRequest()->getParam('options')) | |
->setDescription($this->getRequest()->getParam('description')) | |
- ->setRequestPath($requestPath); | |
+ ->setRequestPath(strtolower($requestPath)); | |
if (!$model->getId()) { | |
$model->setIsSystem(0); | |
diff --git a/app/code/core/Mage/Adminhtml/etc/config.xml b/app/code/core/Mage/Adminhtml/etc/config.xml | |
index a088550..92829f6 100644 | |
--- a/app/code/core/Mage/Adminhtml/etc/config.xml | |
+++ b/app/code/core/Mage/Adminhtml/etc/config.xml | |
@@ -191,13 +191,18 @@ | |
<dashboard> | |
<enable_charts>1</enable_charts> | |
</dashboard> | |
+ <catalog> | |
+ <frontend> | |
+ <allowed_html_tags_list>a,abbr,acronym,address,applet,area,base,basefont,bdo,big,blockquote,br,button,caption,center,cite,code,col,colgroup,dd,del,dfn,dir,div,dl,dt,em,i,fieldset,font,form,frame,frameset,h1,h2,h3,h4,h5,h6,hr,img,input,ins,kbd,label,legend,li,map,menu,meta,noscript,ol,optgroup,option,p,param,pre,q,s,samp,select,small,span,strike,strong,b,sub,sup,table,tbody,td,textarea,tfoot,th,thead,title,tr,tt,u,ul,var</allowed_html_tags_list> | |
+ </frontend> | |
+ </catalog> | |
</system> | |
<general> | |
<file> | |
<sitemap_generate_valid_paths> | |
<!-- This data should be merged with public_files_valid_paths --> | |
<available> | |
- <any_path>/*/sitemap.xml</any_path> | |
+ <any_path>/*/*.xml</any_path> | |
</available> | |
</sitemap_generate_valid_paths> | |
</file> | |
@@ -211,10 +216,13 @@ | |
</general> | |
<hints> | |
<store_switcher> | |
- <url><![CDATA[http://www.magentocommerce.com/knowledge-base/entry/understanding-store-scopes]]></url> | |
+ <url><![CDATA[http://merch.docs.magento.com/ce/user_guide/configuration/scope.html]]></url> | |
<enabled>1</enabled> | |
</store_switcher> | |
</hints> | |
+ <help> | |
+ <target_version>ce</target_version> | |
+ </help> | |
</default> | |
<stores> | |
<admin> | |
diff --git a/app/code/core/Mage/Adminhtml/etc/jstranslator.xml b/app/code/core/Mage/Adminhtml/etc/jstranslator.xml | |
index 9fae860..44dff5b 100644 | |
--- a/app/code/core/Mage/Adminhtml/etc/jstranslator.xml | |
+++ b/app/code/core/Mage/Adminhtml/etc/jstranslator.xml | |
@@ -26,6 +26,10 @@ | |
*/ | |
--> | |
<jstranslator> | |
+ <!-- validation.js --> | |
+ <validate-special-price translate="message" module="adminhtml"> | |
+ <message>The Special Price is active only when lower than the Actual Price.</message> | |
+ </validate-special-price> | |
<!-- flexuploader.js --> | |
<flexuploader-complete translate="message" module="adminhtml"> | |
<message>Complete</message> | |
diff --git a/app/code/core/Mage/Api/Model/Server/Handler/Abstract.php b/app/code/core/Mage/Api/Model/Server/Handler/Abstract.php | |
index 7dd517d..bfc6763 100644 | |
--- a/app/code/core/Mage/Api/Model/Server/Handler/Abstract.php | |
+++ b/app/code/core/Mage/Api/Model/Server/Handler/Abstract.php | |
@@ -288,13 +288,15 @@ abstract class Mage_Api_Model_Server_Handler_Abstract | |
} | |
if (method_exists($model, $method)) { | |
+ $result = array(); | |
if (isset($methodInfo->arguments) && ((string)$methodInfo->arguments) == 'array') { | |
- return $model->$method((is_array($args) ? $args : array($args))); | |
+ $result = $model->$method((is_array($args) ? $args : array($args))); | |
} elseif (!is_array($args)) { | |
- return $model->$method($args); | |
+ $result = $model->$method($args); | |
} else { | |
- return call_user_func_array(array(&$model, $method), $args); | |
+ $result = call_user_func_array(array(&$model, $method), $args); | |
} | |
+ return $this->processingMethodResult($result); | |
} else { | |
throw new Mage_Api_Exception('resource_path_not_callable'); | |
} | |
@@ -401,13 +403,15 @@ abstract class Mage_Api_Model_Server_Handler_Abstract | |
} | |
if (method_exists($model, $method)) { | |
+ $callResult = array(); | |
if (isset($methodInfo->arguments) && ((string)$methodInfo->arguments) == 'array') { | |
- $result[] = $model->$method((is_array($args) ? $args : array($args))); | |
+ $callResult = $model->$method((is_array($args) ? $args : array($args))); | |
} elseif (!is_array($args)) { | |
- $result[] = $model->$method($args); | |
+ $callResult = $model->$method($args); | |
} else { | |
- $result[] = call_user_func_array(array(&$model, $method), $args); | |
+ $callResult = call_user_func_array(array(&$model, $method), $args); | |
} | |
+ $result[] = $this->processingMethodResult($callResult); | |
} else { | |
throw new Mage_Api_Exception('resource_path_not_callable'); | |
} | |
@@ -543,4 +547,41 @@ abstract class Mage_Api_Model_Server_Handler_Abstract | |
$this->_startSession($sessionId); | |
return array_values($this->_getConfig()->getFaults()); | |
} | |
+ | |
+ /** | |
+ * Prepare Api data for XML exporting | |
+ * See allowed characters in XML: | |
+ * @link http://www.w3.org/TR/2000/REC-xml-20001006#NT-Char | |
+ * | |
+ * @param array $result | |
+ * @return mixed | |
+ */ | |
+ public function processingMethodResult(array $result) | |
+ { | |
+ foreach ($result as &$row) { | |
+ if (!is_null($row) && !is_bool($row) && !is_numeric($row)) { | |
+ $row = $this->processingRow($row); | |
+ } | |
+ } | |
+ return $result; | |
+ } | |
+ | |
+ /** | |
+ * Prepare Api row data for XML exporting | |
+ * Convert not allowed symbol to numeric character reference | |
+ * | |
+ * @param $row | |
+ * @return mixed | |
+ */ | |
+ public function processingRow($row) | |
+ { | |
+ $row = preg_replace_callback( | |
+ '/[^\x{0009}\x{000a}\x{000d}\x{0020}-\x{D7FF}\x{E000}-\x{FFFD}\x{10000}-\x{10FFFF}]/u', | |
+ function ($matches) { | |
+ return '&#' . Mage::helper('core/string')->uniOrd($matches[0]) . ';'; | |
+ }, | |
+ $row | |
+ ); | |
+ return $row; | |
+ } | |
} // Class Mage_Api_Model_Server_Handler_Abstract End | |
diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes.php | |
index 8cbef43..eb23487 100644 | |
--- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes.php | |
+++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes.php | |
@@ -121,6 +121,7 @@ class Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Attributes | |
$groupPrice->setRenderer( | |
$this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_price_group') | |
->setPriceColumnHeader(Mage::helper('bundle')->__('Percent Discount')) | |
+ ->setIsPercent(true) | |
->setPriceValidation('validate-greater-than-zero validate-percents') | |
); | |
} | |
diff --git a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php | |
index 140ed24..58f8ab9 100644 | |
--- a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php | |
+++ b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php | |
@@ -85,8 +85,13 @@ class Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option extends Mage_Bun | |
$_canChangeQty = $_default->getSelectionCanChangeQty(); | |
} elseif (!$inPreConfigured && $selectedOptions && is_numeric($selectedOptions)) { | |
$selectedSelection = $_option->getSelectionById($selectedOptions); | |
- $_defaultQty = $selectedSelection->getSelectionQty() * 1; | |
- $_canChangeQty = $selectedSelection->getSelectionCanChangeQty(); | |
+ if ($selectedSelection) { | |
+ $_defaultQty = $selectedSelection->getSelectionQty() * 1; | |
+ $_canChangeQty = $selectedSelection->getSelectionCanChangeQty(); | |
+ } else { | |
+ $_defaultQty = $_selections[0]->getSelectionQty() * 1; | |
+ $_canChangeQty = $_selections[0]->getSelectionCanChangeQty(); | |
+ } | |
} elseif (!$this->_showSingle() || $inPreConfigured) { | |
$_defaultQty = $this->_getSelectedQty(); | |
$_canChangeQty = (bool)$_defaultQty; | |
diff --git a/app/code/core/Mage/Catalog/Block/Product/Abstract.php b/app/code/core/Mage/Catalog/Block/Product/Abstract.php | |
index 027d838..0723b55 100644 | |
--- a/app/code/core/Mage/Catalog/Block/Product/Abstract.php | |
+++ b/app/code/core/Mage/Catalog/Block/Product/Abstract.php | |
@@ -105,6 +105,16 @@ abstract class Mage_Catalog_Block_Product_Abstract extends Mage_Core_Block_Templ | |
protected $_mapRenderer = 'msrp'; | |
/** | |
+ * Get catalog product helper | |
+ * | |
+ * @return Mage_Catalog_Helper_Product | |
+ */ | |
+ public function getProductHelper() | |
+ { | |
+ return Mage::helper('catalog/product'); | |
+ } | |
+ | |
+ /** | |
* Retrieve url for add product to cart | |
* Will return product view page URL if product has required options | |
* | |
@@ -195,12 +205,7 @@ abstract class Mage_Catalog_Block_Product_Abstract extends Mage_Core_Block_Templ | |
*/ | |
public function getMinimalQty($product) | |
{ | |
- $stockItem = $product->getStockItem(); | |
- if ($stockItem) { | |
- return ($stockItem->getMinSaleQty() | |
- && $stockItem->getMinSaleQty() > 0 ? $stockItem->getMinSaleQty() * 1 : null); | |
- } | |
- return null; | |
+ return $this->getProductHelper()->getMinimalQty($product); | |
} | |
/** | |
diff --git a/app/code/core/Mage/Catalog/Block/Product/List.php b/app/code/core/Mage/Catalog/Block/Product/List.php | |
index 8bc5cb9..e1279fa 100644 | |
--- a/app/code/core/Mage/Catalog/Block/Product/List.php | |
+++ b/app/code/core/Mage/Catalog/Block/Product/List.php | |
@@ -62,16 +62,13 @@ class Mage_Catalog_Block_Product_List extends Mage_Catalog_Block_Product_Abstrac | |
$this->setCategoryId(Mage::app()->getStore()->getRootCategoryId()); | |
} | |
- // if this is a product view page | |
if (Mage::registry('product')) { | |
- // get collection of categories this product is associated with | |
+ /** @var Mage_Catalog_Model_Resource_Category_Collection $categories */ | |
$categories = Mage::registry('product')->getCategoryCollection() | |
->setPage(1, 1) | |
->load(); | |
- // if the product is associated with any category | |
if ($categories->count()) { | |
- // show products from this category | |
- $this->setCategoryId(current($categories->getIterator())); | |
+ $this->setCategoryId($categories->getFirstItem()->getId()); | |
} | |
} | |
diff --git a/app/code/core/Mage/Catalog/Block/Product/View.php b/app/code/core/Mage/Catalog/Block/Product/View.php | |
index c444a6d..2f31de9 100644 | |
--- a/app/code/core/Mage/Catalog/Block/Product/View.php | |
+++ b/app/code/core/Mage/Catalog/Block/Product/View.php | |
@@ -141,62 +141,14 @@ class Mage_Catalog_Block_Product_View extends Mage_Catalog_Block_Product_Abstrac | |
return Mage::helper('core')->jsonEncode($config); | |
} | |
- $_request = Mage::getSingleton('tax/calculation')->getDefaultRateRequest(); | |
/* @var $product Mage_Catalog_Model_Product */ | |
$product = $this->getProduct(); | |
- $_request->setProductClassId($product->getTaxClassId()); | |
- $defaultTax = Mage::getSingleton('tax/calculation')->getRate($_request); | |
- $_request = Mage::getSingleton('tax/calculation')->getRateRequest(); | |
- $_request->setProductClassId($product->getTaxClassId()); | |
- $currentTax = Mage::getSingleton('tax/calculation')->getRate($_request); | |
- | |
- $_regularPrice = $product->getPrice(); | |
- $_finalPrice = $product->getFinalPrice(); | |
- if ($product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_BUNDLE) { | |
- $_priceInclTax = Mage::helper('tax')->getPrice($product, $_finalPrice, true, | |
- null, null, null, null, null, false); | |
- $_priceExclTax = Mage::helper('tax')->getPrice($product, $_finalPrice, false, | |
- null, null, null, null, null, false); | |
- } else { | |
- $_priceInclTax = Mage::helper('tax')->getPrice($product, $_finalPrice, true); | |
- $_priceExclTax = Mage::helper('tax')->getPrice($product, $_finalPrice); | |
- } | |
- $_tierPrices = array(); | |
- $_tierPricesInclTax = array(); | |
- foreach ($product->getTierPrice() as $tierPrice) { | |
- $_tierPrices[] = Mage::helper('core')->currency( | |
- Mage::helper('tax')->getPrice($product, (float)$tierPrice['website_price'], false) - $_priceExclTax | |
- , false, false); | |
- $_tierPricesInclTax[] = Mage::helper('core')->currency( | |
- Mage::helper('tax')->getPrice($product, (float)$tierPrice['website_price'], true) - $_priceInclTax | |
- , false, false); | |
- } | |
- $config = array( | |
- 'productId' => $product->getId(), | |
- 'priceFormat' => Mage::app()->getLocale()->getJsPriceFormat(), | |
- 'includeTax' => Mage::helper('tax')->priceIncludesTax() ? 'true' : 'false', | |
- 'showIncludeTax' => Mage::helper('tax')->displayPriceIncludingTax(), | |
- 'showBothPrices' => Mage::helper('tax')->displayBothPrices(), | |
- 'productPrice' => Mage::helper('core')->currency($_finalPrice, false, false), | |
- 'productOldPrice' => Mage::helper('core')->currency($_regularPrice, false, false), | |
- 'priceInclTax' => Mage::helper('core')->currency($_priceInclTax, false, false), | |
- 'priceExclTax' => Mage::helper('core')->currency($_priceExclTax, false, false), | |
- /** | |
- * @var skipCalculate | |
- * @deprecated after 1.5.1.0 | |
- */ | |
- 'skipCalculate' => ($_priceExclTax != $_priceInclTax ? 0 : 1), | |
- 'defaultTax' => $defaultTax, | |
- 'currentTax' => $currentTax, | |
- 'idSuffix' => '_clone', | |
- 'oldPlusDisposition' => 0, | |
- 'plusDisposition' => 0, | |
- 'plusDispositionTax' => 0, | |
- 'oldMinusDisposition' => 0, | |
- 'minusDisposition' => 0, | |
- 'tierPrices' => $_tierPrices, | |
- 'tierPricesInclTax' => $_tierPricesInclTax, | |
+ /** @var Mage_Catalog_Helper_Product_Type_Composite $compositeProductHelper */ | |
+ $compositeProductHelper = $this->helper('catalog/product_type_composite'); | |
+ $config = array_merge( | |
+ $compositeProductHelper->prepareJsonGeneralConfig(), | |
+ $compositeProductHelper->prepareJsonProductConfig($product) | |
); | |
$responseObject = new Varien_Object(); | |
@@ -259,14 +211,7 @@ class Mage_Catalog_Block_Product_View extends Mage_Catalog_Block_Product_Abstrac | |
$product = $this->getProduct(); | |
} | |
- $qty = $this->getMinimalQty($product); | |
- $config = $product->getPreconfiguredValues(); | |
- $configQty = $config->getQty(); | |
- if ($configQty > $qty) { | |
- $qty = $configQty; | |
- } | |
- | |
- return $qty; | |
+ return $this->getProductHelper()->getDefaultQty($product); | |
} | |
/** | |
diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php b/app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php | |
index ec48b25..c0088ba 100644 | |
--- a/app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php | |
+++ b/app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php | |
@@ -49,6 +49,16 @@ class Mage_Catalog_Block_Product_View_Type_Configurable extends Mage_Catalog_Blo | |
protected $_resPrices = array(); | |
/** | |
+ * Get helper for calculation purposes | |
+ * | |
+ * @return Mage_Catalog_Helper_Product_Type_Composite | |
+ */ | |
+ protected function _getHelper() | |
+ { | |
+ return $this->helper('catalog/product_type_composite'); | |
+ } | |
+ | |
+ /** | |
* Get allowed attributes | |
* | |
* @return array | |
@@ -91,7 +101,10 @@ class Mage_Catalog_Block_Product_View_Type_Configurable extends Mage_Catalog_Blo | |
$allProducts = $this->getProduct()->getTypeInstance(true) | |
->getUsedProducts(null, $this->getProduct()); | |
foreach ($allProducts as $product) { | |
- if ($product->isSaleable() || $skipSaleableCheck) { | |
+ if ($product->isSaleable() | |
+ || $skipSaleableCheck | |
+ || (!$product->getStockItem()->getIsInStock() | |
+ && Mage::helper('cataloginventory')->isShowOutOfStock())) { | |
$products[] = $product; | |
} | |
} | |
@@ -103,11 +116,12 @@ class Mage_Catalog_Block_Product_View_Type_Configurable extends Mage_Catalog_Blo | |
/** | |
* retrieve current store | |
* | |
+ * @deprecated | |
* @return Mage_Core_Model_Store | |
*/ | |
public function getCurrentStore() | |
{ | |
- return Mage::app()->getStore(); | |
+ return $this->_getHelper()->getCurrentStore(); | |
} | |
/** | |
@@ -138,10 +152,10 @@ class Mage_Catalog_Block_Product_View_Type_Configurable extends Mage_Catalog_Blo | |
$preconfiguredValues = $currentProduct->getPreconfiguredValues(); | |
$defaultValues = array(); | |
} | |
- | |
+ $productStock = array(); | |
foreach ($this->getAllowProducts() as $product) { | |
$productId = $product->getId(); | |
- | |
+ $productStock[$productId] = $product->getStockItem()->getIsInStock(); | |
foreach ($this->getAllowAttributes() as $attribute) { | |
$productAttribute = $attribute->getProductAttribute(); | |
$productAttributeId = $productAttribute->getId(); | |
@@ -189,7 +203,13 @@ class Mage_Catalog_Block_Product_View_Type_Configurable extends Mage_Catalog_Blo | |
$configurablePrice = $currentProduct->getConfigurablePrice(); | |
if (isset($options[$attributeId][$value['value_index']])) { | |
- $productsIndex = $options[$attributeId][$value['value_index']]; | |
+ $productsIndexOptions = $options[$attributeId][$value['value_index']]; | |
+ $productsIndex = array(); | |
+ foreach ($productsIndexOptions as $productIndex) { | |
+ if ($productStock[$productIndex]) { | |
+ $productsIndex[] = $productIndex; | |
+ } | |
+ } | |
} else { | |
$productsIndex = array(); | |
} | |
@@ -300,64 +320,51 @@ class Mage_Catalog_Block_Product_View_Type_Configurable extends Mage_Catalog_Blo | |
/** | |
* Calculation real price | |
* | |
+ * @deprecated | |
* @param float $price | |
* @param bool $isPercent | |
* @return mixed | |
*/ | |
protected function _preparePrice($price, $isPercent = false) | |
{ | |
- if ($isPercent && !empty($price)) { | |
- $price = $this->getProduct()->getFinalPrice() * $price / 100; | |
- } | |
- | |
- return $this->_registerJsPrice($this->_convertPrice($price, true)); | |
+ return $this->_getHelper()->preparePrice($this->getProduct(), $price, $isPercent); | |
} | |
/** | |
* Calculation price before special price | |
* | |
+ * @deprecated | |
* @param float $price | |
* @param bool $isPercent | |
* @return mixed | |
*/ | |
protected function _prepareOldPrice($price, $isPercent = false) | |
{ | |
- if ($isPercent && !empty($price)) { | |
- $price = $this->getProduct()->getPrice() * $price / 100; | |
- } | |
- | |
- return $this->_registerJsPrice($this->_convertPrice($price, true)); | |
+ return $this->_getHelper()->prepareOldPrice($this->getProduct(), $price, $isPercent); | |
} | |
/** | |
* Replace ',' on '.' for js | |
* | |
+ * @deprecated | |
* @param float $price | |
* @return string | |
*/ | |
protected function _registerJsPrice($price) | |
{ | |
- return str_replace(',', '.', $price); | |
+ return $this->_getHelper()->registerJsPrice($price); | |
} | |
/** | |
* Convert price from default currency to current currency | |
* | |
+ * @deprecated | |
* @param float $price | |
* @param boolean $round | |
* @return float | |
*/ | |
protected function _convertPrice($price, $round = false) | |
{ | |
- if (empty($price)) { | |
- return 0; | |
- } | |
- | |
- $price = $this->getCurrentStore()->convertPrice($price); | |
- if ($round) { | |
- $price = $this->getCurrentStore()->roundPrice($price); | |
- } | |
- | |
- return $price; | |
+ return $this->_getHelper()->convertPrice($price, $round); | |
} | |
} | |
diff --git a/app/code/core/Mage/Catalog/Helper/Product.php b/app/code/core/Mage/Catalog/Helper/Product.php | |
index a861e4d..0ac0ec5 100644 | |
--- a/app/code/core/Mage/Catalog/Helper/Product.php | |
+++ b/app/code/core/Mage/Catalog/Helper/Product.php | |
@@ -35,6 +35,8 @@ class Mage_Catalog_Helper_Product extends Mage_Core_Helper_Url | |
const XML_PATH_PRODUCT_URL_USE_CATEGORY = 'catalog/seo/product_use_categories'; | |
const XML_PATH_USE_PRODUCT_CANONICAL_TAG = 'catalog/seo/product_canonical_tag'; | |
+ const DEFAULT_QTY = 1; | |
+ | |
/** | |
* Flag that shows if Magento has to check product to be saleable (enabled and/or inStock) | |
* | |
@@ -485,4 +487,42 @@ class Mage_Catalog_Helper_Product extends Mage_Core_Helper_Url | |
{ | |
return $this->_skipSaleableCheck; | |
} | |
+ | |
+ /** | |
+ * Gets minimal sales quantity | |
+ * | |
+ * @param Mage_Catalog_Model_Product $product | |
+ * @return int|null | |
+ */ | |
+ public function getMinimalQty($product) | |
+ { | |
+ $stockItem = $product->getStockItem(); | |
+ if ($stockItem && $stockItem->getMinSaleQty()) { | |
+ return $stockItem->getMinSaleQty() * 1; | |
+ } | |
+ return null; | |
+ } | |
+ | |
+ /** | |
+ * Get default qty - either as preconfigured, or as 1. | |
+ * Also restricts it by minimal qty. | |
+ * | |
+ * @param Mage_Catalog_Model_Product $product | |
+ * @return int|float | |
+ */ | |
+ public function getDefaultQty($product) | |
+ { | |
+ $qty = $this->getMinimalQty($product); | |
+ $configQty = $product->getPreconfiguredValues()->getQty(); | |
+ | |
+ if ($product->isConfigurable() || $configQty > $qty) { | |
+ $qty = $configQty; | |
+ } | |
+ | |
+ if (is_null($qty)) { | |
+ $qty = self::DEFAULT_QTY; | |
+ } | |
+ | |
+ return $qty; | |
+ } | |
} | |
diff --git a/app/code/core/Mage/Catalog/Helper/Product/Type/Composite.php b/app/code/core/Mage/Catalog/Helper/Product/Type/Composite.php | |
new file mode 100644 | |
index 0000000..19d3e36 | |
--- /dev/null | |
+++ b/app/code/core/Mage/Catalog/Helper/Product/Type/Composite.php | |
@@ -0,0 +1,195 @@ | |
+<?php | |
+/** | |
+ * Magento | |
+ * | |
+ * NOTICE OF LICENSE | |
+ * | |
+ * This source file is subject to the Open Software License (OSL 3.0) | |
+ * that is bundled with this package in the file LICENSE.txt. | |
+ * It is also available through the world-wide-web at this URL: | |
+ * http://opensource.org/licenses/osl-3.0.php | |
+ * If you did not receive a copy of the license and are unable to | |
+ * obtain it through the world-wide-web, please send an email | |
+ * to [email protected] so we can send you a copy immediately. | |
+ * | |
+ * DISCLAIMER | |
+ * | |
+ * Do not edit or add to this file if you wish to upgrade Magento to newer | |
+ * versions in the future. If you wish to customize Magento for your | |
+ * needs please refer to http://www.magento.com for more information. | |
+ * | |
+ * @category Mage | |
+ * @package Mage_Catalog | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
+ */ | |
+ | |
+/** | |
+ * Helper for preparing properties for configurable product | |
+ * | |
+ * @category Mage | |
+ * @package Mage_Catalog | |
+ * @author Magento Core Team <[email protected]> | |
+ */ | |
+class Mage_Catalog_Helper_Product_Type_Composite extends Mage_Core_Helper_Abstract | |
+{ | |
+ /** | |
+ * Calculation real price | |
+ * | |
+ * @param Mage_Catalog_Model_Product $product | |
+ * @param float $price | |
+ * @param bool $isPercent | |
+ * @param null|int $storeId | |
+ * @return mixed | |
+ */ | |
+ public function preparePrice($product, $price, $isPercent = false, $storeId = null) | |
+ { | |
+ if ($isPercent && !empty($price)) { | |
+ $price = $product->getFinalPrice() * $price / 100; | |
+ } | |
+ | |
+ return $this->registerJsPrice($this->convertPrice($price, true, $storeId)); | |
+ } | |
+ | |
+ /** | |
+ * Calculation price before special price | |
+ * | |
+ * @param Mage_Catalog_Model_Product $product | |
+ * @param float $price | |
+ * @param bool $isPercent | |
+ * @param null|int $storeId | |
+ * @return mixed | |
+ */ | |
+ public function prepareOldPrice($product, $price, $isPercent = false, $storeId = null) | |
+ { | |
+ if ($isPercent && !empty($price)) { | |
+ $price = $product->getPrice() * $price / 100; | |
+ } | |
+ | |
+ return $this->registerJsPrice($this->convertPrice($price, true, $storeId)); | |
+ } | |
+ | |
+ /** | |
+ * Replace ',' on '.' for js | |
+ * | |
+ * @param float $price | |
+ * @return string | |
+ */ | |
+ public function registerJsPrice($price) | |
+ { | |
+ return str_replace(',', '.', $price); | |
+ } | |
+ | |
+ /** | |
+ * Convert price from default currency to current currency | |
+ * | |
+ * @param float $price | |
+ * @param boolean $round | |
+ * @param null|int $storeId | |
+ * @return float | |
+ */ | |
+ public function convertPrice($price, $round = false, $storeId = null) | |
+ { | |
+ if (empty($price)) { | |
+ return 0; | |
+ } | |
+ | |
+ $price = $this->getCurrentStore($storeId)->convertPrice($price); | |
+ if ($round) { | |
+ $price = $this->getCurrentStore($storeId)->roundPrice($price); | |
+ } | |
+ | |
+ return $price; | |
+ } | |
+ | |
+ /** | |
+ * Retrieve current store | |
+ * | |
+ * @param null $storeId | |
+ * @return Mage_Core_Model_Store | |
+ */ | |
+ public function getCurrentStore($storeId = null) | |
+ { | |
+ return Mage::app()->getStore($storeId); | |
+ } | |
+ | |
+ /** | |
+ * Prepare general params for product to be used in getJsonConfig() | |
+ * @see Mage_Catalog_Block_Product_View::getJsonConfig() | |
+ * @see Mage_ConfigurableSwatches_Block_Catalog_Product_List_Price::getJsonConfig() | |
+ * | |
+ * @return array | |
+ */ | |
+ public function prepareJsonGeneralConfig() | |
+ { | |
+ return array( | |
+ 'priceFormat' => Mage::app()->getLocale()->getJsPriceFormat(), | |
+ 'includeTax' => Mage::helper('tax')->priceIncludesTax() ? 'true' : 'false', | |
+ 'showIncludeTax' => Mage::helper('tax')->displayPriceIncludingTax(), | |
+ 'showBothPrices' => Mage::helper('tax')->displayBothPrices(), | |
+ 'idSuffix' => '', | |
+ 'oldPlusDisposition' => 0, | |
+ 'plusDisposition' => 0, | |
+ 'plusDispositionTax' => 0, | |
+ 'oldMinusDisposition' => 0, | |
+ 'minusDisposition' => 0, | |
+ ); | |
+ } | |
+ | |
+ | |
+ | |
+ /** | |
+ * Prepare product specific params to be used in getJsonConfig() | |
+ * @see Mage_Catalog_Block_Product_View::getJsonConfig() | |
+ * @see Mage_ConfigurableSwatches_Block_Catalog_Product_List_Price::getJsonConfig() | |
+ * | |
+ * @param Mage_Catalog_Model_Product $product | |
+ * @return array | |
+ */ | |
+ public function prepareJsonProductConfig($product) | |
+ { | |
+ $_request = Mage::getSingleton('tax/calculation')->getDefaultRateRequest(); | |
+ $_request->setProductClassId($product->getTaxClassId()); | |
+ $defaultTax = Mage::getSingleton('tax/calculation')->getRate($_request); | |
+ | |
+ $_request = Mage::getSingleton('tax/calculation')->getRateRequest(); | |
+ $_request->setProductClassId($product->getTaxClassId()); | |
+ $currentTax = Mage::getSingleton('tax/calculation')->getRate($_request); | |
+ | |
+ $_regularPrice = $product->getPrice(); | |
+ $_finalPrice = $product->getFinalPrice(); | |
+ if ($product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_BUNDLE) { | |
+ $_priceInclTax = Mage::helper('tax')->getPrice($product, $_finalPrice, true, | |
+ null, null, null, null, null, false); | |
+ $_priceExclTax = Mage::helper('tax')->getPrice($product, $_finalPrice, false, | |
+ null, null, null, null, null, false); | |
+ } else { | |
+ $_priceInclTax = Mage::helper('tax')->getPrice($product, $_finalPrice, true); | |
+ $_priceExclTax = Mage::helper('tax')->getPrice($product, $_finalPrice); | |
+ } | |
+ $_tierPrices = array(); | |
+ $_tierPricesInclTax = array(); | |
+ foreach ($product->getTierPrice() as $tierPrice) { | |
+ $_tierPrices[] = Mage::helper('core')->currency( | |
+ Mage::helper('tax')->getPrice($product, (float)$tierPrice['website_price'], false) - $_priceExclTax | |
+ , false, false); | |
+ $_tierPricesInclTax[] = Mage::helper('core')->currency( | |
+ Mage::helper('tax')->getPrice($product, (float)$tierPrice['website_price'], true) - $_priceInclTax | |
+ , false, false); | |
+ } | |
+ | |
+ return array( | |
+ 'productId' => $product->getId(), | |
+ 'productPrice' => Mage::helper('core')->currency($_finalPrice, false, false), | |
+ 'productOldPrice' => Mage::helper('core')->currency($_regularPrice, false, false), | |
+ 'priceInclTax' => Mage::helper('core')->currency($_priceInclTax, false, false), | |
+ 'priceExclTax' => Mage::helper('core')->currency($_priceExclTax, false, false), | |
+ 'skipCalculate' => ($_priceExclTax != $_priceInclTax ? 0 : 1), | |
+ 'defaultTax' => $defaultTax, | |
+ 'currentTax' => $currentTax, | |
+ 'tierPrices' => $_tierPrices, | |
+ 'tierPricesInclTax' => $_tierPricesInclTax, | |
+ 'swatchPrices' => $product->getSwatchPrices(), | |
+ ); | |
+ } | |
+} | |
diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice/Abstract.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice/Abstract.php | |
index a696fc9..70fadce 100644 | |
--- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice/Abstract.php | |
+++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice/Abstract.php | |
@@ -227,6 +227,7 @@ abstract class Mage_Catalog_Model_Product_Attribute_Backend_Groupprice_Abstract | |
$data = $this->_getResource()->loadPriceData($object->getId(), $websiteId); | |
foreach ($data as $k => $v) { | |
$data[$k]['website_price'] = $v['price']; | |
+ $data[$k]['is_percent'] = isset($v['is_percent']) ? isset($v['is_percent']) : 0; | |
if ($v['all_groups']) { | |
$data[$k]['cust_group'] = Mage_Customer_Model_Group::CUST_GROUP_ALL; | |
} | |
@@ -318,6 +319,7 @@ abstract class Mage_Catalog_Model_Product_Attribute_Backend_Groupprice_Abstract | |
'all_groups' => $useForAllGroups ? 1 : 0, | |
'customer_group_id' => $customerGroupId, | |
'value' => $data['price'], | |
+ 'is_percent' => isset($data['is_percent']) ? $data['is_percent'] : 0, | |
), $this->_getAdditionalUniqueFields($data)); | |
} | |
@@ -347,10 +349,11 @@ abstract class Mage_Catalog_Model_Product_Attribute_Backend_Groupprice_Abstract | |
if (!empty($update)) { | |
foreach ($update as $k => $v) { | |
- if ($old[$k]['price'] != $v['value']) { | |
+ if ($old[$k]['price'] != $v['value'] || $old[$k]['is_percent'] != $v['is_percent']) { | |
$price = new Varien_Object(array( | |
- 'value_id' => $old[$k]['price_id'], | |
- 'value' => $v['value'] | |
+ 'value_id' => $old[$k]['price_id'], | |
+ 'value' => $v['value'], | |
+ 'is_percent' => $v['is_percent'] | |
)); | |
$this->_getResource()->savePriceData($price); | |
diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php | |
index 5579b01..f7ea86e 100644 | |
--- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php | |
+++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php | |
@@ -643,8 +643,11 @@ class Mage_Catalog_Model_Product_Attribute_Backend_Media extends Mage_Eav_Model_ | |
} catch (Exception $e) { | |
$file = $this->_getConfig()->getMediaPath($file); | |
+ $io = new Varien_Io_File(); | |
Mage::throwException( | |
- Mage::helper('catalog')->__('Failed to copy file %s. Please, delete media with non-existing images and try again.', $file) | |
+ Mage::helper('catalog')->__( | |
+ 'Failed to copy file %s. Please, delete media with non-existing images and try again.', | |
+ $io->getFilteredPath($file)) | |
); | |
} | |
diff --git a/app/code/core/Mage/Catalog/Model/Product/Link/Api/V2.php b/app/code/core/Mage/Catalog/Model/Product/Link/Api/V2.php | |
index 5b59810..eca7486 100644 | |
--- a/app/code/core/Mage/Catalog/Model/Product/Link/Api/V2.php | |
+++ b/app/code/core/Mage/Catalog/Model/Product/Link/Api/V2.php | |
@@ -61,8 +61,8 @@ class Mage_Catalog_Model_Product_Link_Api_V2 extends Mage_Catalog_Model_Product_ | |
$links[(int)$linkedProductId] = array(); | |
foreach ($collection->getLinkModel()->getAttributes() as $attribute) { | |
- if (isset($data->$attribute['code'])) { | |
- $links[(int)$linkedProductId][$attribute['code']] = $data->$attribute['code']; | |
+ if (isset($data->{$attribute['code']})) { | |
+ $links[(int)$linkedProductId][$attribute['code']] = $data->{$attribute['code']}; | |
} | |
} | |
@@ -118,8 +118,8 @@ class Mage_Catalog_Model_Product_Link_Api_V2 extends Mage_Catalog_Model_Product_ | |
} | |
foreach ($collection->getLinkModel()->getAttributes() as $attribute) { | |
- if (isset($data->$attribute['code'])) { | |
- $links[(int)$linkedProductId][$attribute['code']] = $data->$attribute['code']; | |
+ if (isset($data->{$attribute['code']})) { | |
+ $links[(int)$linkedProductId][$attribute['code']] = $data->{$attribute['code']}; | |
} | |
} | |
diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Attribute.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Attribute.php | |
index a7302c9..4586140 100644 | |
--- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Attribute.php | |
+++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Attribute.php | |
@@ -359,7 +359,7 @@ class Mage_Catalog_Model_Resource_Eav_Attribute extends Mage_Eav_Model_Entity_At | |
if ($backendType == 'int' && $frontendInput == 'select') { | |
return true; | |
- } else if ($backendType == 'varchar' && $frontendInput == 'multiselect') { | |
+ } else if (($backendType == 'varchar' || $backendType == 'text') && $frontendInput == 'multiselect') { | |
return true; | |
} else if ($backendType == 'decimal') { | |
return true; | |
diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Groupprice.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Groupprice.php | |
index 0d3c4a1..390c58e 100644 | |
--- a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Groupprice.php | |
+++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Groupprice.php | |
@@ -43,4 +43,17 @@ class Mage_Catalog_Model_Resource_Product_Attribute_Backend_Groupprice | |
{ | |
$this->_init('catalog/product_attribute_group_price', 'value_id'); | |
} | |
+ | |
+ /** | |
+ * Add is_percent column | |
+ * | |
+ * @param array $columns | |
+ * @return array | |
+ */ | |
+ protected function _loadPriceDataColumns($columns) | |
+ { | |
+ $columns = parent::_loadPriceDataColumns($columns); | |
+ $columns['is_percent'] = 'is_percent'; | |
+ return $columns; | |
+ } | |
} | |
diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Source.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Source.php | |
index 64009ac..00c7fdf 100644 | |
--- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Source.php | |
+++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Source.php | |
@@ -61,7 +61,7 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Eav_Source | |
->where($this->_getIndexableAttributesCondition()); | |
if ($multiSelect == true) { | |
- $select->where('ea.backend_type = ?', 'varchar') | |
+ $select->where('ea.backend_type = ?', 'text') | |
->where('ea.frontend_input = ?', 'multiselect'); | |
} else { | |
$select->where('ea.backend_type = ?', 'int') | |
@@ -203,14 +203,14 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Eav_Source | |
$productValueExpression = $adapter->getCheckSql('pvs.value_id > 0', 'pvs.value', 'pvd.value'); | |
$select = $adapter->select() | |
->from( | |
- array('pvd' => $this->getValueTable('catalog/product', 'varchar')), | |
+ array('pvd' => $this->getValueTable('catalog/product', 'text')), | |
array('entity_id', 'attribute_id')) | |
->join( | |
array('cs' => $this->getTable('core/store')), | |
'', | |
array('store_id')) | |
->joinLeft( | |
- array('pvs' => $this->getValueTable('catalog/product', 'varchar')), | |
+ array('pvs' => $this->getValueTable('catalog/product', 'text')), | |
'pvs.entity_id = pvd.entity_id AND pvs.attribute_id = pvd.attribute_id' | |
. ' AND pvs.store_id=cs.store_id', | |
array('value' => $productValueExpression)) | |
diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Link/Product/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Link/Product/Collection.php | |
index d7a353f..fc8350a 100644 | |
--- a/app/code/core/Mage/Catalog/Model/Resource/Product/Link/Product/Collection.php | |
+++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Link/Product/Collection.php | |
@@ -283,6 +283,19 @@ class Mage_Catalog_Model_Resource_Product_Link_Product_Collection extends Mage_C | |
} | |
/** | |
+ * Get table alias for link model attribute | |
+ * | |
+ * @param string $attributeCode | |
+ * @param string $attributeType | |
+ * | |
+ * @return string | |
+ */ | |
+ protected function _getLinkAttributeTableAlias($attributeCode, $attributeType) | |
+ { | |
+ return sprintf('link_attribute_%s_%s', $attributeCode, $attributeType); | |
+ } | |
+ | |
+ /** | |
* Join attributes | |
* | |
* @return Mage_Catalog_Model_Resource_Product_Link_Product_Collection | |
@@ -294,10 +307,9 @@ class Mage_Catalog_Model_Resource_Product_Link_Product_Collection extends Mage_C | |
} | |
$attributes = $this->getLinkModel()->getAttributes(); | |
- $attributesByType = array(); | |
foreach ($attributes as $attribute) { | |
$table = $this->getLinkModel()->getAttributeTypeTable($attribute['type']); | |
- $alias = sprintf('link_attribute_%s_%s', $attribute['code'], $attribute['type']); | |
+ $alias = $this->_getLinkAttributeTableAlias($attribute['code'], $attribute['type']); | |
$joinCondiotion = array( | |
"{$alias}.link_id = links.link_id", | |
@@ -331,4 +343,38 @@ class Mage_Catalog_Model_Resource_Product_Link_Product_Collection extends Mage_C | |
} | |
return parent::setOrder($attribute, $dir); | |
} | |
+ | |
+ /** | |
+ * Add specific link model attribute to collection filter | |
+ * | |
+ * @param string $attributeCode | |
+ * @param array|null $condition | |
+ * | |
+ * @return Mage_Catalog_Model_Resource_Product_Link_Product_Collection | |
+ */ | |
+ public function addLinkModelFieldToFilter($attributeCode, $condition = null) | |
+ { | |
+ if (!$this->getProduct() || !$this->getProduct()->getId()) { | |
+ return $this; | |
+ } | |
+ | |
+ $attribute = null; | |
+ foreach ($this->getLinkModel()->getAttributes() as $attributeData) { | |
+ if ($attributeData['code'] == $attributeCode) { | |
+ $attribute = $attributeData; | |
+ break; | |
+ } | |
+ } | |
+ | |
+ if (!$attribute) { | |
+ return $this; | |
+ } | |
+ | |
+ $this->_hasLinkFilter = true; | |
+ | |
+ $field = $this->_getLinkAttributeTableAlias($attribute['code'], $attribute['type']) . '.value'; | |
+ $this->getSelect()->where($this->_getConditionSql($field, $condition)); | |
+ | |
+ return $this; | |
+ } | |
} | |
diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute/Collection.php | |
index 4ffb021..8807ab8 100644 | |
--- a/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute/Collection.php | |
+++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute/Collection.php | |
@@ -241,7 +241,7 @@ class Mage_Catalog_Model_Resource_Product_Type_Configurable_Attribute_Collection | |
} | |
$values = array(); | |
- | |
+ $sortOrder = 1; | |
foreach ($this->_items as $item) { | |
$productAttribute = $item->getProductAttribute(); | |
if (!($productAttribute instanceof Mage_Eav_Model_Entity_Attribute_Abstract)) { | |
@@ -251,7 +251,7 @@ class Mage_Catalog_Model_Resource_Product_Type_Configurable_Attribute_Collection | |
$optionsByValue = array(); | |
foreach ($options as $option) { | |
- $optionsByValue[$option['value']] = $option['label']; | |
+ $optionsByValue[$option['value']] = array('label' => $option['label'], 'order' => $sortOrder++); | |
} | |
foreach ($this->getProduct()->getTypeInstance(true) | |
@@ -267,18 +267,23 @@ class Mage_Catalog_Model_Resource_Product_Type_Configurable_Attribute_Collection | |
$values[$item->getId() . ':' . $optionValue] = array( | |
'product_super_attribute_id' => $item->getId(), | |
'value_index' => $optionValue, | |
- 'label' => $optionsByValue[$optionValue], | |
- 'default_label' => $optionsByValue[$optionValue], | |
- 'store_label' => $optionsByValue[$optionValue], | |
+ 'label' => $optionsByValue[$optionValue]['label'], | |
+ 'default_label' => $optionsByValue[$optionValue]['label'], | |
+ 'store_label' => $optionsByValue[$optionValue]['label'], | |
'is_percent' => 0, | |
'pricing_value' => null, | |
- 'use_default_value' => true | |
+ 'use_default_value' => true, | |
+ 'order' => $optionsByValue[$optionValue]['order'] | |
); | |
} | |
} | |
} | |
} | |
+ uasort($values, function($a, $b) { | |
+ return $a['order'] - $b['order']; | |
+ }); | |
+ | |
foreach ($pricings[0] as $pricing) { | |
// Addding pricing to options | |
$valueKey = $pricing['product_super_attribute_id'] . ':' . $pricing['value_index']; | |
diff --git a/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.19.1.3-1.6.0.0.19.1.4.php b/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.19.1.3-1.6.0.0.19.1.4.php | |
new file mode 100644 | |
index 0000000..f9aa8a3 | |
--- /dev/null | |
+++ b/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.19.1.3-1.6.0.0.19.1.4.php | |
@@ -0,0 +1,77 @@ | |
+<?php | |
+/** | |
+ * Magento | |
+ * | |
+ * NOTICE OF LICENSE | |
+ * | |
+ * This source file is subject to the Open Software License (OSL 3.0) | |
+ * that is bundled with this package in the file LICENSE.txt. | |
+ * It is also available through the world-wide-web at this URL: | |
+ * http://opensource.org/licenses/osl-3.0.php | |
+ * If you did not receive a copy of the license and are unable to | |
+ * obtain it through the world-wide-web, please send an email | |
+ * to [email protected] so we can send you a copy immediately. | |
+ * | |
+ * DISCLAIMER | |
+ * | |
+ * Do not edit or add to this file if you wish to upgrade Magento to newer | |
+ * versions in the future. If you wish to customize Magento for your | |
+ * needs please refer to http://www.magento.com for more information. | |
+ * | |
+ * @category Mage | |
+ * @package Mage_Catalog | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
+ */ | |
+/** @var $installer Mage_Catalog_Model_Resource_Setup */ | |
+ | |
+$installer = $this; | |
+$installer->startSetup(); | |
+$connection = $installer->getConnection(); | |
+ | |
+$catalogProductEntityTypeId = Mage::getSingleton('eav/config')->getEntityType('catalog_product')->getEntityTypeId(); | |
+ | |
+$attributes = Mage::getResourceModel('eav/entity_attribute_collection') | |
+ ->addFieldToFilter('frontend_input', 'multiselect') | |
+ ->addFieldToFilter('entity_type_id', $catalogProductEntityTypeId) | |
+ ->getItems(); | |
+ | |
+foreach ($attributes as $attribute) { | |
+ $entityTypeId = $attribute->getEntityTypeId(); | |
+ $attributeId = $attribute->getId(); | |
+ $attributeTableOld = $installer->getAttributeTable($entityTypeId, $attributeId); | |
+ | |
+ $installer->updateAttribute($entityTypeId, $attributeId, 'backend_type', 'text'); | |
+ | |
+ $attributeTableNew = $installer->getAttributeTable($entityTypeId, $attributeId); | |
+ | |
+ if ($attributeTableOld != $attributeTableNew) { | |
+ $connection->disableTableKeys($attributeTableOld) | |
+ ->disableTableKeys($attributeTableNew); | |
+ | |
+ $select = $connection->select() | |
+ ->from($attributeTableOld, array('entity_type_id', 'attribute_id', 'store_id', 'entity_id', 'value')) | |
+ ->where('entity_type_id = ?', $entityTypeId) | |
+ ->where('attribute_id = ?', $attributeId); | |
+ | |
+ $query = $select->insertFromSelect($attributeTableNew, | |
+ array('entity_type_id', 'attribute_id', 'store_id', 'entity_id', 'value') | |
+ ); | |
+ | |
+ $connection->query($query); | |
+ | |
+ $connection->delete($attributeTableOld, | |
+ $connection->quoteInto('entity_type_id = ?', $entityTypeId) | |
+ . $connection->quoteInto(' AND attribute_id = ?', $attributeId) | |
+ ); | |
+ | |
+ $connection->enableTableKeys($attributeTableOld) | |
+ ->enableTableKeys($attributeTableNew); | |
+ } | |
+} | |
+ | |
+Mage::getModel('index/indexer') | |
+ ->getProcessByCode(Mage_Catalog_Helper_Product_Flat::CATALOG_FLAT_PROCESS_CODE) | |
+ ->changeStatus(Mage_Index_Model_Process::STATUS_REQUIRE_REINDEX); | |
+ | |
+$installer->endSetup(); | |
diff --git a/app/code/core/Mage/Catalog/etc/config.xml b/app/code/core/Mage/Catalog/etc/config.xml | |
index 0d8825c..779422f 100644 | |
--- a/app/code/core/Mage/Catalog/etc/config.xml | |
+++ b/app/code/core/Mage/Catalog/etc/config.xml | |
@@ -28,7 +28,7 @@ | |
<config> | |
<modules> | |
<Mage_Catalog> | |
- <version>1.6.0.0.19.1.2</version> | |
+ <version>1.6.0.0.19.1.5</version> | |
</Mage_Catalog> | |
</modules> | |
<admin> | |
diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.19.1.2-1.6.0.0.19.1.3.php b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.19.1.2-1.6.0.0.19.1.3.php | |
new file mode 100644 | |
index 0000000..5a4acc3 | |
--- /dev/null | |
+++ b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.19.1.2-1.6.0.0.19.1.3.php | |
@@ -0,0 +1,44 @@ | |
+<?php | |
+/** | |
+ * Magento | |
+ * | |
+ * NOTICE OF LICENSE | |
+ * | |
+ * This source file is subject to the Open Software License (OSL 3.0) | |
+ * that is bundled with this package in the file LICENSE.txt. | |
+ * It is also available through the world-wide-web at this URL: | |
+ * http://opensource.org/licenses/osl-3.0.php | |
+ * If you did not receive a copy of the license and are unable to | |
+ * obtain it through the world-wide-web, please send an email | |
+ * to [email protected] so we can send you a copy immediately. | |
+ * | |
+ * DISCLAIMER | |
+ * | |
+ * Do not edit or add to this file if you wish to upgrade Magento to newer | |
+ * versions in the future. If you wish to customize Magento for your | |
+ * needs please refer to http://www.magento.com for more information. | |
+ * | |
+ * @category Mage | |
+ * @package Mage_Catalog | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
+ */ | |
+ | |
+$installer = $this; | |
+/** @var $installer Mage_Catalog_Model_Resource_Setup */ | |
+ | |
+$attribute = 'special_price'; | |
+$installer | |
+ ->updateAttribute( | |
+ Mage_Catalog_Model_Product::ENTITY, | |
+ 'special_price', | |
+ 'note', | |
+ NULL | |
+ ) | |
+ ->updateAttribute( | |
+ Mage_Catalog_Model_Product::ENTITY, | |
+ 'special_price', | |
+ 'frontend_class', | |
+ 'validate-special-price' | |
+ ) | |
+; | |
diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.19.1.4-1.6.0.0.19.1.5.php b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.19.1.4-1.6.0.0.19.1.5.php | |
new file mode 100644 | |
index 0000000..56d90de | |
--- /dev/null | |
+++ b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.19.1.4-1.6.0.0.19.1.5.php | |
@@ -0,0 +1,37 @@ | |
+<?php | |
+/** | |
+ * Magento | |
+ * | |
+ * NOTICE OF LICENSE | |
+ * | |
+ * This source file is subject to the Open Software License (OSL 3.0) | |
+ * that is bundled with this package in the file LICENSE.txt. | |
+ * It is also available through the world-wide-web at this URL: | |
+ * http://opensource.org/licenses/osl-3.0.php | |
+ * If you did not receive a copy of the license and are unable to | |
+ * obtain it through the world-wide-web, please send an email | |
+ * to [email protected] so we can send you a copy immediately. | |
+ * | |
+ * DISCLAIMER | |
+ * | |
+ * Do not edit or add to this file if you wish to upgrade Magento to newer | |
+ * versions in the future. If you wish to customize Magento for your | |
+ * needs please refer to http://www.magento.com for more information. | |
+ * | |
+ * @category Mage | |
+ * @package Mage_Catalog | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
+ */ | |
+ | |
+/** @var $installer Mage_Catalog_Model_Resource_Setup */ | |
+$installer = $this; | |
+$connection = $installer->getConnection(); | |
+ | |
+$connection->addColumn($installer->getTable('catalog/product_attribute_group_price'), 'is_percent', array( | |
+ 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, | |
+ 'unsigned' => true, | |
+ 'nullable' => false, | |
+ 'default' => '0', | |
+ 'comment' => 'Is Percent', | |
+)); | |
diff --git a/app/code/core/Mage/CatalogInventory/Model/Observer.php b/app/code/core/Mage/CatalogInventory/Model/Observer.php | |
index 18c5a19..ae4a7f9 100644 | |
--- a/app/code/core/Mage/CatalogInventory/Model/Observer.php | |
+++ b/app/code/core/Mage/CatalogInventory/Model/Observer.php | |
@@ -384,6 +384,7 @@ class Mage_CatalogInventory_Model_Observer | |
$stockItem = $option->getProduct()->getStockItem(); | |
if ($quoteItem->getProductType() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) { | |
+ $stockItem->setParentItem($quoteItem); | |
$stockItem->setProductName($quoteItem->getName()); | |
} | |
diff --git a/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php b/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php | |
index e186eec..d964430 100644 | |
--- a/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php | |
+++ b/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php | |
@@ -526,6 +526,27 @@ class Mage_CatalogInventory_Model_Stock_Item extends Mage_Core_Model_Abstract | |
} | |
/** | |
+ * Check if child product assigned to parent | |
+ */ | |
+ $parentItem = $this->getParentItem(); | |
+ if ($this->getIsChildItem() && !empty($parentItem)) { | |
+ $typeInstance = $parentItem->getProduct()->getTypeInstance(true); | |
+ $requiredChildrenIds = $typeInstance->getChildrenIds($parentItem->getProductId(), true); | |
+ $childrenIds = array(); | |
+ foreach ($requiredChildrenIds as $groupedChildrenIds) { | |
+ $childrenIds = array_merge($childrenIds, $groupedChildrenIds); | |
+ } | |
+ if (!in_array($this->getProductId(), $childrenIds)) { | |
+ $result->setHasError(true) | |
+ ->setMessage(Mage::helper('cataloginventory') | |
+ ->__('This product with current option is not available')) | |
+ ->setQuoteMessage(Mage::helper('cataloginventory')->__('Some of the products are not available')) | |
+ ->setQuoteMessageIndex('stock'); | |
+ return $result; | |
+ } | |
+ } | |
+ | |
+ /** | |
* Check quantity type | |
*/ | |
$result->setItemIsQtyDecimal($this->getIsQtyDecimal()); | |
diff --git a/app/code/core/Mage/CatalogRule/Model/Action/Index/Refresh.php b/app/code/core/Mage/CatalogRule/Model/Action/Index/Refresh.php | |
index b2d938e..eaea7e9 100644 | |
--- a/app/code/core/Mage/CatalogRule/Model/Action/Index/Refresh.php | |
+++ b/app/code/core/Mage/CatalogRule/Model/Action/Index/Refresh.php | |
@@ -319,8 +319,16 @@ class Mage_CatalogRule_Model_Action_Index_Refresh | |
); | |
$priceColumn = $this->_connection->getIfNullSql( | |
$this->_connection->getIfNullSql( | |
- 'pg.value', | |
- 'pgd.value' | |
+ $this->_connection->getCheckSql( | |
+ 'pg.is_percent = 1', | |
+ 'p.price * (100 - pg.value)/100', | |
+ 'pg.value' | |
+ ), | |
+ $this->_connection->getCheckSql( | |
+ 'pgd.is_percent = 1', | |
+ 'p.price * (100 - pgd.value)/100', | |
+ 'pgd.value' | |
+ ) | |
), | |
'p.price' | |
); | |
@@ -343,8 +351,22 @@ class Mage_CatalogRule_Model_Action_Index_Refresh | |
); | |
$priceColumn = $this->_connection->getIfNullSql( | |
$this->_connection->getIfNullSql( | |
- 'pg.value', | |
- 'pgd.value' | |
+ $this->_connection->getCheckSql( | |
+ 'pg.is_percent = 1', | |
+ $this->_connection->getIfNullSql( | |
+ 'p.value', | |
+ 'pd.value' | |
+ ) . ' * (100 - pg.value)/100', | |
+ 'pg.value' | |
+ ), | |
+ $this->_connection->getCheckSql( | |
+ 'pgd.is_percent = 1', | |
+ $this->_connection->getIfNullSql( | |
+ 'p.value', | |
+ 'pd.value' | |
+ ) . ' * (100 - pgd.value)/100', | |
+ 'pgd.value' | |
+ ) | |
), | |
$this->_connection->getIfNullSql( | |
'p.value', | |
diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Advanced.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Advanced.php | |
index 6f04dbf..9680e42 100644 | |
--- a/app/code/core/Mage/CatalogSearch/Model/Resource/Advanced.php | |
+++ b/app/code/core/Mage/CatalogSearch/Model/Resource/Advanced.php | |
@@ -84,7 +84,7 @@ class Mage_CatalogSearch_Model_Resource_Advanced extends Mage_Core_Model_Resourc | |
if (is_array($value)) { | |
if (!empty($value['from']) || !empty($value['to'])) { // range | |
$condition = $value; | |
- } else if ($attribute->getBackendType() == 'varchar') { // multiselect | |
+ } else if (in_array($attribute->getBackendType(), array('varchar', 'text'))) { // multiselect | |
$condition = array('in_set' => $value); | |
} else if (!isset($value['from']) && !isset($value['to'])) { // select | |
$condition = array('in' => $value); | |
diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php | |
index 0c46266..20e9ffc 100644 | |
--- a/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php | |
+++ b/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php | |
@@ -77,9 +77,10 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc | |
*/ | |
protected $_allowTableChanges = true; | |
- | |
- | |
- | |
+ /** | |
+ * @var array | |
+ */ | |
+ protected $_foundData = array(); | |
/** | |
* Init resource model | |
@@ -298,12 +299,7 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc | |
*/ | |
public function resetSearchResults() | |
{ | |
- $adapter = $this->_getWriteAdapter(); | |
- $adapter->update($this->getTable('catalogsearch/search_query'), array('is_processed' => 0)); | |
- $adapter->delete($this->getTable('catalogsearch/result')); | |
- | |
Mage::dispatchEvent('catalogsearch_reset_search_result'); | |
- | |
return $this; | |
} | |
@@ -334,39 +330,38 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc | |
public function prepareResult($object, $queryText, $query) | |
{ | |
$adapter = $this->_getWriteAdapter(); | |
- if (!$query->getIsProcessed()) { | |
- $searchType = $object->getSearchType($query->getStoreId()); | |
- | |
- $preparedTerms = Mage::getResourceHelper('catalogsearch') | |
- ->prepareTerms($queryText, $query->getMaxQueryWords()); | |
+ $searchType = $object->getSearchType($query->getStoreId()); | |
+ | |
+ $preparedTerms = Mage::getResourceHelper('catalogsearch') | |
+ ->prepareTerms($queryText, $query->getMaxQueryWords()); | |
+ | |
+ $bind = array(); | |
+ $like = array(); | |
+ $likeCond = ''; | |
+ if ($searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_LIKE | |
+ || $searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_COMBINE | |
+ ) { | |
+ $helper = Mage::getResourceHelper('core'); | |
+ $words = Mage::helper('core/string')->splitWords($queryText, true, $query->getMaxQueryWords()); | |
+ foreach ($words as $word) { | |
+ $like[] = $helper->getCILike('s.data_index', $word, array('position' => 'any')); | |
+ } | |
- $bind = array(); | |
- $like = array(); | |
- $likeCond = ''; | |
- if ($searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_LIKE | |
- || $searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_COMBINE | |
- ) { | |
- $helper = Mage::getResourceHelper('core'); | |
- $words = Mage::helper('core/string')->splitWords($queryText, true, $query->getMaxQueryWords()); | |
- foreach ($words as $word) { | |
- $like[] = $helper->getCILike('s.data_index', $word, array('position' => 'any')); | |
- } | |
- if ($like) { | |
- $likeCond = '(' . join(' OR ', $like) . ')'; | |
- } | |
+ if ($like) { | |
+ $likeCond = '(' . join(' OR ', $like) . ')'; | |
} | |
+ | |
$mainTableAlias = 's'; | |
- $fields = array( | |
- 'query_id' => new Zend_Db_Expr($query->getId()), | |
- 'product_id', | |
- ); | |
+ $fields = array('product_id'); | |
+ | |
$select = $adapter->select() | |
->from(array($mainTableAlias => $this->getMainTable()), $fields) | |
->joinInner(array('e' => $this->getTable('catalog/product')), | |
'e.entity_id = s.product_id', | |
array()) | |
- ->where($mainTableAlias.'.store_id = ?', (int)$query->getStoreId()); | |
+ ->where($mainTableAlias . '.store_id = ?', (int)$query->getStoreId()); | |
+ $where = ""; | |
if ($searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_FULLTEXT | |
|| $searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_COMBINE | |
) { | |
@@ -374,11 +369,10 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc | |
$where = Mage::getResourceHelper('catalogsearch') | |
->chooseFulltext($this->getMainTable(), $mainTableAlias, $select); | |
} | |
- | |
if ($likeCond != '' && $searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_COMBINE) { | |
- $where .= ($where ? ' OR ' : '') . $likeCond; | |
+ $where .= ($where ? ' OR ' : '') . $likeCond; | |
} elseif ($likeCond != '' && $searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_LIKE) { | |
- $select->columns(array('relevance' => new Zend_Db_Expr(0))); | |
+ $select->columns(array('relevance' => new Zend_Db_Expr(0))); | |
$where = $likeCond; | |
} | |
@@ -386,19 +380,23 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc | |
$select->where($where); | |
} | |
- $sql = $adapter->insertFromSelect($select, | |
- $this->getTable('catalogsearch/result'), | |
- array(), | |
- Varien_Db_Adapter_Interface::INSERT_ON_DUPLICATE); | |
- $adapter->query($sql, $bind); | |
- | |
- $query->setIsProcessed(1); | |
+ $this->_foundData = $adapter->fetchPairs($select, $bind); | |
} | |
return $this; | |
} | |
/** | |
+ * Retrieve found data | |
+ * | |
+ * @return array | |
+ */ | |
+ public function getFoundData() | |
+ { | |
+ return $this->_foundData; | |
+ } | |
+ | |
+ /** | |
* Retrieve EAV Config Singleton | |
* | |
* @return Mage_Eav_Model_Config | |
diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext/Collection.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext/Collection.php | |
index 23d5e81..bb364f2 100644 | |
--- a/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext/Collection.php | |
+++ b/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext/Collection.php | |
@@ -35,6 +35,39 @@ | |
class Mage_CatalogSearch_Model_Resource_Fulltext_Collection extends Mage_Catalog_Model_Resource_Product_Collection | |
{ | |
/** | |
+ * Name for relevance order | |
+ */ | |
+ const RELEVANCE_ORDER_NAME = 'relevance'; | |
+ | |
+ /** | |
+ * Found data | |
+ * | |
+ * @var array | |
+ */ | |
+ protected $_foundData = null; | |
+ | |
+ /** | |
+ * Sort order by relevance | |
+ * | |
+ * @var null | |
+ */ | |
+ protected $_relevanceSortOrder = SORT_DESC; | |
+ | |
+ /** | |
+ * Sort by relevance flag | |
+ * | |
+ * @var bool | |
+ */ | |
+ protected $_sortByRelevance = false; | |
+ | |
+ /** | |
+ * Is search filter applied flag | |
+ * | |
+ * @var bool | |
+ */ | |
+ protected $_isSearchFiltersApplied = false; | |
+ | |
+ /** | |
* Retrieve query model object | |
* | |
* @return Mage_CatalogSearch_Model_Query | |
@@ -47,22 +80,101 @@ class Mage_CatalogSearch_Model_Resource_Fulltext_Collection extends Mage_Catalog | |
/** | |
* Add search query filter | |
* | |
- * @param string $query | |
+ * @param $query | |
* @return Mage_CatalogSearch_Model_Resource_Fulltext_Collection | |
*/ | |
public function addSearchFilter($query) | |
{ | |
- Mage::getSingleton('catalogsearch/fulltext')->prepareResult(); | |
- | |
- $this->getSelect()->joinInner( | |
- array('search_result' => $this->getTable('catalogsearch/result')), | |
- $this->getConnection()->quoteInto( | |
- 'search_result.product_id=e.entity_id AND search_result.query_id=?', | |
- $this->_getQuery()->getId() | |
- ), | |
- array('relevance' => 'relevance') | |
- ); | |
+ return $this; | |
+ } | |
+ /** | |
+ * Before load handler | |
+ * | |
+ * @return Mage_Catalog_Model_Resource_Product_Collection | |
+ */ | |
+ protected function _beforeLoad() | |
+ { | |
+ if (!$this->_isSearchFiltersApplied) { | |
+ $this->_applySearchFilters(); | |
+ } | |
+ | |
+ return parent::_beforeLoad(); | |
+ } | |
+ | |
+ /** | |
+ * Get collection size | |
+ * | |
+ * @return int | |
+ */ | |
+ public function getSize() | |
+ { | |
+ if (!$this->_isSearchFiltersApplied) { | |
+ $this->_applySearchFilters(); | |
+ } | |
+ | |
+ return parent::getSize(); | |
+ } | |
+ | |
+ /** | |
+ * Apply collection search filter | |
+ * | |
+ * @return Mage_CatalogSearch_Model_Resource_Fulltext_Collection | |
+ */ | |
+ protected function _applySearchFilters() | |
+ { | |
+ $foundIds = $this->getFoundIds(); | |
+ if (!empty($foundIds)) { | |
+ $this->addIdFilter($foundIds); | |
+ } else { | |
+ $this->getSelect()->orWhere('FALSE'); | |
+ } | |
+ $this->_isSearchFiltersApplied = true; | |
+ | |
+ return $this; | |
+ } | |
+ | |
+ /** | |
+ * Get found products ids | |
+ * | |
+ * @return array | |
+ */ | |
+ public function getFoundIds() | |
+ { | |
+ if (is_null($this->_foundData)) { | |
+ /** @var Mage_CatalogSearch_Model_Fulltext $preparedResult */ | |
+ $preparedResult = Mage::getSingleton('catalogsearch/fulltext'); | |
+ $preparedResult->prepareResult(); | |
+ $this->_foundData = $preparedResult->getResource()->getFoundData(); | |
+ } | |
+ if (isset($this->_orders[self::RELEVANCE_ORDER_NAME])) { | |
+ $this->_resortFoundDataByRelevance(); | |
+ } | |
+ return array_keys($this->_foundData); | |
+ } | |
+ | |
+ /** | |
+ * Resort found data by relevance | |
+ * | |
+ * @return Mage_CatalogSearch_Model_Resource_Fulltext_Collection | |
+ */ | |
+ protected function _resortFoundDataByRelevance() | |
+ { | |
+ if (is_array($this->_foundData)) { | |
+ $data = array(); | |
+ foreach ($this->_foundData as $id => $relevance) { | |
+ $this->_foundData[$id] = $relevance . '_' . $id; | |
+ } | |
+ natsort($this->_foundData); | |
+ if ($this->_relevanceSortOrder == SORT_DESC) { | |
+ $this->_foundData = array_reverse($this->_foundData); | |
+ } | |
+ foreach ($this->_foundData as $dataString) { | |
+ list ($relevance, $id) = explode('_', $dataString); | |
+ $data[$id] = $relevance; | |
+ } | |
+ $this->_foundData = $data; | |
+ } | |
return $this; | |
} | |
@@ -76,7 +188,8 @@ class Mage_CatalogSearch_Model_Resource_Fulltext_Collection extends Mage_Catalog | |
public function setOrder($attribute, $dir = 'desc') | |
{ | |
if ($attribute == 'relevance') { | |
- $this->getSelect()->order("relevance {$dir}"); | |
+ $this->_relevanceSortOrder = ($dir == 'asc') ? SORT_ASC : SORT_DESC; | |
+ $this->addOrder(self::RELEVANCE_ORDER_NAME); | |
} else { | |
parent::setOrder($attribute, $dir); | |
} | |
@@ -84,7 +197,34 @@ class Mage_CatalogSearch_Model_Resource_Fulltext_Collection extends Mage_Catalog | |
} | |
/** | |
- * Stub method for campatibility with other search engines | |
+ * Add sorting by relevance to select | |
+ * | |
+ * @return Mage_CatalogSearch_Model_Resource_Fulltext_Collection | |
+ */ | |
+ protected function _addRelevanceSorting() | |
+ { | |
+ $foundIds = $this->getFoundIds(); | |
+ if (!$foundIds) { | |
+ return $this; | |
+ } | |
+ | |
+ /** @var Mage_CatalogSearch_Model_Resource_Helper_Mysql4 $resourceHelper */ | |
+ $resourceHelper = Mage::getResourceHelper('catalogsearch'); | |
+ $this->_select->order( | |
+ new Zend_Db_Expr( | |
+ $resourceHelper->getFieldOrderExpression( | |
+ 'e.' . $this->getResource()->getIdFieldName(), | |
+ $foundIds | |
+ ) | |
+ . ' ' . Zend_Db_Select::SQL_ASC | |
+ ) | |
+ ); | |
+ | |
+ return $this; | |
+ } | |
+ | |
+ /** | |
+ * Stub method for compatibility with other search engines | |
* | |
* @return Mage_CatalogSearch_Model_Resource_Fulltext_Collection | |
*/ | |
@@ -92,4 +232,24 @@ class Mage_CatalogSearch_Model_Resource_Fulltext_Collection extends Mage_Catalog | |
{ | |
return $this; | |
} | |
+ | |
+ /** | |
+ * Render sql select orders | |
+ * | |
+ * @return Varien_Data_Collection_Db | |
+ */ | |
+ protected function _renderOrders() | |
+ { | |
+ if (!$this->_isOrdersRendered) { | |
+ foreach ($this->_orders as $attribute => $direction) { | |
+ if ($attribute == self::RELEVANCE_ORDER_NAME) { | |
+ $this->_addRelevanceSorting(); | |
+ } else { | |
+ $this->addAttributeToSort($attribute, $direction); | |
+ } | |
+ } | |
+ $this->_isOrdersRendered = true; | |
+ } | |
+ return $this; | |
+ } | |
} | |
diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Helper/Mysql4.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Helper/Mysql4.php | |
index 02f7324..0ca1cc4 100644 | |
--- a/app/code/core/Mage/CatalogSearch/Model/Resource/Helper/Mysql4.php | |
+++ b/app/code/core/Mage/CatalogSearch/Model/Resource/Helper/Mysql4.php | |
@@ -52,6 +52,7 @@ class Mage_CatalogSearch_Model_Resource_Helper_Mysql4 extends Mage_Eav_Model_Res | |
* Prepare Terms | |
* | |
* @param string $str The source string | |
+ * @param int $maxWordLength | |
* @return array(0=>words, 1=>terms) | |
*/ | |
function prepareTerms($str, $maxWordLength = 0) | |
@@ -112,10 +113,24 @@ class Mage_CatalogSearch_Model_Resource_Helper_Mysql4 extends Mage_Eav_Model_Res | |
* | |
* @param mixed $table The table to insert data into. | |
* @param array $data Column-value pairs or array of column-value pairs. | |
- * @param arrat $fields update fields pairs or values | |
+ * @param array $fields update fields pairs or values | |
* @return int The number of affected rows. | |
*/ | |
public function insertOnDuplicate($table, array $data, array $fields = array()) { | |
return $this->_getWriteAdapter()->insertOnDuplicate($table, $data, $fields); | |
} | |
+ | |
+ /** | |
+ * Get field expression for order by | |
+ * | |
+ * @param string $fieldName | |
+ * @param array $orderedIds | |
+ * | |
+ * @return string | |
+ */ | |
+ public function getFieldOrderExpression($fieldName, array $orderedIds) | |
+ { | |
+ $fieldName = $this->_getWriteAdapter()->quoteIdentifier($fieldName); | |
+ return "FIELD({$fieldName}, {$this->_getReadAdapter()->quote($orderedIds)})"; | |
+ } | |
} | |
diff --git a/app/code/core/Mage/Centinel/Model/Api/Client.php b/app/code/core/Mage/Centinel/Model/Api/Client.php | |
index e91a482..4493ad3 100644 | |
--- a/app/code/core/Mage/Centinel/Model/Api/Client.php | |
+++ b/app/code/core/Mage/Centinel/Model/Api/Client.php | |
@@ -20,7 +20,7 @@ | |
* | |
* @category Mage | |
* @package Mage_Centinel | |
- * @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
*/ | |
diff --git a/app/code/core/Mage/Checkout/Model/Cart.php b/app/code/core/Mage/Checkout/Model/Cart.php | |
index 49154f0..186078a 100644 | |
--- a/app/code/core/Mage/Checkout/Model/Cart.php | |
+++ b/app/code/core/Mage/Checkout/Model/Cart.php | |
@@ -229,10 +229,6 @@ class Mage_Checkout_Model_Cart extends Varien_Object implements Mage_Checkout_Mo | |
$request = new Varien_Object($requestInfo); | |
} | |
- if (!$request->hasQty()) { | |
- $request->setQty(1); | |
- } | |
- | |
return $request; | |
} | |
@@ -248,14 +244,21 @@ class Mage_Checkout_Model_Cart extends Varien_Object implements Mage_Checkout_Mo | |
$product = $this->_getProduct($productInfo); | |
$request = $this->_getProductRequest($requestInfo); | |
+ /** @var Mage_Catalog_Helper_Product $helper */ | |
+ $helper = Mage::helper('catalog/product'); | |
+ | |
+ if (!$request->hasQty()) { | |
+ $request->setQty($helper->getDefaultQty($product)); | |
+ } | |
+ | |
$productId = $product->getId(); | |
- if ($product->getStockItem()) { | |
+ if (!$product->isConfigurable() && $product->getStockItem()) { | |
$minimumQty = $product->getStockItem()->getMinSaleQty(); | |
//If product was not found in cart and there is set minimal qty for it | |
if ($minimumQty && $minimumQty > 0 && $request->getQty() < $minimumQty | |
&& !$this->getQuote()->hasProductId($productId) | |
- ){ | |
+ ) { | |
$request->setQty($minimumQty); | |
} | |
} | |
diff --git a/app/code/core/Mage/Checkout/Model/Type/Multishipping.php b/app/code/core/Mage/Checkout/Model/Type/Multishipping.php | |
index 29f0edc..a682c76 100644 | |
--- a/app/code/core/Mage/Checkout/Model/Type/Multishipping.php | |
+++ b/app/code/core/Mage/Checkout/Model/Type/Multishipping.php | |
@@ -308,6 +308,9 @@ class Mage_Checkout_Model_Type_Multishipping extends Mage_Checkout_Model_Type_Ab | |
if (!$quoteAddress = $this->getQuote()->getShippingAddressByCustomerAddressId($address->getId())) { | |
$quoteAddress = Mage::getModel('sales/quote_address')->importCustomerAddress($address); | |
$this->getQuote()->addShippingAddress($quoteAddress); | |
+ if ($couponCode = $this->getCheckoutSession()->getCartCouponCode()) { | |
+ $this->getQuote()->setCouponCode($couponCode); | |
+ } | |
} | |
$quoteAddress = $this->getQuote()->getShippingAddressByCustomerAddressId($address->getId()); | |
diff --git a/app/code/core/Mage/Checkout/Model/Type/Onepage.php b/app/code/core/Mage/Checkout/Model/Type/Onepage.php | |
index d673dc0..5cc305d 100644 | |
--- a/app/code/core/Mage/Checkout/Model/Type/Onepage.php | |
+++ b/app/code/core/Mage/Checkout/Model/Type/Onepage.php | |
@@ -362,6 +362,7 @@ class Mage_Checkout_Model_Type_Onepage | |
->setShippingMethod($shippingMethod) | |
->setCollectShippingRates(true); | |
$this->getCheckout()->setStepData('shipping', 'complete', true); | |
+ $this->_setCartCouponCode(); | |
break; | |
} | |
} | |
@@ -592,6 +593,8 @@ class Mage_Checkout_Model_Type_Onepage | |
return array('error' => 1, 'message' => $validateRes); | |
} | |
+ $this->_setCartCouponCode(); | |
+ | |
$this->getQuote()->collectTotals()->save(); | |
$this->getCheckout() | |
@@ -946,4 +949,17 @@ class Mage_Checkout_Model_Type_Onepage | |
} | |
return $orderId; | |
} | |
+ | |
+ /** | |
+ * Sets cart coupon code from checkout to quote | |
+ * | |
+ * @return $this | |
+ */ | |
+ protected function _setCartCouponCode() | |
+ { | |
+ if ($couponCode = $this->getCheckout()->getCartCouponCode()) { | |
+ $this->getQuote()->setCouponCode($couponCode); | |
+ } | |
+ return $this; | |
+ } | |
} | |
diff --git a/app/code/core/Mage/Checkout/controllers/CartController.php b/app/code/core/Mage/Checkout/controllers/CartController.php | |
index 2aa0e09..5b07975 100644 | |
--- a/app/code/core/Mage/Checkout/controllers/CartController.php | |
+++ b/app/code/core/Mage/Checkout/controllers/CartController.php | |
@@ -89,7 +89,10 @@ class Mage_Checkout_CartController extends Mage_Core_Controller_Front_Action | |
) { | |
$this->getResponse()->setRedirect($backUrl); | |
} else { | |
- if ((strtolower($this->getRequest()->getActionName()) == 'add') && !$this->getRequest()->getParam('in_cart')) { | |
+ if ( | |
+ (strtolower($this->getRequest()->getActionName()) == 'add') | |
+ && !$this->getRequest()->getParam('in_cart') | |
+ ) { | |
$this->_getSession()->setContinueShoppingUrl($this->_getRefererUrl()); | |
} | |
$this->_redirect('checkout/cart'); | |
@@ -141,6 +144,20 @@ class Mage_Checkout_CartController extends Mage_Core_Controller_Front_Action | |
$cart = $this->_getCart(); | |
if ($cart->getQuote()->getItemsCount()) { | |
$cart->init(); | |
+ if ( | |
+ $cart->getQuote()->getShippingAddress() | |
+ && $this->_getSession()->getEstimatedShippingAddressData() | |
+ && $couponCode = $this->_getSession()->getCartCouponCode() | |
+ ) { | |
+ $estimatedSessionAddressData = $this->_getSession()->getEstimatedShippingAddressData(); | |
+ $cart->getQuote()->getShippingAddress() | |
+ ->setCountryId($estimatedSessionAddressData['country_id']) | |
+ ->setCity($estimatedSessionAddressData['city']) | |
+ ->setPostcode($estimatedSessionAddressData['postcode']) | |
+ ->setRegionId($estimatedSessionAddressData['region_id']) | |
+ ->setRegion($estimatedSessionAddressData['region']); | |
+ $cart->getQuote()->setCouponCode($couponCode); | |
+ } | |
$cart->save(); | |
if (!$this->_getQuote()->validateMinimumAmount()) { | |
@@ -526,6 +543,13 @@ class Mage_Checkout_CartController extends Mage_Core_Controller_Front_Action | |
->setRegion($region) | |
->setCollectShippingRates(true); | |
$this->_getQuote()->save(); | |
+ $this->_getSession()->setEstimatedShippingAddressData(array( | |
+ 'country_id' => $country, | |
+ 'postcode' => $postcode, | |
+ 'city' => $city, | |
+ 'region_id' => $regionId, | |
+ 'region' => $region | |
+ )); | |
$this->_goBack(); | |
} | |
@@ -581,6 +605,7 @@ class Mage_Checkout_CartController extends Mage_Core_Controller_Front_Action | |
$this->_getSession()->addSuccess( | |
$this->__('Coupon code "%s" was applied.', Mage::helper('core')->escapeHtml($couponCode)) | |
); | |
+ $this->_getSession()->setCartCouponCode($couponCode); | |
} else { | |
$this->_getSession()->addError( | |
$this->__('Coupon code "%s" is not valid.', Mage::helper('core')->escapeHtml($couponCode)) | |
diff --git a/app/code/core/Mage/Checkout/controllers/OnepageController.php b/app/code/core/Mage/Checkout/controllers/OnepageController.php | |
index 5517fbb..0f1879e 100644 | |
--- a/app/code/core/Mage/Checkout/controllers/OnepageController.php | |
+++ b/app/code/core/Mage/Checkout/controllers/OnepageController.php | |
@@ -334,8 +334,7 @@ class Mage_Checkout_OnepageController extends Mage_Checkout_Controller_Action | |
$address = $this->getOnepage()->getAddress($addressId); | |
if (Mage::getSingleton('customer/session')->getCustomer()->getId() == $address->getCustomerId()) { | |
- $this->getResponse()->setHeader('Content-type', 'application/x-json'); | |
- $this->getResponse()->setBody($address->toJson()); | |
+ $this->_prepareDataJSON($address->toArray()); | |
} else { | |
$this->getResponse()->setHeader('HTTP/1.1','403 Forbidden'); | |
} | |
@@ -353,7 +352,7 @@ class Mage_Checkout_OnepageController extends Mage_Checkout_Controller_Action | |
if ($this->getRequest()->isPost()) { | |
$method = $this->getRequest()->getPost('method'); | |
$result = $this->getOnepage()->saveCheckoutMethod($method); | |
- $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result)); | |
+ $this->_prepareDataJSON($result); | |
} | |
} | |
@@ -395,7 +394,7 @@ class Mage_Checkout_OnepageController extends Mage_Checkout_Controller_Action | |
} | |
} | |
- $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result)); | |
+ $this->_prepareDataJSON($result); | |
} | |
} | |
@@ -419,7 +418,7 @@ class Mage_Checkout_OnepageController extends Mage_Checkout_Controller_Action | |
'html' => $this->_getShippingMethodsHtml() | |
); | |
} | |
- $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result)); | |
+ $this->_prepareDataJSON($result); | |
} | |
} | |
@@ -442,7 +441,7 @@ class Mage_Checkout_OnepageController extends Mage_Checkout_Controller_Action | |
'request' => $this->getRequest(), | |
'quote' => $this->getOnepage()->getQuote())); | |
$this->getOnepage()->getQuote()->collectTotals(); | |
- $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result)); | |
+ $this->_prepareDataJSON($result); | |
$result['goto_section'] = 'payment'; | |
$result['update_section'] = array( | |
@@ -451,7 +450,7 @@ class Mage_Checkout_OnepageController extends Mage_Checkout_Controller_Action | |
); | |
} | |
$this->getOnepage()->getQuote()->collectTotals()->save(); | |
- $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result)); | |
+ $this->_prepareDataJSON($result); | |
} | |
} | |
@@ -498,7 +497,7 @@ class Mage_Checkout_OnepageController extends Mage_Checkout_Controller_Action | |
Mage::logException($e); | |
$result['error'] = $this->__('Unable to set Payment Method.'); | |
} | |
- $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result)); | |
+ $this->_prepareDataJSON($result); | |
} | |
/** | |
@@ -561,7 +560,7 @@ class Mage_Checkout_OnepageController extends Mage_Checkout_Controller_Action | |
$result['success'] = false; | |
$result['error'] = true; | |
$result['error_messages'] = $this->__('Please agree to all the terms and conditions before placing the order.'); | |
- $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result)); | |
+ $this->_prepareDataJSON($result); | |
return; | |
} | |
} | |
@@ -630,7 +629,7 @@ class Mage_Checkout_OnepageController extends Mage_Checkout_Controller_Action | |
$result['redirect'] = $redirectUrl; | |
} | |
- $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result)); | |
+ $this->_prepareDataJSON($result); | |
} | |
/** | |
@@ -657,4 +656,17 @@ class Mage_Checkout_OnepageController extends Mage_Checkout_Controller_Action | |
|| Mage::helper('checkout')->isAllowedGuestCheckout($this->getOnepage()->getQuote()) | |
|| !Mage::helper('checkout')->isCustomerMustBeLogged(); | |
} | |
+ | |
+ /** | |
+ * Prepare JSON formatted data for response to client | |
+ * | |
+ * @param $response | |
+ * @return Zend_Controller_Response_Abstract | |
+ */ | |
+ protected function _prepareDataJSON($response) | |
+ { | |
+ $this->getResponse()->setHeader('Content-type', 'application/json', true); | |
+ return $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response)); | |
+ } | |
+ | |
} | |
diff --git a/app/code/core/Mage/Cms/Block/Page.php b/app/code/core/Mage/Cms/Block/Page.php | |
index 9da2ce6..0fb0f0c 100644 | |
--- a/app/code/core/Mage/Cms/Block/Page.php | |
+++ b/app/code/core/Mage/Cms/Block/Page.php | |
@@ -63,14 +63,28 @@ class Mage_Cms_Block_Page extends Mage_Core_Block_Abstract | |
protected function _prepareLayout() | |
{ | |
$page = $this->getPage(); | |
+ $breadcrumbsArray = array(); | |
// show breadcrumbs | |
if (Mage::getStoreConfig('web/default/show_cms_breadcrumbs') | |
&& ($breadcrumbs = $this->getLayout()->getBlock('breadcrumbs')) | |
&& ($page->getIdentifier()!==Mage::getStoreConfig('web/default/cms_home_page')) | |
&& ($page->getIdentifier()!==Mage::getStoreConfig('web/default/cms_no_route'))) { | |
- $breadcrumbs->addCrumb('home', array('label'=>Mage::helper('cms')->__('Home'), 'title'=>Mage::helper('cms')->__('Go to Home Page'), 'link'=>Mage::getBaseUrl())); | |
- $breadcrumbs->addCrumb('cms_page', array('label'=>$page->getTitle(), 'title'=>$page->getTitle())); | |
+ $breadcrumbsArray[] = array( | |
+ 'crumbName' => 'home', | |
+ 'crumbInfo' => array( | |
+ 'label' => Mage::helper('cms')->__('Home'), | |
+ 'title' => Mage::helper('cms')->__('Go to Home Page'), | |
+ 'link' => Mage::getBaseUrl() | |
+ ) | |
+ ); | |
+ $breadcrumbsArray[] = array( | |
+ 'crumbName' => 'cms_page', | |
+ 'crumbInfo' => array( | |
+ 'label' => $page->getTitle(), | |
+ 'title' => $page->getTitle() | |
+ ) | |
+ ); | |
} | |
$root = $this->getLayout()->getBlock('root'); | |
@@ -85,6 +99,14 @@ class Mage_Cms_Block_Page extends Mage_Core_Block_Abstract | |
$head->setDescription($page->getMetaDescription()); | |
} | |
+ $breadcrumbsObject = new Varien_Object(); | |
+ $breadcrumbsObject->setCrumbs($breadcrumbsArray); | |
+ | |
+ Mage::dispatchEvent('cms_generate_breadcrumbs', array('breadcrumbs' => $breadcrumbsObject)); | |
+ | |
+ foreach ($breadcrumbsObject->getCrumbs() as $breadcrumbsItem) { | |
+ $breadcrumbs->addCrumb($breadcrumbsItem['crumbName'], $breadcrumbsItem['crumbInfo']); | |
+ } | |
return parent::_prepareLayout(); | |
} | |
diff --git a/app/code/core/Mage/Cms/Helper/Wysiwyg/Images.php b/app/code/core/Mage/Cms/Helper/Wysiwyg/Images.php | |
index 82d538e..c8b38bc 100644 | |
--- a/app/code/core/Mage/Cms/Helper/Wysiwyg/Images.php | |
+++ b/app/code/core/Mage/Cms/Helper/Wysiwyg/Images.php | |
@@ -222,7 +222,8 @@ class Mage_Cms_Helper_Wysiwyg_Images extends Mage_Core_Helper_Abstract | |
} | |
$io = new Varien_Io_File(); | |
if (!$io->isWriteable($currentPath) && !$io->mkdir($currentPath)) { | |
- $message = Mage::helper('cms')->__('The directory %s is not writable by server.',$currentPath); | |
+ $message = Mage::helper('cms')->__('The directory %s is not writable by server.', | |
+ $io->getFilteredPath($currentPath)); | |
Mage::throwException($message); | |
} | |
$this->_currentPath = $currentPath; | |
diff --git a/app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php b/app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php | |
index e28e1ea..572817b 100644 | |
--- a/app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php | |
+++ b/app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php | |
@@ -227,17 +227,18 @@ class Mage_Cms_Model_Wysiwyg_Images_Storage extends Varien_Object | |
$rootCmp = rtrim($this->getHelper()->getStorageRoot(), DS); | |
$pathCmp = rtrim($path, DS); | |
+ $io = new Varien_Io_File(); | |
+ | |
if ($rootCmp == $pathCmp) { | |
- Mage::throwException(Mage::helper('cms')->__('Cannot delete root directory %s.', $path)); | |
+ Mage::throwException(Mage::helper('cms')->__('Cannot delete root directory %s.', | |
+ $io->getFilteredPath($path))); | |
} | |
- $io = new Varien_Io_File(); | |
- | |
if (Mage::helper('core/file_storage_database')->checkDbUsage()) { | |
Mage::getModel('core/file_storage_directory_database')->deleteDirectory($path); | |
} | |
if (!$io->rmdir($path, true)) { | |
- Mage::throwException(Mage::helper('cms')->__('Cannot delete directory %s.', $path)); | |
+ Mage::throwException(Mage::helper('cms')->__('Cannot delete directory %s.', $io->getFilteredPath($path))); | |
} | |
if (strpos($pathCmp, $rootCmp) === 0) { | |
diff --git a/app/code/core/Mage/ConfigurableSwatches/Block/Catalog/Product/List/Price.php b/app/code/core/Mage/ConfigurableSwatches/Block/Catalog/Product/List/Price.php | |
new file mode 100644 | |
index 0000000..020a7b3 | |
--- /dev/null | |
+++ b/app/code/core/Mage/ConfigurableSwatches/Block/Catalog/Product/List/Price.php | |
@@ -0,0 +1,95 @@ | |
+<?php | |
+/** | |
+ * Magento | |
+ * | |
+ * NOTICE OF LICENSE | |
+ * | |
+ * This source file is subject to the Open Software License (OSL 3.0) | |
+ * that is bundled with this package in the file LICENSE.txt. | |
+ * It is also available through the world-wide-web at this URL: | |
+ * http://opensource.org/licenses/osl-3.0.php | |
+ * If you did not receive a copy of the license and are unable to | |
+ * obtain it through the world-wide-web, please send an email | |
+ * to [email protected] so we can send you a copy immediately. | |
+ * | |
+ * DISCLAIMER | |
+ * | |
+ * Do not edit or add to this file if you wish to upgrade Magento to newer | |
+ * versions in the future. If you wish to customize Magento for your | |
+ * needs please refer to http://www.magento.com for more information. | |
+ * | |
+ * @category Mage | |
+ * @package Mage_ConfigurableSwatches | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
+ */ | |
+ | |
+class Mage_ConfigurableSwatches_Block_Catalog_Product_List_Price extends Mage_Core_Block_Template | |
+{ | |
+ /** | |
+ * @var string | |
+ */ | |
+ protected $_template = 'configurableswatches/catalog/product/list/price/js.phtml'; | |
+ | |
+ /** | |
+ * Get target product IDs from product collection | |
+ * which was set on block | |
+ * | |
+ * @return Mage_Eav_Model_Entity_Collection_Abstract | |
+ */ | |
+ protected function getProducts() | |
+ { | |
+ return $this->getProductCollection(); | |
+ } | |
+ | |
+ /** | |
+ * Get configuration for configurable swatches price change | |
+ * | |
+ * @return string | |
+ */ | |
+ public function getJsonConfig() | |
+ { | |
+ /** @var Mage_Catalog_Helper_Product_Type_Composite $compositeProductHelper */ | |
+ $compositeProductHelper = $this->helper('catalog/product_type_composite'); | |
+ | |
+ $config = array( | |
+ 'generalConfig' => $compositeProductHelper->prepareJsonGeneralConfig() | |
+ ); | |
+ foreach ($this->getProducts() as $product) { | |
+ /** @var $product Mage_Catalog_Model_Product */ | |
+ if (!$product->getSwatchPrices()) { | |
+ continue; | |
+ } | |
+ | |
+ $config['products'][$product->getId()] = $compositeProductHelper->prepareJsonProductConfig($product); | |
+ $config['products'][$product->getId()]['swatchPrices'] = $product->getSwatchPrices(); | |
+ | |
+ $responseObject = new Varien_Object(); | |
+ Mage::dispatchEvent('catalog_product_view_config', array( | |
+ 'response_object' => $responseObject, | |
+ 'product' => $product, | |
+ )); | |
+ if (is_array($responseObject->getAdditionalOptions())) { | |
+ foreach ($responseObject->getAdditionalOptions() as $option => $value) { | |
+ $config['products'][$product->getId()][$option] = $value; | |
+ } | |
+ } | |
+ } | |
+ return $this->helper('core')->jsonEncode($config); | |
+ } | |
+ | |
+ /** | |
+ * Disable output if all preconditions doesn't meet | |
+ * | |
+ * @return string | |
+ */ | |
+ protected function _toHtml() | |
+ { | |
+ if (!$this->helper('configurableswatches/list_price')->isEnabled()) { | |
+ return ''; | |
+ } | |
+ | |
+ return parent::_toHtml(); | |
+ } | |
+ | |
+} | |
diff --git a/app/code/core/Mage/ConfigurableSwatches/Helper/Data.php b/app/code/core/Mage/ConfigurableSwatches/Helper/Data.php | |
index 203a48c..540caf0 100644 | |
--- a/app/code/core/Mage/ConfigurableSwatches/Helper/Data.php | |
+++ b/app/code/core/Mage/ConfigurableSwatches/Helper/Data.php | |
@@ -92,7 +92,10 @@ class Mage_ConfigurableSwatches_Helper_Data extends Mage_Core_Helper_Abstract | |
public function getSwatchAttributeIds() | |
{ | |
if (is_null($this->_configAttributeIds)) { | |
- $this->_configAttributeIds = explode(',', Mage::getStoreConfig(self::CONFIG_PATH_SWATCH_ATTRIBUTES)); | |
+ $this->_configAttributeIds = array(); | |
+ if (Mage::getStoreConfig(self::CONFIG_PATH_SWATCH_ATTRIBUTES)) { | |
+ $this->_configAttributeIds = explode(',', Mage::getStoreConfig(self::CONFIG_PATH_SWATCH_ATTRIBUTES)); | |
+ } | |
} | |
return $this->_configAttributeIds; | |
} | |
@@ -111,4 +114,27 @@ class Mage_ConfigurableSwatches_Helper_Data extends Mage_Core_Helper_Abstract | |
$configAttrs = $this->getSwatchAttributeIds(); | |
return in_array($attr, $configAttrs); | |
} | |
+ | |
+ /** | |
+ * Get swatches product javascript | |
+ * | |
+ * @return string | |
+ */ | |
+ public function getSwatchesProductJs() | |
+ { | |
+ /** | |
+ * @var $product Mage_Catalog_Model_Product | |
+ */ | |
+ $product = Mage::registry('current_product'); | |
+ if ($this->isEnabled() && $product) { | |
+ $configAttrs = $this->getSwatchAttributeIds(); | |
+ $configurableAttributes = $product->getTypeInstance(true)->getConfigurableAttributesAsArray($product); | |
+ foreach ($configurableAttributes as $configurableAttribute) { | |
+ if (in_array($configurableAttribute['attribute_id'], $configAttrs)) { | |
+ return 'js/configurableswatches/swatches-product.js'; | |
+ } | |
+ } | |
+ } | |
+ return ''; | |
+ } | |
} | |
diff --git a/app/code/core/Mage/ConfigurableSwatches/Helper/List/Price.php b/app/code/core/Mage/ConfigurableSwatches/Helper/List/Price.php | |
new file mode 100644 | |
index 0000000..c4ec318 | |
--- /dev/null | |
+++ b/app/code/core/Mage/ConfigurableSwatches/Helper/List/Price.php | |
@@ -0,0 +1,118 @@ | |
+<?php | |
+/** | |
+ * Magento | |
+ * | |
+ * NOTICE OF LICENSE | |
+ * | |
+ * This source file is subject to the Open Software License (OSL 3.0) | |
+ * that is bundled with this package in the file LICENSE.txt. | |
+ * It is also available through the world-wide-web at this URL: | |
+ * http://opensource.org/licenses/osl-3.0.php | |
+ * If you did not receive a copy of the license and are unable to | |
+ * obtain it through the world-wide-web, please send an email | |
+ * to [email protected] so we can send you a copy immediately. | |
+ * | |
+ * DISCLAIMER | |
+ * | |
+ * Do not edit or add to this file if you wish to upgrade Magento to newer | |
+ * versions in the future. If you wish to customize Magento for your | |
+ * needs please refer to http://www.magento.com for more information. | |
+ * | |
+ * @category Mage | |
+ * @package Mage_ConfigurableSwatches | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
+ */ | |
+ | |
+/** | |
+ * Class implementing price change for swatches in product listing pages | |
+ */ | |
+class Mage_ConfigurableSwatches_Helper_List_Price extends Mage_Core_Helper_Abstract | |
+{ | |
+ /** | |
+ * Path to to check is it required to change prices | |
+ */ | |
+ const XML_PATH_SWATCH_PRICE = 'configswatches/general/product_list_price_change'; | |
+ | |
+ /** | |
+ * Set swatch_price on products where swatch option_id is set | |
+ * Depends on following product data: | |
+ * - product must have children products attached and be configurable by type | |
+ * | |
+ * @param array $products | |
+ * @param int $storeId | |
+ * @return void | |
+ */ | |
+ public function attachConfigurableProductChildrenPricesMapping(array $products, $storeId = null) | |
+ { | |
+ $listSwatchAttrId = Mage::helper('configurableswatches/productlist')->getSwatchAttributeId(); | |
+ $result = array(); | |
+ | |
+ foreach ($products as $product) { | |
+ /** @var $product Mage_Catalog_Model_Product */ | |
+ if ($product->getTypeId() !== Mage_Catalog_Model_Product_Type_Configurable::TYPE_CODE | |
+ && !is_array($product->getChildrenProducts()) | |
+ ) { | |
+ continue; | |
+ } | |
+ | |
+ /** @var Mage_Catalog_Model_Product_Type_Configurable $typeInstance */ | |
+ $typeInstance = $product->getTypeInstance(); | |
+ $allowedAttributes = $typeInstance->getConfigurableAttributeCollection($product); | |
+ foreach ($allowedAttributes as $attribute) { | |
+ /** @var $attribute Mage_Catalog_Model_Product_Type_Configurable_Attribute */ | |
+ if ($attribute->getAttributeId() !== $listSwatchAttrId) { | |
+ continue; | |
+ } | |
+ | |
+ foreach ($attribute->getPrices() as $attributePrice) { | |
+ $product->setConfigurablePrice( | |
+ $this->_getHelper()->preparePrice( | |
+ $product, | |
+ $attributePrice['pricing_value'], | |
+ $attributePrice['is_percent'], | |
+ $storeId | |
+ ) | |
+ ); | |
+ Mage::dispatchEvent( | |
+ 'catalog_product_type_configurable_price', | |
+ array('product' => $product) | |
+ ); | |
+ $configurablePrice = $product->getConfigurablePrice(); | |
+ $cofigurableSwatchesHelper = Mage::helper('configurableswatches'); | |
+ $result[$cofigurableSwatchesHelper::normalizeKey($attributePrice['store_label'])] = array( | |
+ 'price' => $configurablePrice, | |
+ 'oldPrice' => $this->_getHelper()->prepareOldPrice( | |
+ $product, | |
+ $attributePrice['pricing_value'], | |
+ $attributePrice['is_percent'], | |
+ $storeId | |
+ ), | |
+ ); | |
+ } | |
+ } | |
+ $product->setSwatchPrices($result); | |
+ } | |
+ } | |
+ | |
+ /** | |
+ * Get helper for calculation purposes | |
+ * | |
+ * @return Mage_Catalog_Helper_Product_Type_Composite | |
+ */ | |
+ protected function _getHelper() | |
+ { | |
+ return Mage::helper('catalog/product_type_composite'); | |
+ } | |
+ | |
+ /** | |
+ * Check if option for swatches price change is enabled | |
+ * | |
+ * @return bool | |
+ */ | |
+ public function isEnabled() | |
+ { | |
+ return Mage::getStoreConfigFlag(self::XML_PATH_SWATCH_PRICE); | |
+ } | |
+ | |
+} | |
diff --git a/app/code/core/Mage/ConfigurableSwatches/Helper/Mediafallback.php b/app/code/core/Mage/ConfigurableSwatches/Helper/Mediafallback.php | |
index f257b37..d078ee8 100644 | |
--- a/app/code/core/Mage/ConfigurableSwatches/Helper/Mediafallback.php | |
+++ b/app/code/core/Mage/ConfigurableSwatches/Helper/Mediafallback.php | |
@@ -37,12 +37,39 @@ class Mage_ConfigurableSwatches_Helper_Mediafallback extends Mage_Core_Helper_Ab | |
* - product must have children products attached | |
* | |
* @param array $parentProducts | |
+ * @deprecated use $this->attachProductChildrenAttributeMapping() instead | |
* @param $storeId | |
* @return void | |
*/ | |
public function attachConfigurableProductChildrenAttributeMapping(array $parentProducts, $storeId) | |
{ | |
+ return $this->attachProductChildrenAttributeMapping($parentProducts, $storeId); | |
+ } | |
+ | |
+ /** | |
+ * Set child_attribute_label_mapping on products with attribute label -> product mapping | |
+ * Depends on following product data: | |
+ * - product must have children products attached | |
+ * | |
+ * @param array $parentProducts | |
+ * @param $storeId | |
+ * @param bool $onlyListAttributes | |
+ * @return void | |
+ */ | |
+ public function attachProductChildrenAttributeMapping(array $parentProducts, $storeId, $onlyListAttributes = false) | |
+ { | |
+ /** @var $listSwatchAttr Mage_Eav_Model_Attribute */ | |
$listSwatchAttr = Mage::helper('configurableswatches/productlist')->getSwatchAttribute(); | |
+ $swatchAttributeIds = array(); | |
+ if (!$onlyListAttributes) { | |
+ $swatchAttributeIds = Mage::helper('configurableswatches')->getSwatchAttributeIds(); | |
+ } | |
+ if ($listSwatchAttr->getId()) { | |
+ $swatchAttributeIds[] = $listSwatchAttr->getId(); | |
+ } | |
+ if (empty($swatchAttributeIds)) { | |
+ return; | |
+ } | |
$parentProductIds = array(); | |
/* @var $parentProduct Mage_Catalog_Model_Product */ | |
@@ -53,6 +80,7 @@ class Mage_ConfigurableSwatches_Helper_Mediafallback extends Mage_Core_Helper_Ab | |
$configAttributes = Mage::getResourceModel('configurableswatches/catalog_product_attribute_super_collection') | |
->addParentProductsFilter($parentProductIds) | |
->attachEavAttributes() | |
+ ->addFieldToFilter('eav_attributes.attribute_id', array('in' => $swatchAttributeIds)) | |
->setStoreId($storeId) | |
; | |
@@ -61,9 +89,15 @@ class Mage_ConfigurableSwatches_Helper_Mediafallback extends Mage_Core_Helper_Ab | |
$optionLabels += $attribute->getOptionLabels(); | |
} | |
+ // normalize to all lower case before we start using them | |
+ $optionLabels = array_map(function ($value) { | |
+ return array_map('Mage_ConfigurableSwatches_Helper_Data::normalizeKey', $value); | |
+ }, $optionLabels); | |
+ | |
foreach ($parentProducts as $parentProduct) { | |
$mapping = array(); | |
$listSwatchValues = array(); | |
+ $listSwatchStockValues = array(); | |
/* @var $attribute Mage_Catalog_Model_Product_Type_Configurable_Attribute */ | |
foreach ($configAttributes as $attribute) { | |
@@ -74,8 +108,10 @@ class Mage_ConfigurableSwatches_Helper_Mediafallback extends Mage_Core_Helper_Ab | |
foreach ($parentProduct->getChildrenProducts() as $childProduct) { | |
- // product has no value for attribute, we can't process it | |
- if (!$childProduct->hasData($attribute->getAttributeCode())) { | |
+ // product has no value for attribute or not available, we can't process it | |
+ $isInStock = $childProduct->getStockItem()->getIsInStock(); | |
+ if (!$childProduct->hasData($attribute->getAttributeCode()) | |
+ || (!$isInStock && !Mage::helper('cataloginventory')->isShowOutOfStock())) { | |
continue; | |
} | |
$optionId = $childProduct->getData($attribute->getAttributeCode()); | |
@@ -85,11 +121,6 @@ class Mage_ConfigurableSwatches_Helper_Mediafallback extends Mage_Core_Helper_Ab | |
continue; | |
} | |
- // normalize to all lower case before we start using them | |
- $optionLabels = array_map(function ($value) { | |
- return array_map('Mage_ConfigurableSwatches_Helper_Data::normalizeKey', $value); | |
- }, $optionLabels); | |
- | |
// using default value as key unless store-specific label is present | |
$optionLabel = $optionLabels[$optionId][0]; | |
if (isset($optionLabels[$optionId][$storeId])) { | |
@@ -110,7 +141,8 @@ class Mage_ConfigurableSwatches_Helper_Mediafallback extends Mage_Core_Helper_Ab | |
if ($attribute->getAttributeId() == $listSwatchAttr->getAttributeId() | |
&& !in_array($mapping[$optionLabel]['label'], $listSwatchValues) | |
) { | |
- $listSwatchValues[$optionId] = $mapping[$optionLabel]['label']; | |
+ $listSwatchValues[$optionId] = $mapping[$optionLabel]['label']; | |
+ $listSwatchStockValues[$optionId] = $isInStock; | |
} | |
} // end looping child products | |
} // end looping attributes | |
@@ -120,8 +152,13 @@ class Mage_ConfigurableSwatches_Helper_Mediafallback extends Mage_Core_Helper_Ab | |
$mapping[$key]['product_ids'] = array_unique($mapping[$key]['product_ids']); | |
} | |
+ if (count($listSwatchValues)) { | |
+ $listSwatchValues = array_replace(array_intersect_key($optionLabels, $listSwatchValues), | |
+ $listSwatchValues); | |
+ } | |
$parentProduct->setChildAttributeLabelMapping($mapping) | |
- ->setListSwatchAttrValues($listSwatchValues); | |
+ ->setListSwatchAttrValues($listSwatchValues) | |
+ ->setListSwatchAttrStockValues($listSwatchStockValues); | |
} // end looping parent products | |
} | |
@@ -201,7 +238,12 @@ class Mage_ConfigurableSwatches_Helper_Mediafallback extends Mage_Core_Helper_Ab | |
/* @var $childProduct Mage_Catalog_Model_Product */ | |
if ($product->hasChildrenProducts()) { | |
foreach ($product->getChildrenProducts() as $childProduct) { | |
- if ($image = $this->_resizeProductImage($childProduct, $imageType, $keepFrame)) { | |
+ $image = $this->_resizeProductImage($childProduct, $imageType, $keepFrame); | |
+ if (!$image) { | |
+ $image = $this->_resizeProductImage($childProduct, 'image', $keepFrame); | |
+ } | |
+ | |
+ if ($image) { | |
$imagesByType[$imageType][$childProduct->getId()] = $image; | |
} | |
} | |
diff --git a/app/code/core/Mage/ConfigurableSwatches/Model/Observer.php b/app/code/core/Mage/ConfigurableSwatches/Model/Observer.php | |
index 3165e90..cd4c9cb 100644 | |
--- a/app/code/core/Mage/ConfigurableSwatches/Model/Observer.php | |
+++ b/app/code/core/Mage/ConfigurableSwatches/Model/Observer.php | |
@@ -37,8 +37,11 @@ class Mage_ConfigurableSwatches_Model_Observer extends Mage_Core_Model_Abstract | |
return; // exit without loading swatch functionality | |
} | |
- /* @var $helper Mage_ConfigurableSwatches_Helper_Mediafallback */ | |
- $helper = Mage::helper('configurableswatches/mediafallback'); | |
+ /* @var $mediaHelper Mage_ConfigurableSwatches_Helper_Mediafallback */ | |
+ $mediaHelper = Mage::helper('configurableswatches/mediafallback'); | |
+ | |
+ /** @var $priceHelper Mage_ConfigurableSwatches_Helper_List_Price */ | |
+ $priceHelper = Mage::helper('configurableswatches/list_price'); | |
/* @var $collection Mage_Catalog_Model_Resource_Product_Collection */ | |
$collection = $observer->getCollection(); | |
@@ -51,15 +54,19 @@ class Mage_ConfigurableSwatches_Model_Observer extends Mage_Core_Model_Abstract | |
$products = $collection->getItems(); | |
- $helper->attachChildrenProducts($products, $collection->getStoreId()); | |
+ $mediaHelper->attachChildrenProducts($products, $collection->getStoreId()); | |
- $helper->attachConfigurableProductChildrenAttributeMapping($products, $collection->getStoreId()); | |
+ $mediaHelper->attachProductChildrenAttributeMapping($products, $collection->getStoreId()); | |
+ | |
+ if ($priceHelper->isEnabled()) { | |
+ $priceHelper->attachConfigurableProductChildrenPricesMapping($products, $collection->getStoreId()); | |
+ } | |
- $helper->attachGallerySetToCollection($products, $collection->getStoreId()); | |
+ $mediaHelper->attachGallerySetToCollection($products, $collection->getStoreId()); | |
/* @var $product Mage_Catalog_Model_Product */ | |
foreach ($products as $product) { | |
- $helper->groupMediaGalleryImages($product); | |
+ $mediaHelper->groupMediaGalleryImages($product); | |
Mage::helper('configurableswatches/productimg') | |
->indexProductImages($product, $product->getListSwatchAttrValues()); | |
} | |
@@ -90,7 +97,7 @@ class Mage_ConfigurableSwatches_Model_Observer extends Mage_Core_Model_Abstract | |
$helper->groupMediaGalleryImages($product); | |
- $helper->attachConfigurableProductChildrenAttributeMapping(array($product), $product->getStoreId()); | |
+ $helper->attachProductChildrenAttributeMapping(array($product), $product->getStoreId(), false); | |
} | |
/** | |
diff --git a/app/code/core/Mage/ConfigurableSwatches/Model/Resource/Catalog/Product/Attribute/Super/Collection.php b/app/code/core/Mage/ConfigurableSwatches/Model/Resource/Catalog/Product/Attribute/Super/Collection.php | |
index 9a62561..708c729 100644 | |
--- a/app/code/core/Mage/ConfigurableSwatches/Model/Resource/Catalog/Product/Attribute/Super/Collection.php | |
+++ b/app/code/core/Mage/ConfigurableSwatches/Model/Resource/Catalog/Product/Attribute/Super/Collection.php | |
@@ -99,40 +99,59 @@ class Mage_ConfigurableSwatches_Model_Resource_Catalog_Product_Attribute_Super_C | |
*/ | |
protected function _loadOptionLabels() | |
{ | |
- if ($this->count()) { | |
- $select = $this->getConnection()->select() | |
- ->from( | |
- array('attr' => $this->getTable('catalog/product_super_attribute')), | |
- array( | |
- 'product_super_attribute_id' => 'attr.product_super_attribute_id', | |
- )) | |
- ->join( | |
- array('opt' => $this->getTable('eav/attribute_option')), | |
- 'opt.attribute_id = attr.attribute_id', | |
- array( | |
- 'attribute_id' => 'opt.attribute_id', | |
- 'option_id' => 'opt.option_id', | |
- )) | |
- ->join( | |
- array('lab' => $this->getTable('eav/attribute_option_value')), | |
- 'lab.option_id = opt.option_id', | |
- array( | |
- 'label' => 'lab.value', | |
- 'store_id' => 'lab.store_id', | |
- )) | |
- ->where('attr.product_super_attribute_id IN (?)', array_keys($this->_items)) | |
- ; | |
- | |
- $result = $this->getConnection()->fetchAll($select); | |
- foreach ($result as $data) { | |
- $item = $this->getItemById($data['product_super_attribute_id']); | |
- if (!is_array($labels = $item->getOptionLabels())) { | |
- $labels = array(); | |
- } | |
- $labels[$data['option_id']][$data['store_id']] = $data['label']; | |
- $item->setOptionLabels($labels); | |
- } | |
+ $labels = $this->_getOptionLabels(); | |
+ foreach ($this->getItems() as $item) { | |
+ $item->setOptionLabels($labels); | |
} | |
return $this; | |
} | |
+ | |
+ /** | |
+ * Get Option Labels | |
+ * | |
+ * @return array | |
+ */ | |
+ protected function _getOptionLabels() | |
+ { | |
+ $attributeIds = $this->_getAttributeIds(); | |
+ | |
+ $select = $this->getConnection()->select(); | |
+ $select->from(array('options' => $this->getTable('eav/attribute_option'))) | |
+ ->join( | |
+ array('labels' => $this->getTable('eav/attribute_option_value')), | |
+ 'labels.option_id = options.option_id', | |
+ array( | |
+ 'label' => 'labels.value', | |
+ 'store_id' => 'labels.store_id', | |
+ ) | |
+ ) | |
+ ->where('options.attribute_id IN (?)', $attributeIds) | |
+ ->where( | |
+ 'labels.store_id IN (?)', | |
+ array(Mage_Catalog_Model_Abstract::DEFAULT_STORE_ID, $this->getStoreId()) | |
+ ); | |
+ | |
+ $resultSet = $this->getConnection()->query($select); | |
+ $labels = array(); | |
+ while ($option = $resultSet->fetch()) { | |
+ $labels[$option['option_id']][$option['store_id']] = $option['label']; | |
+ } | |
+ return $labels; | |
+ } | |
+ | |
+ /** | |
+ * Get Attribute IDs | |
+ * | |
+ * @return array | |
+ */ | |
+ protected function _getAttributeIds() | |
+ { | |
+ $attributeIds = array(); | |
+ foreach ($this->getItems() as $item) { | |
+ $attributeIds[] = $item->getAttributeId(); | |
+ } | |
+ $attributeIds = array_unique($attributeIds); | |
+ | |
+ return $attributeIds; | |
+ } | |
} | |
diff --git a/app/code/core/Mage/ConfigurableSwatches/etc/system.xml b/app/code/core/Mage/ConfigurableSwatches/etc/system.xml | |
index 21eba8d..44b6f5d 100644 | |
--- a/app/code/core/Mage/ConfigurableSwatches/etc/system.xml | |
+++ b/app/code/core/Mage/ConfigurableSwatches/etc/system.xml | |
@@ -71,6 +71,15 @@ | |
<show_in_website>1</show_in_website> | |
<show_in_store>1</show_in_store> | |
</product_list_attribute> | |
+ <product_list_price_change translate="label" module="configurableswatches"> | |
+ <label>Dynamic Price Change for Swatches in Product Listing</label> | |
+ <frontend_type>select</frontend_type> | |
+ <source_model>adminhtml/system_config_source_yesno</source_model> | |
+ <sort_order>40</sort_order> | |
+ <show_in_default>1</show_in_default> | |
+ <show_in_website>1</show_in_website> | |
+ <show_in_store>1</show_in_store> | |
+ </product_list_price_change> | |
</fields> | |
</general> | |
<product_detail_dimensions translate="label comment" module="configurableswatches"> | |
diff --git a/app/code/core/Mage/Core/Block/Template.php b/app/code/core/Mage/Core/Block/Template.php | |
index 5df4d03..0b235e6 100644 | |
--- a/app/code/core/Mage/Core/Block/Template.php | |
+++ b/app/code/core/Mage/Core/Block/Template.php | |
@@ -212,7 +212,7 @@ class Mage_Core_Block_Template extends Mage_Core_Block_Abstract | |
// EXTR_SKIP protects from overriding | |
// already defined variables | |
- extract ($this->_viewVars, EXTR_SKIP); | |
+ extract($this->_viewVars, EXTR_SKIP); | |
$do = $this->getDirectOutput(); | |
if (!$do) { | |
diff --git a/app/code/core/Mage/Core/Controller/Varien/Action.php b/app/code/core/Mage/Core/Controller/Varien/Action.php | |
index 2222754..3b63f57 100644 | |
--- a/app/code/core/Mage/Core/Controller/Varien/Action.php | |
+++ b/app/code/core/Mage/Core/Controller/Varien/Action.php | |
@@ -1054,6 +1054,7 @@ abstract class Mage_Core_Controller_Varien_Action | |
return $this; | |
} | |
if ($content['type'] == 'filename') { | |
+ clearstatcache(); | |
$isFile = true; | |
$file = $content['value']; | |
$contentLength = filesize($file); | |
diff --git a/app/code/core/Mage/Core/Helper/String.php b/app/code/core/Mage/Core/Helper/String.php | |
index 13a28dc..10ba262 100644 | |
--- a/app/code/core/Mage/Core/Helper/String.php | |
+++ b/app/code/core/Mage/Core/Helper/String.php | |
@@ -172,6 +172,13 @@ class Mage_Core_Helper_String extends Mage_Core_Helper_Abstract | |
// trim | |
if ($trim) { | |
$str = trim(preg_replace('/\s{2,}/siu', ' ', $str)); | |
+ /** | |
+ * In cases like: | |
+ * Mage::helper('core/string')->str_split('0 1 2 ', 2, false, true); | |
+ * the result array have elements with boolean "false" value. | |
+ * So it fixed by | |
+ */ | |
+ $strlen = $this->strlen($str); | |
} | |
// do a usual str_split, but safe for our encoding | |
if ((!$keepWords) || ($length < 2)) { | |
@@ -194,7 +201,14 @@ class Mage_Core_Helper_String extends Mage_Core_Helper_Abstract | |
$space = ' '; | |
$spaceLen = 1; | |
} | |
- if (empty($result[$i])) { | |
+ /** | |
+ * The empty($result[$i]) is not appropriate, because in case with empty("0") expression returns "true", | |
+ * so in cases when string have "0" symbol, the "0" will lost. | |
+ * Try Mage::helper('core/string')->str_split("0 aa", 2, true); | |
+ * Therefore the empty($result[$i]) expression | |
+ * replaced by !isset($result[$i]) || isset($result[$i]) && $result[$i] === '' | |
+ */ | |
+ if (!isset($result[$i]) || isset($result[$i]) && $result[$i] === '') { | |
$currentLength = 0; | |
$result[$i] = ''; | |
$space = ''; | |
@@ -476,4 +490,30 @@ class Mage_Core_Helper_String extends Mage_Core_Helper_Abstract | |
return $this->_arrayHelper; | |
} | |
+ /** | |
+ * Unicode compatible ord() method | |
+ * | |
+ * @param string $c char to get value from | |
+ * @return integer | |
+ */ | |
+ public function uniOrd($c) | |
+ { | |
+ $ord = 0; | |
+ $h = ord($c[0]); | |
+ | |
+ if ($h <= 0x7F) { | |
+ $ord = $h; | |
+ } else if ($h < 0xC2) { | |
+ $ord = 0; | |
+ } else if ($h <= 0xDF) { | |
+ $ord = (($h & 0x1F) << 6 | (ord($c[1]) & 0x3F)); | |
+ } else if ($h <= 0xEF) { | |
+ $ord = (($h & 0x0F) << 12 | (ord($c[1]) & 0x3F) << 6 | (ord($c[2]) & 0x3F)); | |
+ } else if ($h <= 0xF4) { | |
+ $ord = (($h & 0x0F) << 18 | (ord($c[1]) & 0x3F) << 12 | | |
+ (ord($c[2]) & 0x3F) << 6 | (ord($c[3]) & 0x3F)); | |
+ } | |
+ | |
+ return $ord; | |
+ } | |
} | |
diff --git a/app/code/core/Mage/Core/Model/Config.php b/app/code/core/Mage/Core/Model/Config.php | |
index 65da05d..829b7d2 100644 | |
--- a/app/code/core/Mage/Core/Model/Config.php | |
+++ b/app/code/core/Mage/Core/Model/Config.php | |
@@ -256,6 +256,9 @@ class Mage_Core_Model_Config extends Mage_Core_Model_Config_Base | |
if ($cacheLoad) { | |
return $this; | |
} | |
+ | |
+ $this->_useCache = false; | |
+ | |
$this->loadModules(); | |
$this->loadDb(); | |
$this->saveCache(); | |
diff --git a/app/code/core/Mage/Core/Model/Email/Queue.php b/app/code/core/Mage/Core/Model/Email/Queue.php | |
index 11d7716..8e0ff6c 100644 | |
--- a/app/code/core/Mage/Core/Model/Email/Queue.php | |
+++ b/app/code/core/Mage/Core/Model/Email/Queue.php | |
@@ -44,8 +44,6 @@ | |
* | |
* @category Mage | |
* @package Mage_Core | |
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) | |
- * @license http://www.magentocommerce.com/license/enterprise-edition | |
*/ | |
class Mage_Core_Model_Email_Queue extends Mage_Core_Model_Abstract | |
{ | |
diff --git a/app/code/core/Mage/Core/Model/Email/Template.php b/app/code/core/Mage/Core/Model/Email/Template.php | |
index a1f356a..d7ec262 100644 | |
--- a/app/code/core/Mage/Core/Model/Email/Template.php | |
+++ b/app/code/core/Mage/Core/Model/Email/Template.php | |
@@ -407,6 +407,7 @@ class Mage_Core_Model_Email_Template extends Mage_Core_Model_Email_Template_Abst | |
if ($this->hasQueue() && $this->getQueue() instanceof Mage_Core_Model_Email_Queue) { | |
/** @var $emailQueue Mage_Core_Model_Email_Queue */ | |
$emailQueue = $this->getQueue(); | |
+ $emailQueue->clearRecipients(); | |
$emailQueue->setMessageBody($text); | |
$emailQueue->setMessageParameters(array( | |
'subject' => $subject, | |
diff --git a/app/code/core/Mage/Core/Model/Email/Template/Abstract.php b/app/code/core/Mage/Core/Model/Email/Template/Abstract.php | |
index d8e348e..57625c4 100644 | |
--- a/app/code/core/Mage/Core/Model/Email/Template/Abstract.php | |
+++ b/app/code/core/Mage/Core/Model/Email/Template/Abstract.php | |
@@ -149,8 +149,7 @@ abstract class Mage_Core_Model_Email_Template_Abstract extends Mage_Core_Model_T | |
protected function _addEmailVariables($variables, $storeId) | |
{ | |
if (!isset($variables['store'])) { | |
- $store = Mage::app()->getStore($storeId); | |
- $variables['store'] = $store; | |
+ $variables['store'] = Mage::app()->getStore($storeId); | |
} | |
if (!isset($variables['logo_url'])) { | |
$variables['logo_url'] = $this->_getLogoUrl($storeId); | |
@@ -158,35 +157,20 @@ abstract class Mage_Core_Model_Email_Template_Abstract extends Mage_Core_Model_T | |
if (!isset($variables['logo_alt'])) { | |
$variables['logo_alt'] = $this->_getLogoAlt($storeId); | |
} | |
- if (!isset($variables['logo_width'])) { | |
- $variables['logo_width'] = Mage::getStoreConfig( | |
- self::XML_PATH_DESIGN_EMAIL_LOGO_WIDTH, | |
- $storeId | |
- ); | |
- } | |
- if (!isset($variables['logo_height'])) { | |
- $variables['logo_height'] = Mage::getStoreConfig( | |
- self::XML_PATH_DESIGN_EMAIL_LOGO_HEIGHT, | |
- $storeId | |
- ); | |
- } | |
- if (!isset($variables['store_phone'])) { | |
- $variables['store_phone'] = Mage::getStoreConfig( | |
- Mage_Core_Model_Store::XML_PATH_STORE_STORE_PHONE, | |
- $storeId | |
- ); | |
- } | |
- if (!isset($variables['store_hours'])) { | |
- $variables['store_hours'] = Mage::getStoreConfig( | |
- Mage_Core_Model_Store::XML_PATH_STORE_STORE_HOURS, | |
- $storeId | |
- ); | |
- } | |
- if (!isset($variables['store_email'])) { | |
- $variables['store_email'] = Mage::getStoreConfig( | |
- Mage_Customer_Helper_Data::XML_PATH_SUPPORT_EMAIL, | |
- $storeId | |
- ); | |
+ | |
+ $defaultValuesMap = array( | |
+ "logo_width" => self::XML_PATH_DESIGN_EMAIL_LOGO_WIDTH, | |
+ "logo_height" => self::XML_PATH_DESIGN_EMAIL_LOGO_HEIGHT, | |
+ "phone" => Mage_Core_Model_Store::XML_PATH_STORE_STORE_PHONE, | |
+ "store_phone" => Mage_Core_Model_Store::XML_PATH_STORE_STORE_PHONE, | |
+ "store_hours" => Mage_Core_Model_Store::XML_PATH_STORE_STORE_HOURS, | |
+ "store_email" => Mage_Customer_Helper_Data::XML_PATH_SUPPORT_EMAIL, | |
+ ); | |
+ | |
+ foreach ($defaultValuesMap as $variableName => $configValue) { | |
+ if (!isset($variables[$variableName])) { | |
+ $variables[$variableName] = Mage::getStoreConfig($configValue, $storeId); | |
+ } | |
} | |
// If template is text mode, don't include styles | |
if (!$this->isPlain()) { | |
diff --git a/app/code/core/Mage/Core/Model/File/Storage/Abstract.php b/app/code/core/Mage/Core/Model/File/Storage/Abstract.php | |
index ec5472d..3e63a5b 100644 | |
--- a/app/code/core/Mage/Core/Model/File/Storage/Abstract.php | |
+++ b/app/code/core/Mage/Core/Model/File/Storage/Abstract.php | |
@@ -74,12 +74,12 @@ abstract class Mage_Core_Model_File_Storage_Abstract extends Mage_Core_Model_Abs | |
{ | |
$path = ltrim($path, '\\/'); | |
$fullPath = $this->getMediaBaseDirectory() . DS . $path; | |
- | |
+ $io = new Varien_Io_File(); | |
if (!file_exists($fullPath) || !is_file($fullPath)) { | |
- Mage::throwException(Mage::helper('core')->__('File %s does not exist', $fullPath)); | |
+ Mage::throwException(Mage::helper('core')->__('File %s does not exist', $io->getFilteredPath($fullPath))); | |
} | |
if (!is_readable($fullPath)) { | |
- Mage::throwException(Mage::helper('core')->__('File %s is not readable', $fullPath)); | |
+ Mage::throwException(Mage::helper('core')->__('File %s is not readable', $io->getFilteredPath($fullPath))); | |
} | |
$path = str_replace(array('/', '\\'), '/', $path); | |
diff --git a/app/code/core/Mage/Core/Model/File/Validator/AvailablePath.php b/app/code/core/Mage/Core/Model/File/Validator/AvailablePath.php | |
index 449ee0c..d12ceeb 100644 | |
--- a/app/code/core/Mage/Core/Model/File/Validator/AvailablePath.php | |
+++ b/app/code/core/Mage/Core/Model/File/Validator/AvailablePath.php | |
@@ -92,7 +92,7 @@ class Mage_Core_Model_File_Validator_AvailablePath extends Zend_Validate_Abstrac | |
/** | |
* Initialize message templates with translating | |
* | |
- * @return Mage_Adminhtml_Model_Core_File_Validator_SavePath_Available | |
+ * @return Mage_Core_Model_File_Validator_AvailablePath | |
*/ | |
protected function _initMessageTemplates() | |
{ | |
@@ -114,7 +114,7 @@ class Mage_Core_Model_File_Validator_AvailablePath extends Zend_Validate_Abstrac | |
* | |
* @param array $paths All paths masks types. | |
* E.g.: array('available' => array(...), 'protected' => array(...)) | |
- * @return Mage_Adminhtml_Model_Core_File_Validator_SavePath_Available | |
+ * @return Mage_Core_Model_File_Validator_AvailablePath | |
*/ | |
public function setPaths(array $paths) | |
{ | |
@@ -131,7 +131,7 @@ class Mage_Core_Model_File_Validator_AvailablePath extends Zend_Validate_Abstrac | |
* Set protected paths masks | |
* | |
* @param array $paths | |
- * @return Mage_Adminhtml_Model_Core_File_Validator_SavePath_Available | |
+ * @return Mage_Core_Model_File_Validator_AvailablePath | |
*/ | |
public function setProtectedPaths(array $paths) | |
{ | |
@@ -143,7 +143,7 @@ class Mage_Core_Model_File_Validator_AvailablePath extends Zend_Validate_Abstrac | |
* Add protected paths masks | |
* | |
* @param string|array $path | |
- * @return Mage_Adminhtml_Model_Core_File_Validator_SavePath_Available | |
+ * @return Mage_Core_Model_File_Validator_AvailablePath | |
*/ | |
public function addProtectedPath($path) | |
{ | |
@@ -169,7 +169,7 @@ class Mage_Core_Model_File_Validator_AvailablePath extends Zend_Validate_Abstrac | |
* Set available paths masks | |
* | |
* @param array $paths | |
- * @return Mage_Adminhtml_Model_Core_File_Validator_SavePath_Available | |
+ * @return Mage_Core_Model_File_Validator_AvailablePath | |
*/ | |
public function setAvailablePaths(array $paths) | |
{ | |
@@ -181,7 +181,7 @@ class Mage_Core_Model_File_Validator_AvailablePath extends Zend_Validate_Abstrac | |
* Add available paths mask | |
* | |
* @param string|array $path | |
- * @return Mage_Adminhtml_Model_Core_File_Validator_SavePath_Available | |
+ * @return Mage_Core_Model_File_Validator_AvailablePath | |
*/ | |
public function addAvailablePath($path) | |
{ | |
diff --git a/app/code/core/Mage/Core/Model/Layout.php b/app/code/core/Mage/Core/Model/Layout.php | |
index cb9227b..f61a462 100644 | |
--- a/app/code/core/Mage/Core/Model/Layout.php | |
+++ b/app/code/core/Mage/Core/Model/Layout.php | |
@@ -552,7 +552,7 @@ class Mage_Core_Model_Layout extends Varien_Simplexml_Config | |
$out = ''; | |
if (!empty($this->_output)) { | |
foreach ($this->_output as $callback) { | |
- $out .= $this->getBlock($callback[0])->$callback[1](); | |
+ $out .= $this->getBlock($callback[0])->{$callback[1]}(); | |
} | |
} | |
diff --git a/app/code/core/Mage/Core/Model/Resource/Url/Rewrite.php b/app/code/core/Mage/Core/Model/Resource/Url/Rewrite.php | |
index 0c6d825..3be79da 100644 | |
--- a/app/code/core/Mage/Core/Model/Resource/Url/Rewrite.php | |
+++ b/app/code/core/Mage/Core/Model/Resource/Url/Rewrite.php | |
@@ -134,12 +134,12 @@ class Mage_Core_Model_Resource_Url_Rewrite extends Mage_Core_Model_Resource_Db_A | |
public function loadByRequestPath(Mage_Core_Model_Url_Rewrite $object, $path) | |
{ | |
if (!is_array($path)) { | |
- $path = array($path); | |
+ $path = array(strtolower($path)); | |
} | |
$pathBind = array(); | |
foreach ($path as $key => $url) { | |
- $pathBind['path' . $key] = $url; | |
+ $pathBind['path' . $key] = strtolower($url); | |
} | |
// Form select | |
$adapter = $this->_getReadAdapter(); | |
@@ -151,7 +151,7 @@ class Mage_Core_Model_Resource_Url_Rewrite extends Mage_Core_Model_Resource_Db_A | |
$items = $adapter->fetchAll($select, $pathBind); | |
// Go through all found records and choose one with lowest penalty - earlier path in array, concrete store | |
- $mapPenalty = array_flip(array_values($path)); // we got mapping array(path => index), lower index - better | |
+ $mapPenalty = array_change_key_case(array_flip(array_values($path))); // we got mapping array(path => index), lower index - better | |
$currentPenalty = null; | |
$foundItem = null; | |
foreach ($items as $item) { | |
diff --git a/app/code/core/Mage/Core/Model/Resource/Variable/Collection.php b/app/code/core/Mage/Core/Model/Resource/Variable/Collection.php | |
index 14c716c..cdb0541 100644 | |
--- a/app/code/core/Mage/Core/Model/Resource/Variable/Collection.php | |
+++ b/app/code/core/Mage/Core/Model/Resource/Variable/Collection.php | |
@@ -84,7 +84,7 @@ class Mage_Core_Model_Resource_Variable_Collection extends Mage_Core_Model_Resou | |
->join( | |
array('value_table' => $this->getTable('core/variable_value')), | |
'value_table.variable_id = main_table.variable_id', | |
- array('value_table.value')); | |
+ array('value_table.plain_value', 'value_table.html_value')); | |
$this->addFieldToFilter('value_table.store_id', array('eq' => $this->getStoreId())); | |
return $this; | |
} | |
diff --git a/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php b/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php | |
index 79a05f2..82f09a2 100644 | |
--- a/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php | |
+++ b/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php | |
@@ -32,6 +32,7 @@ class Mage_Core_Model_Session_Abstract_Varien extends Varien_Object | |
const VALIDATOR_HTTP_X_FORVARDED_FOR_KEY = 'http_x_forwarded_for'; | |
const VALIDATOR_HTTP_VIA_KEY = 'http_via'; | |
const VALIDATOR_REMOTE_ADDR_KEY = 'remote_addr'; | |
+ const VALIDATOR_SESSION_EXPIRE_TIMESTAMP = 'session_expire_timestamp'; | |
const SECURE_COOKIE_CHECK_KEY = '_secure_cookie_check'; | |
/** | |
@@ -378,6 +379,16 @@ class Mage_Core_Model_Session_Abstract_Varien extends Varien_Object | |
} | |
/** | |
+ * Use session expire timestamp in validator key | |
+ * | |
+ * @return bool | |
+ */ | |
+ public function useValidateSessionExpire() | |
+ { | |
+ return true; | |
+ } | |
+ | |
+ /** | |
* Retrieve skip User Agent validation strings (Flash etc) | |
* | |
* @return array | |
@@ -446,6 +457,14 @@ class Mage_Core_Model_Session_Abstract_Varien extends Varien_Object | |
return false; | |
} | |
+ if ($this->useValidateSessionExpire() | |
+ && $sessionData[self::VALIDATOR_SESSION_EXPIRE_TIMESTAMP] < time() ) { | |
+ return false; | |
+ } else { | |
+ $this->_data[self::VALIDATOR_KEY][self::VALIDATOR_SESSION_EXPIRE_TIMESTAMP] | |
+ = $validatorData[self::VALIDATOR_SESSION_EXPIRE_TIMESTAMP]; | |
+ } | |
+ | |
return true; | |
} | |
@@ -479,6 +498,8 @@ class Mage_Core_Model_Session_Abstract_Varien extends Varien_Object | |
$parts[self::VALIDATOR_HTTP_USER_AGENT_KEY] = (string)$_SERVER['HTTP_USER_AGENT']; | |
} | |
+ $parts[self::VALIDATOR_SESSION_EXPIRE_TIMESTAMP] = time() + $this->getCookie()->getLifetime(); | |
+ | |
return $parts; | |
} | |
diff --git a/app/code/core/Mage/Core/etc/config.xml b/app/code/core/Mage/Core/etc/config.xml | |
index a4b154c..751b177 100644 | |
--- a/app/code/core/Mage/Core/etc/config.xml | |
+++ b/app/code/core/Mage/Core/etc/config.xml | |
@@ -456,6 +456,14 @@ | |
<public_files_valid_paths> | |
<protected> | |
<app>/app/*/*</app> | |
+ <dev>/dev/*/*</dev> | |
+ <downloader>/downloader/*/*</downloader> | |
+ <errors>/errors/*/*</errors> | |
+ <includes>/includes/*/*</includes> | |
+ <js>/js/*/*</js> | |
+ <lib>/lib/*/*</lib> | |
+ <shell>/shell/*/*</shell> | |
+ <skin>/skin/*/*</skin> | |
</protected> | |
</public_files_valid_paths> | |
</file> | |
diff --git a/app/code/core/Mage/Core/etc/jstranslator.xml b/app/code/core/Mage/Core/etc/jstranslator.xml | |
index 61c4a1e..cd2c1b2 100644 | |
--- a/app/code/core/Mage/Core/etc/jstranslator.xml | |
+++ b/app/code/core/Mage/Core/etc/jstranslator.xml | |
@@ -82,7 +82,7 @@ | |
<message>Please use only visible characters and spaces.</message> | |
</validate-email-sender> | |
<validate-password translate="message" module="core"> | |
- <message>Please enter 6 or more characters. Leading or trailing spaces will be ignored.</message> | |
+ <message>Please enter 6 or more characters without leading or trailing spaces.</message> | |
</validate-password> | |
<validate-admin-password translate="message" module="core"> | |
<message>Please enter 7 or more characters. Password should contain both numeric and alphabetic characters.</message> | |
@@ -130,7 +130,7 @@ | |
<message>Please select State/Province.</message> | |
</validate-state> | |
<validate-new-password translate="message" module="core"> | |
- <message>Please enter 6 or more characters. Leading or trailing spaces will be ignored.</message> | |
+ <message>Please enter 6 or more characters without leading or trailing spaces.</message> | |
</validate-new-password> | |
<validate-greater-than-zero translate="message" module="core"> | |
<message>Please enter a number greater than 0 in this field.</message> | |
diff --git a/app/code/core/Mage/Core/etc/system.xml b/app/code/core/Mage/Core/etc/system.xml | |
index 5ca9b62..887ad9e 100644 | |
--- a/app/code/core/Mage/Core/etc/system.xml | |
+++ b/app/code/core/Mage/Core/etc/system.xml | |
@@ -1068,7 +1068,7 @@ | |
<show_in_store>0</show_in_store> | |
</forgot_email_identity> | |
<password_reset_link_expiration_period translate="label comment"> | |
- <label>Recovery Link Expiration Period (days)</label> | |
+ <label>Recovery Link Expiration Period (hours)</label> | |
<comment>Please enter a number 1 or greater in this field.</comment> | |
<frontend_type>text</frontend_type> | |
<validate>required-entry validate-digits validate-digits-range digits-range-1-</validate> | |
diff --git a/app/code/core/Mage/Cron/Model/Schedule.php b/app/code/core/Mage/Cron/Model/Schedule.php | |
index e31b279..fcde0fe 100644 | |
--- a/app/code/core/Mage/Cron/Model/Schedule.php | |
+++ b/app/code/core/Mage/Cron/Model/Schedule.php | |
@@ -215,6 +215,10 @@ class Mage_Cron_Model_Schedule extends Mage_Core_Model_Abstract | |
*/ | |
public function tryLockJob($oldStatus = self::STATUS_PENDING) | |
{ | |
- return $this->_getResource()->trySetJobStatusAtomic($this->getId(), self::STATUS_RUNNING, $oldStatus); | |
+ $result = $this->_getResource()->trySetJobStatusAtomic($this->getId(), self::STATUS_RUNNING, $oldStatus); | |
+ if ($result) { | |
+ $this->setStatus(self::STATUS_RUNNING); | |
+ } | |
+ return $result; | |
} | |
} | |
diff --git a/app/code/core/Mage/Customer/Helper/Data.php b/app/code/core/Mage/Customer/Helper/Data.php | |
index 002cfe4..3d6d823 100644 | |
--- a/app/code/core/Mage/Customer/Helper/Data.php | |
+++ b/app/code/core/Mage/Customer/Helper/Data.php | |
@@ -86,6 +86,13 @@ class Mage_Customer_Helper_Data extends Mage_Core_Helper_Abstract | |
= 'customer/password/require_admin_user_to_change_user_password'; | |
/** | |
+ * Configuration path to password forgotten flow change | |
+ */ | |
+ const XML_PATH_CUSTOMER_FORGOT_PASSWORD_FLOW_SECURE = 'admin/security/forgot_password_flow_secure'; | |
+ const XML_PATH_CUSTOMER_FORGOT_PASSWORD_EMAIL_TIMES = 'admin/security/forgot_password_email_times'; | |
+ const XML_PATH_CUSTOMER_FORGOT_PASSWORD_IP_TIMES = 'admin/security/forgot_password_ip_times'; | |
+ | |
+ /** | |
* VAT class constants | |
*/ | |
const VAT_CLASS_DOMESTIC = 'domestic'; | |
@@ -484,6 +491,36 @@ class Mage_Customer_Helper_Data extends Mage_Core_Helper_Abstract | |
} | |
/** | |
+ * Retrieve forgot password flow secure type | |
+ * | |
+ * @return int | |
+ */ | |
+ public function getCustomerForgotPasswordFlowSecure() | |
+ { | |
+ return (int)Mage::getStoreConfig(self::XML_PATH_CUSTOMER_FORGOT_PASSWORD_FLOW_SECURE); | |
+ } | |
+ | |
+ /** | |
+ * Retrieve forgot password requests to times per 24 hours from 1 e-mail | |
+ * | |
+ * @return int | |
+ */ | |
+ public function getCustomerForgotPasswordEmailTimes() | |
+ { | |
+ return (int)Mage::getStoreConfig(self::XML_PATH_CUSTOMER_FORGOT_PASSWORD_EMAIL_TIMES); | |
+ } | |
+ | |
+ /** | |
+ * Retrieve forgot password requests to times per hour from 1 IP | |
+ * | |
+ * @return int | |
+ */ | |
+ public function getCustomerForgotPasswordIpTimes() | |
+ { | |
+ return (int)Mage::getStoreConfig(self::XML_PATH_CUSTOMER_FORGOT_PASSWORD_IP_TIMES); | |
+ } | |
+ | |
+ /** | |
* Retrieve customer group ID based on his VAT number | |
* | |
* @param string $customerCountryCode | |
diff --git a/app/code/core/Mage/Customer/Model/Customer.php b/app/code/core/Mage/Customer/Model/Customer.php | |
index e662fd6..13b7390 100644 | |
--- a/app/code/core/Mage/Customer/Model/Customer.php | |
+++ b/app/code/core/Mage/Customer/Model/Customer.php | |
@@ -46,6 +46,8 @@ class Mage_Customer_Model_Customer extends Mage_Core_Model_Abstract | |
const XML_PATH_CONFIRM_EMAIL_TEMPLATE = 'customer/create_account/email_confirmation_template'; | |
const XML_PATH_CONFIRMED_EMAIL_TEMPLATE = 'customer/create_account/email_confirmed_template'; | |
const XML_PATH_GENERATE_HUMAN_FRIENDLY_ID = 'customer/create_account/generate_human_friendly_id'; | |
+ const XML_PATH_CHANGED_PASSWORD_OR_EMAIL_TEMPLATE = 'customer/changed_account/password_or_email_template'; | |
+ const XML_PATH_CHANGED_PASSWORD_OR_EMAIL_IDENTITY = 'customer/changed_account/password_or_email_identity'; | |
/**#@-*/ | |
/**#@+ | |
@@ -67,6 +69,11 @@ class Mage_Customer_Model_Customer extends Mage_Core_Model_Abstract | |
const CACHE_TAG = 'customer'; | |
/** | |
+ * Minimum Password Length | |
+ */ | |
+ const MINIMUM_PASSWORD_LENGTH = 6; | |
+ | |
+ /** | |
* Model event prefix | |
* | |
* @var string | |
@@ -385,7 +392,7 @@ class Mage_Customer_Model_Customer extends Mage_Core_Model_Abstract | |
public function hashPassword($password, $salt = null) | |
{ | |
return $this->_getHelper('core') | |
- ->getHash($password, !is_null($salt) ? $salt : Mage_Admin_Model_User::HASH_SALT_LENGTH); | |
+ ->getHash(trim($password), !is_null($salt) ? $salt : Mage_Admin_Model_User::HASH_SALT_LENGTH); | |
} | |
/** | |
@@ -585,10 +592,11 @@ class Mage_Customer_Model_Customer extends Mage_Core_Model_Abstract | |
* @param string $type | |
* @param string $backUrl | |
* @param string $storeId | |
+ * @param string $password | |
* @throws Mage_Core_Exception | |
* @return Mage_Customer_Model_Customer | |
*/ | |
- public function sendNewAccountEmail($type = 'registered', $backUrl = '', $storeId = '0') | |
+ public function sendNewAccountEmail($type = 'registered', $backUrl = '', $storeId = '0', $password = '') | |
{ | |
$types = array( | |
'registered' => self::XML_PATH_REGISTER_EMAIL_TEMPLATE, // welcome email, when confirmation is disabled | |
@@ -603,8 +611,10 @@ class Mage_Customer_Model_Customer extends Mage_Core_Model_Abstract | |
$storeId = $this->_getWebsiteStoreId($this->getSendemailStoreId()); | |
} | |
+ $this->setPassword($password); | |
$this->_sendEmailTemplate($types[$type], self::XML_PATH_REGISTER_EMAIL_IDENTITY, | |
array('customer' => $this, 'back_url' => $backUrl), $storeId); | |
+ $this->cleanPasswordsValidationData(); | |
return $this; | |
} | |
@@ -656,20 +666,41 @@ class Mage_Customer_Model_Customer extends Mage_Core_Model_Abstract | |
} | |
/** | |
+ * Send info email about changed password or email | |
+ * | |
+ * @return Mage_Customer_Model_Customer | |
+ */ | |
+ public function sendChangedPasswordOrEmail() | |
+ { | |
+ $storeId = $this->getStoreId(); | |
+ if (!$storeId) { | |
+ $storeId = $this->_getWebsiteStoreId(); | |
+ } | |
+ | |
+ $this->_sendEmailTemplate(self::XML_PATH_CHANGED_PASSWORD_OR_EMAIL_TEMPLATE, | |
+ self::XML_PATH_CHANGED_PASSWORD_OR_EMAIL_IDENTITY, | |
+ array('customer' => $this), $storeId, $this->getOldEmail()); | |
+ | |
+ return $this; | |
+ } | |
+ | |
+ /** | |
* Send corresponding email template | |
* | |
* @param string $emailTemplate configuration path of email template | |
* @param string $emailSender configuration path of email identity | |
* @param array $templateParams | |
* @param int|null $storeId | |
+ * @param string|null $customerEmail | |
* @return Mage_Customer_Model_Customer | |
*/ | |
- protected function _sendEmailTemplate($template, $sender, $templateParams = array(), $storeId = null) | |
+ protected function _sendEmailTemplate($template, $sender, $templateParams = array(), $storeId = null, $customerEmail = null) | |
{ | |
+ $customerEmail = ($customerEmail) ? $customerEmail : $this->getEmail(); | |
/** @var $mailer Mage_Core_Model_Email_Template_Mailer */ | |
$mailer = Mage::getModel('core/email_template_mailer'); | |
$emailInfo = Mage::getModel('core/email_info'); | |
- $emailInfo->addTo($this->getEmail(), $this->getName()); | |
+ $emailInfo->addTo($customerEmail, $this->getName()); | |
$mailer->addEmailInfo($emailInfo); | |
// Set all required params and send emails | |
@@ -838,8 +869,9 @@ class Mage_Customer_Model_Customer extends Mage_Core_Model_Abstract | |
if (!$this->getId() && !Zend_Validate::is($password , 'NotEmpty')) { | |
$errors[] = Mage::helper('customer')->__('The password cannot be empty.'); | |
} | |
- if (strlen($password) && !Zend_Validate::is($password, 'StringLength', array(6))) { | |
- $errors[] = Mage::helper('customer')->__('The minimum password length is %s', 6); | |
+ if (strlen($password) && !Zend_Validate::is($password, 'StringLength', array(self::MINIMUM_PASSWORD_LENGTH))) { | |
+ $errors[] = Mage::helper('customer') | |
+ ->__('The minimum password length is %s', self::MINIMUM_PASSWORD_LENGTH); | |
} | |
$confirmation = $this->getPasswordConfirmation(); | |
if ($password != $confirmation) { | |
@@ -867,6 +899,32 @@ class Mage_Customer_Model_Customer extends Mage_Core_Model_Abstract | |
} | |
/** | |
+ * Validate customer attribute values on password reset | |
+ * @return bool | |
+ */ | |
+ public function validateResetPassword() | |
+ { | |
+ $errors = array(); | |
+ $password = $this->getPassword(); | |
+ if (!Zend_Validate::is($password, 'NotEmpty')) { | |
+ $errors[] = Mage::helper('customer')->__('The password cannot be empty.'); | |
+ } | |
+ if (!Zend_Validate::is($password, 'StringLength', array(self::MINIMUM_PASSWORD_LENGTH))) { | |
+ $errors[] = Mage::helper('customer') | |
+ ->__('The minimum password length is %s', self::MINIMUM_PASSWORD_LENGTH); | |
+ } | |
+ $confirmation = $this->getPasswordConfirmation(); | |
+ if ($password != $confirmation) { | |
+ $errors[] = Mage::helper('customer')->__('Please make sure your passwords match.'); | |
+ } | |
+ | |
+ if (empty($errors)) { | |
+ return true; | |
+ } | |
+ return $errors; | |
+ } | |
+ | |
+ /** | |
* Import customer data from text array | |
* | |
* @param array $row | |
@@ -1339,8 +1397,8 @@ class Mage_Customer_Model_Customer extends Mage_Core_Model_Abstract | |
return true; | |
} | |
- $dayDifference = floor(($currentTimestamp - $tokenTimestamp) / (24 * 60 * 60)); | |
- if ($dayDifference >= $tokenExpirationPeriod) { | |
+ $hoursDifference = floor(($currentTimestamp - $tokenTimestamp) / (60 * 60)); | |
+ if ($hoursDifference >= $tokenExpirationPeriod) { | |
return true; | |
} | |
diff --git a/app/code/core/Mage/Customer/Model/Flowpassword.php b/app/code/core/Mage/Customer/Model/Flowpassword.php | |
new file mode 100644 | |
index 0000000..fdab3d3 | |
--- /dev/null | |
+++ b/app/code/core/Mage/Customer/Model/Flowpassword.php | |
@@ -0,0 +1,121 @@ | |
+<?php | |
+/** | |
+ * Magento | |
+ * | |
+ * NOTICE OF LICENSE | |
+ * | |
+ * This source file is subject to the Open Software License (OSL 3.0) | |
+ * that is bundled with this package in the file LICENSE.txt. | |
+ * It is also available through the world-wide-web at this URL: | |
+ * http://opensource.org/licenses/osl-3.0.php | |
+ * If you did not receive a copy of the license and are unable to | |
+ * obtain it through the world-wide-web, please send an email | |
+ * to [email protected] so we can send you a copy immediately. | |
+ * | |
+ * DISCLAIMER | |
+ * | |
+ * Do not edit or add to this file if you wish to upgrade Magento to newer | |
+ * versions in the future. If you wish to customize Magento for your | |
+ * needs please refer to http://www.magento.com for more information. | |
+ * | |
+ * @category Mage | |
+ * @package Mage_Customer | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
+ */ | |
+ | |
+ | |
+/** | |
+ * Customer flow password info Model | |
+ * | |
+ * @category Mage | |
+ * @package Mage_Customer | |
+ * @author Magento Core Team <[email protected]> | |
+ */ | |
+class Mage_Customer_Model_Flowpassword extends Mage_Core_Model_Abstract | |
+{ | |
+ protected function _construct() | |
+ { | |
+ $this->_init('customer/flowpassword'); | |
+ } | |
+ | |
+ /** | |
+ * Prepare data before save | |
+ * | |
+ * @return Mage_Core_Model_Abstract | |
+ */ | |
+ protected function _beforeSave() | |
+ { | |
+ $this->_prepareData(); | |
+ return parent::_beforeSave(); | |
+ } | |
+ | |
+ /** | |
+ * Prepare customer flow password data | |
+ * | |
+ * @return Mage_Customer_Model_Flowpassword | |
+ */ | |
+ protected function _prepareData() | |
+ { | |
+ $validatorData = Mage::getSingleton('customer/session')->getValidatorData(); | |
+ $this->setIp($validatorData[Mage_Customer_Model_Session::VALIDATOR_REMOTE_ADDR_KEY]) | |
+ ->setRequestedDate(Mage::getModel('core/date')->date()); | |
+ return $this; | |
+ } | |
+ | |
+ /** | |
+ * Check forgot password requests to times per 24 hours from 1 e-mail | |
+ * | |
+ * @param string $email | |
+ * @return bool | |
+ */ | |
+ public function checkCustomerForgotPasswordFlowEmail($email) | |
+ { | |
+ $helper = Mage::helper('customer'); | |
+ $checkForgotPasswordFlowTypes = array( | |
+ Mage_Adminhtml_Model_System_Config_Source_Customer_Forgotpassword::FORGOTPASS_FLOW_IP_EMAIL, | |
+ Mage_Adminhtml_Model_System_Config_Source_Customer_Forgotpassword::FORGOTPASS_FLOW_EMAIL | |
+ ); | |
+ | |
+ if (in_array($helper->getCustomerForgotPasswordFlowSecure(), $checkForgotPasswordFlowTypes)) { | |
+ $forgotPassword = $this->getCollection() | |
+ ->addFieldToFilter('email', array('eq' => $email)) | |
+ ->addFieldToFilter('requested_date', | |
+ array('gt' => Mage::getModel('core/date')->date(null, '-1 day'))); | |
+ | |
+ if ($forgotPassword->getSize() > $helper->getCustomerForgotPasswordEmailTimes()) { | |
+ return false; | |
+ } | |
+ } | |
+ return true; | |
+ } | |
+ | |
+ /** | |
+ * Check forgot password requests to times per hour from 1 IP | |
+ * | |
+ * @return bool | |
+ */ | |
+ public function checkCustomerForgotPasswordFlowIp() | |
+ { | |
+ $helper = Mage::helper('customer'); | |
+ $validatorData = Mage::getSingleton('customer/session')->getValidatorData(); | |
+ $remoteAddr = $validatorData[Mage_Customer_Model_Session::VALIDATOR_REMOTE_ADDR_KEY]; | |
+ $checkForgotPasswordFlowTypes = array( | |
+ Mage_Adminhtml_Model_System_Config_Source_Customer_Forgotpassword::FORGOTPASS_FLOW_IP_EMAIL, | |
+ Mage_Adminhtml_Model_System_Config_Source_Customer_Forgotpassword::FORGOTPASS_FLOW_IP | |
+ ); | |
+ | |
+ if (in_array($helper->getCustomerForgotPasswordFlowSecure(), $checkForgotPasswordFlowTypes) && $remoteAddr) { | |
+ $forgotPassword = $this->getCollection() | |
+ ->addFieldToFilter('ip', array('eq' => $remoteAddr)) | |
+ ->addFieldToFilter('requested_date', | |
+ array('gt' => Mage::getModel('core/date')->date(null, '-1 hour'))); | |
+ | |
+ if ($forgotPassword->getSize() > $helper->getCustomerForgotPasswordIpTimes()) { | |
+ return false; | |
+ } | |
+ } | |
+ return true; | |
+ } | |
+} | |
+ | |
diff --git a/app/code/core/Mage/Customer/Model/Observer.php b/app/code/core/Mage/Customer/Model/Observer.php | |
index c8bd29f..126c7ac 100644 | |
--- a/app/code/core/Mage/Customer/Model/Observer.php | |
+++ b/app/code/core/Mage/Customer/Model/Observer.php | |
@@ -141,7 +141,8 @@ class Mage_Customer_Model_Observer | |
$customerAddress = $observer->getCustomerAddress(); | |
$customer = $customerAddress->getCustomer(); | |
- if (!Mage::helper('customer/address')->isVatValidationEnabled($customer->getStore()) | |
+ $store = Mage::app()->getStore()->isAdmin() ? $customer->getStore() : null; | |
+ if (!Mage::helper('customer/address')->isVatValidationEnabled($store) | |
|| Mage::registry(self::VIV_PROCESSED_FLAG) | |
|| !$this->_canProcessAddress($customerAddress) | |
) { | |
@@ -218,4 +219,15 @@ class Mage_Customer_Model_Observer | |
); | |
$customer->save(); | |
} | |
+ | |
+ /** | |
+ * Clear customer flow password table | |
+ * | |
+ */ | |
+ public function deleteCustomerFlowPassword() | |
+ { | |
+ $connection = Mage::getSingleton('core/resource')->getConnection('write'); | |
+ $condition = array('requested_date < ?' => Mage::getModel('core/date')->date(null, '-1 day')); | |
+ $connection->delete($connection->getTableName('customer_flowpassword'), $condition); | |
+ } | |
} | |
diff --git a/app/code/core/Mage/Customer/Model/Resource/Flowpassword.php b/app/code/core/Mage/Customer/Model/Resource/Flowpassword.php | |
new file mode 100644 | |
index 0000000..4edc680 | |
--- /dev/null | |
+++ b/app/code/core/Mage/Customer/Model/Resource/Flowpassword.php | |
@@ -0,0 +1,44 @@ | |
+<?php | |
+/** | |
+ * Magento | |
+ * | |
+ * NOTICE OF LICENSE | |
+ * | |
+ * This source file is subject to the Open Software License (OSL 3.0) | |
+ * that is bundled with this package in the file LICENSE.txt. | |
+ * It is also available through the world-wide-web at this URL: | |
+ * http://opensource.org/licenses/osl-3.0.php | |
+ * If you did not receive a copy of the license and are unable to | |
+ * obtain it through the world-wide-web, please send an email | |
+ * to [email protected] so we can send you a copy immediately. | |
+ * | |
+ * DISCLAIMER | |
+ * | |
+ * Do not edit or add to this file if you wish to upgrade Magento to newer | |
+ * versions in the future. If you wish to customize Magento for your | |
+ * needs please refer to http://www.magento.com for more information. | |
+ * | |
+ * @category Mage | |
+ * @package Mage_Customer | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
+ */ | |
+ | |
+ | |
+/** | |
+ * Customer flow password info resource model | |
+ * | |
+ * @category Mage | |
+ * @package Mage_Customer | |
+ * @author Magento Core Team <[email protected]> | |
+ */ | |
+class Mage_Customer_Model_Resource_Flowpassword extends Mage_Core_Model_Resource_Db_Abstract | |
+{ | |
+ /** | |
+ * Resource initialization | |
+ */ | |
+ protected function _construct() | |
+ { | |
+ $this->_init('customer/flowpassword', 'flowpassword_id'); | |
+ } | |
+} | |
diff --git a/app/code/core/Mage/Customer/Model/Resource/Flowpassword/Collection.php b/app/code/core/Mage/Customer/Model/Resource/Flowpassword/Collection.php | |
new file mode 100644 | |
index 0000000..3050f72 | |
--- /dev/null | |
+++ b/app/code/core/Mage/Customer/Model/Resource/Flowpassword/Collection.php | |
@@ -0,0 +1,44 @@ | |
+<?php | |
+/** | |
+ * Magento | |
+ * | |
+ * NOTICE OF LICENSE | |
+ * | |
+ * This source file is subject to the Open Software License (OSL 3.0) | |
+ * that is bundled with this package in the file LICENSE.txt. | |
+ * It is also available through the world-wide-web at this URL: | |
+ * http://opensource.org/licenses/osl-3.0.php | |
+ * If you did not receive a copy of the license and are unable to | |
+ * obtain it through the world-wide-web, please send an email | |
+ * to [email protected] so we can send you a copy immediately. | |
+ * | |
+ * DISCLAIMER | |
+ * | |
+ * Do not edit or add to this file if you wish to upgrade Magento to newer | |
+ * versions in the future. If you wish to customize Magento for your | |
+ * needs please refer to http://www.magento.com for more information. | |
+ * | |
+ * @category Mage | |
+ * @package Mage_Customer | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
+ */ | |
+ | |
+ | |
+/** | |
+ * Customer flow password info collection | |
+ * | |
+ * @category Mage | |
+ * @package Mage_Customer | |
+ * @author Magento Core Team <[email protected]> | |
+ */ | |
+class Mage_Customer_Model_Resource_Flowpassword_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract | |
+{ | |
+ /** | |
+ * Resource initialization | |
+ */ | |
+ protected function _construct() | |
+ { | |
+ $this->_init('customer/flowpassword'); | |
+ } | |
+} | |
diff --git a/app/code/core/Mage/Customer/controllers/AccountController.php b/app/code/core/Mage/Customer/controllers/AccountController.php | |
index 575c687..afa6b2a 100644 | |
--- a/app/code/core/Mage/Customer/controllers/AccountController.php | |
+++ b/app/code/core/Mage/Customer/controllers/AccountController.php | |
@@ -339,7 +339,8 @@ class Mage_Customer_AccountController extends Mage_Core_Controller_Front_Action | |
$customer->sendNewAccountEmail( | |
'confirmation', | |
$session->getBeforeAuthUrl(), | |
- $store->getId() | |
+ $store->getId(), | |
+ $this->getRequest()->getPost('password') | |
); | |
$customerHelper = $this->_getHelper('customer'); | |
$session->addSuccess($this->__('Account confirmation is required. Please, check your email for the confirmation link. To resend the confirmation email please <a href="%s">click here</a>.', | |
@@ -571,7 +572,8 @@ class Mage_Customer_AccountController extends Mage_Core_Controller_Front_Action | |
$customer->sendNewAccountEmail( | |
$isJustConfirmed ? 'confirmed' : 'registered', | |
'', | |
- Mage::app()->getStore()->getId() | |
+ Mage::app()->getStore()->getId(), | |
+ $this->getRequest()->getPost('password') | |
); | |
$successUrl = $this->_getUrl('*/*/index', array('_secure' => true)); | |
@@ -722,6 +724,25 @@ class Mage_Customer_AccountController extends Mage_Core_Controller_Front_Action | |
{ | |
$email = (string) $this->getRequest()->getPost('email'); | |
if ($email) { | |
+ /** | |
+ * @var $flowPassword Mage_Customer_Model_Flowpassword | |
+ */ | |
+ $flowPassword = $this->_getModel('customer/flowpassword'); | |
+ $flowPassword->setEmail($email)->save(); | |
+ | |
+ if (!$flowPassword->checkCustomerForgotPasswordFlowEmail($email)) { | |
+ $this->_getSession() | |
+ ->addError($this->__('You have exceeded requests to times per 24 hours from 1 e-mail.')); | |
+ $this->_redirect('*/*/forgotpassword'); | |
+ return; | |
+ } | |
+ | |
+ if (!$flowPassword->checkCustomerForgotPasswordFlowIp()) { | |
+ $this->_getSession()->addError($this->__('You have exceeded requests to times per hour from 1 IP.')); | |
+ $this->_redirect('*/*/forgotpassword'); | |
+ return; | |
+ } | |
+ | |
if (!Zend_Validate::is($email, 'EmailAddress')) { | |
$this->_getSession()->setForgottenEmail($email); | |
$this->_getSession()->addError($this->__('Invalid email address.')); | |
@@ -825,7 +846,7 @@ class Mage_Customer_AccountController extends Mage_Core_Controller_Front_Action | |
$customer->setPassword($password); | |
$customer->setPasswordConfirmation($passwordConfirmation); | |
- $validationErrorMessages = $customer->validate(); | |
+ $validationErrorMessages = $customer->validateResetPassword(); | |
if (is_array($validationErrorMessages)) { | |
$errorMessages = array_merge($errorMessages, $validationErrorMessages); | |
} | |
@@ -927,7 +948,7 @@ class Mage_Customer_AccountController extends Mage_Core_Controller_Front_Action | |
if ($this->getRequest()->isPost()) { | |
/** @var $customer Mage_Customer_Model_Customer */ | |
$customer = $this->_getSession()->getCustomer(); | |
- | |
+ $customer->setOldEmail($customer->getEmail()); | |
/** @var $customerForm Mage_Customer_Model_Form */ | |
$customerForm = $this->_getModel('customer/form'); | |
$customerForm->setFormCode('customer_account_edit') | |
@@ -943,32 +964,30 @@ class Mage_Customer_AccountController extends Mage_Core_Controller_Front_Action | |
$customerForm->compactData($customerData); | |
$errors = array(); | |
+ if (!$customer->validatePassword($this->getRequest()->getPost('current_password'))) { | |
+ $errors[] = $this->__('Invalid current password'); | |
+ } | |
+ | |
+ // If email change was requested then set flag | |
+ $isChangeEmail = ($customer->getOldEmail() != $customer->getEmail()) ? true : false; | |
+ $customer->setIsChangeEmail($isChangeEmail); | |
+ | |
// If password change was requested then add it to common validation scheme | |
- if ($this->getRequest()->getParam('change_password')) { | |
- $currPass = $this->getRequest()->getPost('current_password'); | |
+ $customer->setIsChangePassword($this->getRequest()->getParam('change_password')); | |
+ | |
+ if ($customer->getIsChangePassword()) { | |
$newPass = $this->getRequest()->getPost('password'); | |
$confPass = $this->getRequest()->getPost('confirmation'); | |
- $oldPass = $this->_getSession()->getCustomer()->getPasswordHash(); | |
- if ( $this->_getHelper('core/string')->strpos($oldPass, ':')) { | |
- list($_salt, $salt) = explode(':', $oldPass); | |
- } else { | |
- $salt = false; | |
- } | |
- | |
- if ($customer->hashPassword($currPass, $salt) == $oldPass) { | |
- if (strlen($newPass)) { | |
- /** | |
- * Set entered password and its confirmation - they | |
- * will be validated later to match each other and be of right length | |
- */ | |
- $customer->setPassword($newPass); | |
- $customer->setPasswordConfirmation($confPass); | |
- } else { | |
- $errors[] = $this->__('New password field cannot be empty.'); | |
- } | |
+ if (strlen($newPass)) { | |
+ /** | |
+ * Set entered password and its confirmation - they | |
+ * will be validated later to match each other and be of right length | |
+ */ | |
+ $customer->setPassword($newPass); | |
+ $customer->setPasswordConfirmation($confPass); | |
} else { | |
- $errors[] = $this->__('Invalid current password'); | |
+ $errors[] = $this->__('New password field cannot be empty.'); | |
} | |
} | |
@@ -990,10 +1009,21 @@ class Mage_Customer_AccountController extends Mage_Core_Controller_Front_Action | |
try { | |
$customer->cleanPasswordsValidationData(); | |
+ | |
+ // Reset all password reset tokens if all data was sufficient and correct on email change | |
+ if ($customer->getIsChangeEmail()) { | |
+ $customer->setRpToken(null); | |
+ $customer->setRpTokenCreatedAt(null); | |
+ } | |
+ | |
$customer->save(); | |
$this->_getSession()->setCustomer($customer) | |
->addSuccess($this->__('The account information has been saved.')); | |
+ if ($customer->getIsChangeEmail() || $customer->getIsChangePassword()) { | |
+ $customer->sendChangedPasswordOrEmail(); | |
+ } | |
+ | |
$this->_redirect('customer/account'); | |
return; | |
} catch (Mage_Core_Exception $e) { | |
diff --git a/app/code/core/Mage/Customer/data/customer_setup/data-upgrade-1.6.2.0.4-1.6.2.0.5.php b/app/code/core/Mage/Customer/data/customer_setup/data-upgrade-1.6.2.0.4-1.6.2.0.5.php | |
new file mode 100644 | |
index 0000000..0c973c3 | |
--- /dev/null | |
+++ b/app/code/core/Mage/Customer/data/customer_setup/data-upgrade-1.6.2.0.4-1.6.2.0.5.php | |
@@ -0,0 +1,78 @@ | |
+<?php | |
+/** | |
+ * Magento | |
+ * | |
+ * NOTICE OF LICENSE | |
+ * | |
+ * This source file is subject to the Open Software License (OSL 3.0) | |
+ * that is bundled with this package in the file LICENSE.txt. | |
+ * It is also available through the world-wide-web at this URL: | |
+ * http://opensource.org/licenses/osl-3.0.php | |
+ * If you did not receive a copy of the license and are unable to | |
+ * obtain it through the world-wide-web, please send an email | |
+ * to [email protected] so we can send you a copy immediately. | |
+ * | |
+ * DISCLAIMER | |
+ * | |
+ * Do not edit or add to this file if you wish to upgrade Magento to newer | |
+ * versions in the future. If you wish to customize Magento for your | |
+ * needs please refer to http://www.magento.com for more information. | |
+ * | |
+ * @category Mage | |
+ * @package Mage_Customer | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
+ */ | |
+ | |
+/** @var $installer Mage_Customer_Model_Entity_Setup */ | |
+$installer = $this; | |
+ | |
+$installer->startSetup(); | |
+$connection = $installer->getConnection(); | |
+ | |
+$eavConfig = Mage::getSingleton('eav/config'); | |
+$customerEntityTypeId = $eavConfig->getEntityType('customer')->getEntityTypeId(); | |
+$customerAddressEntityTypeId = $eavConfig->getEntityType('customer_address')->getEntityTypeId(); | |
+ | |
+$entityTypeIds = array($customerAddressEntityTypeId, $customerEntityTypeId); | |
+ | |
+$attributes = Mage::getResourceModel('eav/entity_attribute_collection') | |
+ ->addFieldToFilter('frontend_input', 'multiselect') | |
+ ->addFieldToFilter('entity_type_id', array('in' => $entityTypeIds)) | |
+ ->getItems(); | |
+ | |
+foreach ($attributes as $attribute) { | |
+ $entityTypeId = $attribute->getEntityTypeId(); | |
+ $attributeId = $attribute->getId(); | |
+ $attributeTableOld = $installer->getAttributeTable($entityTypeId, $attributeId); | |
+ | |
+ $installer->updateAttribute($entityTypeId, $attributeId, 'backend_type', 'text'); | |
+ | |
+ $attributeTableNew = $installer->getAttributeTable($entityTypeId, $attributeId); | |
+ | |
+ if ($attributeTableOld != $attributeTableNew) { | |
+ $connection->disableTableKeys($attributeTableOld) | |
+ ->disableTableKeys($attributeTableNew); | |
+ | |
+ $select = $connection->select() | |
+ ->from($attributeTableOld, array('entity_type_id', 'attribute_id', 'entity_id', 'value')) | |
+ ->where('entity_type_id = ?', $entityTypeId) | |
+ ->where('attribute_id = ?', $attributeId); | |
+ | |
+ $query = $select->insertFromSelect($attributeTableNew, | |
+ array('entity_type_id', 'attribute_id', 'entity_id', 'value') | |
+ ); | |
+ | |
+ $connection->query($query); | |
+ | |
+ $connection->delete($attributeTableOld, | |
+ $connection->quoteInto('entity_type_id = ?', $entityTypeId) | |
+ . $connection->quoteInto(' AND attribute_id = ?', $attributeId) | |
+ ); | |
+ | |
+ $connection->enableTableKeys($attributeTableOld) | |
+ ->enableTableKeys($attributeTableNew); | |
+ } | |
+} | |
+ | |
+$installer->endSetup(); | |
diff --git a/app/code/core/Mage/Customer/etc/config.xml b/app/code/core/Mage/Customer/etc/config.xml | |
index d2ea8d9..0abe250 100644 | |
--- a/app/code/core/Mage/Customer/etc/config.xml | |
+++ b/app/code/core/Mage/Customer/etc/config.xml | |
@@ -28,7 +28,7 @@ | |
<config> | |
<modules> | |
<Mage_Customer> | |
- <version>1.6.2.0.4</version> | |
+ <version>1.6.2.0.5</version> | |
</Mage_Customer> | |
</modules> | |
<admin> | |
@@ -378,6 +378,9 @@ | |
<form_attribute> | |
<table>customer_form_attribute</table> | |
</form_attribute> | |
+ <flowpassword> | |
+ <table>customer_flowpassword</table> | |
+ </flowpassword> | |
</entities> | |
</customer_resource> | |
</models> | |
@@ -416,6 +419,11 @@ | |
<file>password_new.html</file> | |
<type>html</type> | |
</customer_password_remind_email_template> | |
+ <customer_changed_account_password_or_email_template translate="label" module="customer"> | |
+ <label>Changed Password or Email</label> | |
+ <file>password_or_email_changed.html</file> | |
+ <type>html</type> | |
+ </customer_changed_account_password_or_email_template> | |
</email> | |
</template> | |
<events> | |
@@ -512,6 +520,10 @@ | |
<email_confirmed_template>customer_create_account_email_confirmed_template</email_confirmed_template> | |
<vat_frontend_visibility>0</vat_frontend_visibility> | |
</create_account> | |
+ <changed_account> | |
+ <password_or_email_identity>general</password_or_email_identity> | |
+ <password_or_email_template>customer_changed_account_password_or_email_template</password_or_email_template> | |
+ </changed_account> | |
<default> | |
<group>1</group> | |
</default> | |
@@ -519,7 +531,7 @@ | |
<forgot_email_identity>support</forgot_email_identity> | |
<forgot_email_template>customer_password_forgot_email_template</forgot_email_template> | |
<remind_email_template>customer_password_remind_email_template</remind_email_template> | |
- <reset_link_expiration_period>1</reset_link_expiration_period> | |
+ <reset_link_expiration_period>2</reset_link_expiration_period> | |
<require_admin_user_to_change_user_password>1</require_admin_user_to_change_user_password> | |
</password> | |
<address> | |
@@ -576,5 +588,24 @@ T: {{var telephone}} | |
<js_template><![CDATA[#{prefix} #{firstname} #{middlename} #{lastname} #{suffix}<br/>#{company}<br/>#{street0}<br/>#{street1}<br/>#{street2}<br/>#{street3}<br/>#{city}, #{region}, #{postcode}<br/>#{country_id}<br/>T: #{telephone}<br/>F: #{fax}<br/>VAT: #{vat_id}]]></js_template> | |
</address_templates> | |
</customer> | |
+ <admin> | |
+ <security> | |
+ <forgot_password_flow_secure>1</forgot_password_flow_secure> | |
+ <forgot_password_email_times>5</forgot_password_email_times> | |
+ <forgot_password_ip_times>5</forgot_password_ip_times> | |
+ </security> | |
+ </admin> | |
</default> | |
+ <crontab> | |
+ <jobs> | |
+ <customer_flowpassword> | |
+ <schedule> | |
+ <cron_expr>0 0 1 * *</cron_expr> | |
+ </schedule> | |
+ <run> | |
+ <model>mage_customer/observer::deleteCustomerFlowPassword</model> | |
+ </run> | |
+ </customer_flowpassword> | |
+ </jobs> | |
+ </crontab> | |
</config> | |
diff --git a/app/code/core/Mage/Customer/etc/system.xml b/app/code/core/Mage/Customer/etc/system.xml | |
index 0883dad..5930bb1 100644 | |
--- a/app/code/core/Mage/Customer/etc/system.xml | |
+++ b/app/code/core/Mage/Customer/etc/system.xml | |
@@ -250,6 +250,34 @@ | |
</generate_human_friendly_id> | |
</fields> | |
</create_account> | |
+ <changed_account translate="label"> | |
+ <label>Change Account Data</label> | |
+ <frontend_type>text</frontend_type> | |
+ <sort_order>25</sort_order> | |
+ <show_in_default>1</show_in_default> | |
+ <show_in_website>1</show_in_website> | |
+ <show_in_store>1</show_in_store> | |
+ <fields> | |
+ <password_or_email_identity translate="label"> | |
+ <label>Email Sender</label> | |
+ <frontend_type>select</frontend_type> | |
+ <source_model>adminhtml/system_config_source_email_identity</source_model> | |
+ <sort_order>10</sort_order> | |
+ <show_in_default>1</show_in_default> | |
+ <show_in_website>1</show_in_website> | |
+ <show_in_store>1</show_in_store> | |
+ </password_or_email_identity> | |
+ <password_or_email_template translate="label"> | |
+ <label>Changed Email or Password Email Template</label> | |
+ <frontend_type>select</frontend_type> | |
+ <source_model>adminhtml/system_config_source_email_template</source_model> | |
+ <sort_order>20</sort_order> | |
+ <show_in_default>1</show_in_default> | |
+ <show_in_website>1</show_in_website> | |
+ <show_in_store>1</show_in_store> | |
+ </password_or_email_template> | |
+ </fields> | |
+ </changed_account> | |
<password translate="label"> | |
<label>Password Options</label> | |
<frontend_type>text</frontend_type> | |
@@ -286,7 +314,7 @@ | |
<show_in_store>1</show_in_store> | |
</forgot_email_identity> | |
<reset_link_expiration_period translate="label comment"> | |
- <label>Recovery Link Expiration Period (days)</label> | |
+ <label>Recovery Link Expiration Period (hours)</label> | |
<comment>Please enter a number 1 or greater in this field.</comment> | |
<frontend_type>text</frontend_type> | |
<validate>required-entry validate-digits validate-digits-range digits-range-1-</validate> | |
@@ -492,5 +520,40 @@ | |
</store_information> | |
</groups> | |
</general> | |
+ <admin> | |
+ <groups> | |
+ <security> | |
+ <fields> | |
+ <forgot_password_flow_secure translate="label"> | |
+ <label>Forgot password flow secure</label> | |
+ <frontend_type>select</frontend_type> | |
+ <source_model>adminhtml/system_config_source_customer_forgotpassword</source_model> | |
+ <sort_order>140</sort_order> | |
+ <show_in_default>1</show_in_default> | |
+ <show_in_website>1</show_in_website> | |
+ <show_in_store>1</show_in_store> | |
+ </forgot_password_flow_secure> | |
+ <forgot_password_ip_times translate="label comment"> | |
+ <label>Forgot password requests to times per hour from 1 IP</label> | |
+ <frontend_type>text</frontend_type> | |
+ <sort_order>150</sort_order> | |
+ <show_in_default>1</show_in_default> | |
+ <show_in_website>1</show_in_website> | |
+ <show_in_store>1</show_in_store> | |
+ <depends><forgot_password_flow_secure separator=",">1,2</forgot_password_flow_secure></depends> | |
+ </forgot_password_ip_times> | |
+ <forgot_password_email_times translate="label"> | |
+ <label>Forgot password requests to times per 24 hours from 1 e-mail</label> | |
+ <frontend_type>text</frontend_type> | |
+ <sort_order>160</sort_order> | |
+ <show_in_default>1</show_in_default> | |
+ <show_in_website>1</show_in_website> | |
+ <show_in_store>1</show_in_store> | |
+ <depends><forgot_password_flow_secure separator=",">1,3</forgot_password_flow_secure></depends> | |
+ </forgot_password_email_times> | |
+ </fields> | |
+ </security> | |
+ </groups> | |
+ </admin> | |
</sections> | |
</config> | |
diff --git a/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.2.0.4-1.6.2.0.5.php b/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.2.0.4-1.6.2.0.5.php | |
new file mode 100644 | |
index 0000000..8f5d569 | |
--- /dev/null | |
+++ b/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.2.0.4-1.6.2.0.5.php | |
@@ -0,0 +1,58 @@ | |
+<?php | |
+/** | |
+ * Magento | |
+ * | |
+ * NOTICE OF LICENSE | |
+ * | |
+ * This source file is subject to the Open Software License (OSL 3.0) | |
+ * that is bundled with this package in the file LICENSE.txt. | |
+ * It is also available through the world-wide-web at this URL: | |
+ * http://opensource.org/licenses/osl-3.0.php | |
+ * If you did not receive a copy of the license and are unable to | |
+ * obtain it through the world-wide-web, please send an email | |
+ * to [email protected] so we can send you a copy immediately. | |
+ * | |
+ * DISCLAIMER | |
+ * | |
+ * Do not edit or add to this file if you wish to upgrade Magento to newer | |
+ * versions in the future. If you wish to customize Magento for your | |
+ * needs please refer to http://www.magento.com for more information. | |
+ * | |
+ * @category Mage | |
+ * @package Mage_Customer | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
+ */ | |
+ | |
+/* @var $installer Mage_Customer_Model_Entity_Setup */ | |
+$installer = $this; | |
+$installer->startSetup(); | |
+ | |
+$table = $installer->getConnection() | |
+ ->newTable($installer->getTable('customer/flowpassword')) | |
+ ->addColumn('flowpassword_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( | |
+ 'identity' => true, | |
+ 'unsigned' => true, | |
+ 'nullable' => false, | |
+ 'primary' => true, | |
+ ), 'Flow password Id') | |
+ ->addColumn('ip', Varien_Db_Ddl_Table::TYPE_VARCHAR, 50, array( | |
+ 'nullable' => false, | |
+ ), 'User IP') | |
+ ->addColumn('email', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, array( | |
+ 'nullable' => false, | |
+ ), 'Requested email for change') | |
+ ->addColumn('requested_date', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, array( | |
+ 'nullable' => false, | |
+ 'default' => '0000-00-00 00:00:00', | |
+ ), 'Requested date for change') | |
+ ->addIndex($installer->getIdxName('customer/flowpassword', array('email')), | |
+ array('email')) | |
+ ->addIndex($installer->getIdxName('customer/flowpassword', array('ip')), | |
+ array('ip')) | |
+ ->addIndex($installer->getIdxName('customer/flowpassword', array('requested_date')), | |
+ array('requested_date')) | |
+ ->setComment('Customer flow password'); | |
+$installer->getConnection()->createTable($table); | |
+ | |
+$installer->endSetup(); | |
diff --git a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Options/Abstract.php b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Options/Abstract.php | |
index ad78eab..c682ae7 100644 | |
--- a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Options/Abstract.php | |
+++ b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Options/Abstract.php | |
@@ -170,12 +170,11 @@ abstract class Mage_Eav_Block_Adminhtml_Attribute_Edit_Options_Abstract extends | |
public function getLabelValues() | |
{ | |
$values = array(); | |
- $values[0] = $this->getAttributeObject()->getFrontend()->getLabel(); | |
- // it can be array and cause bug | |
$frontendLabel = $this->getAttributeObject()->getFrontend()->getLabel(); | |
if (is_array($frontendLabel)) { | |
- $frontendLabel = array_shift($frontendLabel); | |
+ return $frontendLabel; | |
} | |
+ $values[0] = $frontendLabel; | |
$storeLabels = $this->getAttributeObject()->getStoreLabels(); | |
foreach ($this->getStores() as $store) { | |
if ($store->getId() != 0) { | |
diff --git a/app/code/core/Mage/Eav/Model/Entity/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Abstract.php | |
index 21a9199..1d6a98c 100644 | |
--- a/app/code/core/Mage/Eav/Model/Entity/Abstract.php | |
+++ b/app/code/core/Mage/Eav/Model/Entity/Abstract.php | |
@@ -808,13 +808,13 @@ abstract class Mage_Eav_Model_Entity_Abstract extends Mage_Core_Model_Resource_A | |
* | |
* @see Mage_Eav_Model_Entity_Abstract::getAttribute for $attribute format | |
* @param integer|string|Mage_Eav_Model_Entity_Attribute_Abstract $attribute | |
+ * | |
* @return boolean | |
*/ | |
public function isAttributeStatic($attribute) | |
{ | |
- $attrInstance = $this->getAttribute($attribute); | |
- $attrBackendStatic = $attrInstance->getBackend()->isStatic(); | |
- return $attrInstance && $attrBackendStatic; | |
+ $attrInstance = $this->getAttribute($attribute); | |
+ return $attrInstance && $attrInstance->getBackend()->isStatic(); | |
} | |
/** | |
@@ -1309,9 +1309,8 @@ abstract class Mage_Eav_Model_Entity_Abstract extends Mage_Core_Model_Resource_A | |
$this->_attributeValuesToSave = array(); | |
$this->_attributeValuesToDelete = array(); | |
- extract($saveData); | |
/** | |
- * Import variables into the current symbol table from save data array | |
+ * Import variables from save data array | |
* | |
* @see Mage_Eav_Model_Entity_Attribute_Abstract::_collectSaveData() | |
* | |
@@ -1321,6 +1320,12 @@ abstract class Mage_Eav_Model_Entity_Abstract extends Mage_Core_Model_Resource_A | |
* @var array $update | |
* @var array $delete | |
*/ | |
+ $newObject = $saveData['newObject']; | |
+ $entityRow = $saveData['entityRow']; | |
+ $insert = $saveData['insert']; | |
+ $update = $saveData['update']; | |
+ $delete = $saveData['delete']; | |
+ | |
$adapter = $this->_getWriteAdapter(); | |
$insertEntity = true; | |
$entityTable = $this->getEntityTable(); | |
diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute.php b/app/code/core/Mage/Eav/Model/Entity/Attribute.php | |
index 342ea31..0b11d5d 100644 | |
--- a/app/code/core/Mage/Eav/Model/Entity/Attribute.php | |
+++ b/app/code/core/Mage/Eav/Model/Entity/Attribute.php | |
@@ -225,12 +225,12 @@ class Mage_Eav_Model_Entity_Attribute extends Mage_Eav_Model_Entity_Attribute_Ab | |
case 'text': | |
case 'gallery': | |
case 'media_image': | |
- case 'multiselect': | |
$field = 'varchar'; | |
break; | |
case 'image': | |
case 'textarea': | |
+ case 'multiselect': | |
$field = 'text'; | |
break; | |
@@ -272,6 +272,7 @@ class Mage_Eav_Model_Entity_Attribute extends Mage_Eav_Model_Entity_Attribute_Ab | |
case 'text': | |
case 'price': | |
case 'image': | |
+ case 'weight': | |
$field = 'default_value_text'; | |
break; | |
diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php | |
index 3ac49bd..8f43e9c 100644 | |
--- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php | |
+++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php | |
@@ -383,7 +383,10 @@ abstract class Mage_Eav_Model_Entity_Attribute_Abstract extends Mage_Core_Model_ | |
$source = Mage::getModel($this->getSourceModel()); | |
if (!$source) { | |
throw Mage::exception('Mage_Eav', | |
- Mage::helper('eav')->__('Source model "%s" not found for attribute "%s"',$this->getSourceModel(), $this->getAttributeCode()) | |
+ Mage::helper('eav')->__('Source model "%s" not found for attribute "%s"', | |
+ $this->getSourceModel(), | |
+ $this->getAttributeCode() | |
+ ) | |
); | |
} | |
$this->_source = $source->setAttribute($this); | |
@@ -628,8 +631,14 @@ abstract class Mage_Eav_Model_Entity_Attribute_Abstract extends Mage_Core_Model_ | |
break; | |
} | |
$prop = $describe[$this->getAttributeCode()]; | |
+ $type = $prop['DATA_TYPE']; | |
+ if (isset($prop['PRECISION']) && isset($prop['SCALE'])) { | |
+ $type .= "({$prop['PRECISION']},{$prop['SCALE']})"; | |
+ } else { | |
+ $type .= (isset($prop['LENGTH']) && $prop['LENGTH']) ? "({$prop['LENGTH']})" : ""; | |
+ } | |
$columns[$this->getAttributeCode()] = array( | |
- 'type' => $prop['DATA_TYPE'] . ($prop['LENGTH'] ? "({$prop['LENGTH']})" : ""), | |
+ 'type' => $type, | |
'unsigned' => $prop['UNSIGNED'] ? true: false, | |
'is_null' => $prop['NULLABLE'], | |
'default' => $prop['DEFAULT'], | |
diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Table.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Table.php | |
index 91c7061..9b0ee24 100644 | |
--- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Table.php | |
+++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Table.php | |
@@ -152,7 +152,7 @@ class Mage_Eav_Model_Entity_Attribute_Source_Table extends Mage_Eav_Model_Entity | |
if (Mage::helper('core')->useDbCompatibleMode()) { | |
$columns[$attributeCode] = array( | |
- 'type' => $isMulti ? 'varchar(255)' : 'int', | |
+ 'type' => $isMulti ? 'text' : 'int', | |
'unsigned' => false, | |
'is_null' => true, | |
'default' => null, | |
@@ -171,7 +171,7 @@ class Mage_Eav_Model_Entity_Attribute_Source_Table extends Mage_Eav_Model_Entity | |
$type = ($isMulti) ? Varien_Db_Ddl_Table::TYPE_TEXT : Varien_Db_Ddl_Table::TYPE_INTEGER; | |
$columns[$attributeCode] = array( | |
'type' => $type, | |
- 'length' => $isMulti ? '255' : null, | |
+ 'length' => $isMulti ? '65535' : null, | |
'unsigned' => false, | |
'nullable' => true, | |
'default' => null, | |
diff --git a/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php | |
index 97adcdd..e0924bf 100644 | |
--- a/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php | |
+++ b/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php | |
@@ -918,6 +918,7 @@ abstract class Mage_Eav_Model_Entity_Collection_Abstract extends Varien_Data_Col | |
/** | |
* Retrive all ids sql | |
* | |
+ * @deprecated | |
* @return array | |
*/ | |
public function getAllIdsSql() | |
@@ -1409,6 +1410,7 @@ abstract class Mage_Eav_Model_Entity_Collection_Abstract extends Varien_Data_Col | |
foreach ($attribute as $attr) { | |
parent::setOrder($attr, $dir); | |
} | |
+ return $this; | |
} | |
return parent::setOrder($attribute, $dir); | |
} | |
diff --git a/app/code/core/Mage/ImportExport/Helper/Data.php b/app/code/core/Mage/ImportExport/Helper/Data.php | |
index 0c68fa7..89ff041 100644 | |
--- a/app/code/core/Mage/ImportExport/Helper/Data.php | |
+++ b/app/code/core/Mage/ImportExport/Helper/Data.php | |
@@ -36,8 +36,9 @@ class Mage_ImportExport_Helper_Data extends Mage_Core_Helper_Data | |
/** | |
* XML path for config data | |
*/ | |
- const XML_PATH_EXPORT_LOCAL_VALID_PATH = 'general/file/importexport_local_valid_paths'; | |
- const XML_PATH_BUNCH_SIZE = 'general/file/bunch_size'; | |
+ const XML_PATH_EXPORT_LOCAL_VALID_PATH = 'general/file/importexport_local_valid_paths'; | |
+ const XML_PATH_BUNCH_SIZE = 'general/file/bunch_size'; | |
+ const XML_PATH_IMPORT_CONFIGURABLE_PAGE_SIZE = 'system/import_csv/configurable_page_size'; | |
/** | |
* Maximum size of uploaded files. | |
@@ -69,4 +70,14 @@ class Mage_ImportExport_Helper_Data extends Mage_Core_Helper_Data | |
{ | |
return (int)Mage::getStoreConfig(self::XML_PATH_BUNCH_SIZE); | |
} | |
+ | |
+ /** | |
+ * Get page size for import configurable products | |
+ * | |
+ * @return int | |
+ */ | |
+ public function getImportConfigurablePageSize() | |
+ { | |
+ return (int)Mage::getStoreConfig(self::XML_PATH_IMPORT_CONFIGURABLE_PAGE_SIZE); | |
+ } | |
} | |
diff --git a/app/code/core/Mage/ImportExport/Model/Export.php b/app/code/core/Mage/ImportExport/Model/Export.php | |
index 0fb811e..0e13925 100644 | |
--- a/app/code/core/Mage/ImportExport/Model/Export.php | |
+++ b/app/code/core/Mage/ImportExport/Model/Export.php | |
@@ -136,7 +136,9 @@ class Mage_ImportExport_Model_Export extends Mage_ImportExport_Model_Abstract | |
} | |
/** | |
- * Export data. | |
+ * Export data and return contents of temporary file. | |
+ * | |
+ * @deprecated after ver 1.9.2.4 use $this->exportFile() instead | |
* | |
* @throws Mage_Core_Exception | |
* @return string | |
@@ -169,6 +171,50 @@ class Mage_ImportExport_Model_Export extends Mage_ImportExport_Model_Abstract | |
} | |
/** | |
+ * Export data and return temporary file through array. | |
+ * | |
+ * This method will return following array: | |
+ * | |
+ * array( | |
+ * 'rows' => count of written rows, | |
+ * 'value' => path to created file, | |
+ * 'type' => 'file' | |
+ * ) | |
+ * | |
+ * @throws Mage_Core_Exception | |
+ * @return array | |
+ */ | |
+ public function exportFile() | |
+ { | |
+ if (isset($this->_data[self::FILTER_ELEMENT_GROUP])) { | |
+ $this->addLogComment(Mage::helper('importexport')->__('Begin export of %s', $this->getEntity())); | |
+ $result = $this->_getEntityAdapter() | |
+ ->setWriter($this->_getWriter()) | |
+ ->exportFile(); | |
+ | |
+ if (isset($result['rows'])) { | |
+ if (!$result['rows']) { | |
+ Mage::throwException( | |
+ Mage::helper('importexport')->__('There is no data for export') | |
+ ); | |
+ } | |
+ if ($result['rows']) { | |
+ $this->addLogComment(array( | |
+ Mage::helper('importexport')->__('Exported %s rows.', $result['rows']), | |
+ Mage::helper('importexport')->__('Export has been done.') | |
+ )); | |
+ } | |
+ } | |
+ | |
+ return $result; | |
+ } else { | |
+ Mage::throwException( | |
+ Mage::helper('importexport')->__('No filter data provided') | |
+ ); | |
+ } | |
+ } | |
+ | |
+ /** | |
* Clean up already loaded attribute collection. | |
* | |
* @param Mage_Eav_Model_Resource_Entity_Attribute_Collection $collection | |
diff --git a/app/code/core/Mage/ImportExport/Model/Export/Adapter/Abstract.php b/app/code/core/Mage/ImportExport/Model/Export/Adapter/Abstract.php | |
index 178996b..f720748 100644 | |
--- a/app/code/core/Mage/ImportExport/Model/Export/Adapter/Abstract.php | |
+++ b/app/code/core/Mage/ImportExport/Model/Export/Adapter/Abstract.php | |
@@ -48,6 +48,13 @@ abstract class Mage_ImportExport_Model_Export_Adapter_Abstract | |
protected $_headerCols = null; | |
/** | |
+ * Count of rows | |
+ * | |
+ * @var int | |
+ */ | |
+ protected $_rowsCount = 0; | |
+ | |
+ /** | |
* Adapter object constructor. | |
* | |
* @param string $destination OPTIONAL Destination file path. | |
@@ -125,6 +132,16 @@ abstract class Mage_ImportExport_Model_Export_Adapter_Abstract | |
} | |
/** | |
+ * Get count of wrote lines | |
+ * | |
+ * @return int | |
+ */ | |
+ public function getRowsCount() | |
+ { | |
+ return $this->_rowsCount; | |
+ } | |
+ | |
+ /** | |
* Set column names. | |
* | |
* @param array $headerCols | |
diff --git a/app/code/core/Mage/ImportExport/Model/Export/Adapter/Csv.php b/app/code/core/Mage/ImportExport/Model/Export/Adapter/Csv.php | |
index c653750..75f98ff 100644 | |
--- a/app/code/core/Mage/ImportExport/Model/Export/Adapter/Csv.php | |
+++ b/app/code/core/Mage/ImportExport/Model/Export/Adapter/Csv.php | |
@@ -125,6 +125,8 @@ class Mage_ImportExport_Model_Export_Adapter_Csv extends Mage_ImportExport_Model | |
$this->_enclosure | |
); | |
+ $this->_rowsCount++; | |
+ | |
return $this; | |
} | |
diff --git a/app/code/core/Mage/ImportExport/Model/Export/Entity/Abstract.php b/app/code/core/Mage/ImportExport/Model/Export/Entity/Abstract.php | |
index 88ef03a..3a86669 100644 | |
--- a/app/code/core/Mage/ImportExport/Model/Export/Entity/Abstract.php | |
+++ b/app/code/core/Mage/ImportExport/Model/Export/Entity/Abstract.php | |
@@ -154,6 +154,27 @@ abstract class Mage_ImportExport_Model_Export_Entity_Abstract | |
protected $_writer; | |
/** | |
+ * Array of pairs store ID to its code. | |
+ * | |
+ * @var array | |
+ */ | |
+ protected $_storeIdToCode = array(); | |
+ | |
+ /** | |
+ * Store Id-to-website | |
+ * | |
+ * @var array | |
+ */ | |
+ protected $_storeIdToWebsiteId = array(); | |
+ | |
+ /** | |
+ * Website ID-to-code. | |
+ * | |
+ * @var array | |
+ */ | |
+ protected $_websiteIdToCode = array(); | |
+ | |
+ /** | |
* Constructor. | |
* | |
* @return void | |
@@ -166,6 +187,20 @@ abstract class Mage_ImportExport_Model_Export_Entity_Abstract | |
} | |
/** | |
+ * Initialize website values. | |
+ * | |
+ * @return Mage_ImportExport_Model_Export_Entity_Customer | |
+ */ | |
+ protected function _initWebsites() | |
+ { | |
+ /** @var $website Mage_Core_Model_Website */ | |
+ foreach (Mage::app()->getWebsites(true) as $website) { | |
+ $this->_websiteIdToCode[$website->getId()] = $website->getCode(); | |
+ } | |
+ return $this; | |
+ } | |
+ | |
+ /** | |
* Initialize stores hash. | |
* | |
* @return Mage_ImportExport_Model_Export_Entity_Abstract | |
@@ -173,9 +208,11 @@ abstract class Mage_ImportExport_Model_Export_Entity_Abstract | |
protected function _initStores() | |
{ | |
foreach (Mage::app()->getStores(true) as $store) { | |
- $this->_storeIdToCode[$store->getId()] = $store->getCode(); | |
+ $this->_storeIdToCode[$store->getId()] = $store->getCode(); | |
+ $this->_storeIdToWebsiteId[$store->getId()] = $store->getWebsiteId(); | |
} | |
ksort($this->_storeIdToCode); // to ensure that 'admin' store (ID is zero) goes first | |
+ sort($this->_storeIdToWebsiteId); | |
return $this; | |
} | |
@@ -319,11 +356,29 @@ abstract class Mage_ImportExport_Model_Export_Entity_Abstract | |
/** | |
* Export process. | |
* | |
+ * @deprecated after ver 1.9.2.4 use $this->exportFile() instead | |
+ * | |
* @return string | |
*/ | |
abstract public function export(); | |
/** | |
+ * Export data and return temporary file through array. | |
+ * | |
+ * This method will return following array: | |
+ * | |
+ * array( | |
+ * 'rows' => count of written rows, | |
+ * 'value' => path to created file, | |
+ * 'type' => 'file' | |
+ * ) | |
+ * | |
+ * @throws Mage_Core_Exception | |
+ * @return array | |
+ */ | |
+ abstract function exportFile(); | |
+ | |
+ /** | |
* Clean up attribute collection. | |
* | |
* @param Mage_Eav_Model_Resource_Entity_Attribute_Collection $collection | |
@@ -367,7 +422,8 @@ abstract class Mage_ImportExport_Model_Export_Entity_Abstract | |
try { | |
foreach ($attribute->getSource()->getAllOptions(false) as $option) { | |
- foreach (is_array($option['value']) ? $option['value'] : array($option) as $innerOption) { | |
+ $innerOptions = is_array($option['value']) ? $option['value'] : array($option); | |
+ foreach ($innerOptions as $innerOption) { | |
if (strlen($innerOption['value'])) { // skip ' -- Please Select -- ' option | |
$options[$innerOption['value']] = $innerOption[$index]; | |
} | |
diff --git a/app/code/core/Mage/ImportExport/Model/Export/Entity/Customer.php b/app/code/core/Mage/ImportExport/Model/Export/Entity/Customer.php | |
index 8ea2c32..4c4b67d 100644 | |
--- a/app/code/core/Mage/ImportExport/Model/Export/Entity/Customer.php | |
+++ b/app/code/core/Mage/ImportExport/Model/Export/Entity/Customer.php | |
@@ -76,20 +76,6 @@ class Mage_ImportExport_Model_Export_Entity_Customer extends Mage_ImportExport_M | |
protected $_permanentAttributes = array(self::COL_EMAIL, self::COL_WEBSITE, self::COL_STORE); | |
/** | |
- * Array of pairs store ID to its code. | |
- * | |
- * @var array | |
- */ | |
- protected $_storeIdToCode = array(); | |
- | |
- /** | |
- * Website ID-to-code. | |
- * | |
- * @var array | |
- */ | |
- protected $_websiteIdToCode = array(); | |
- | |
- /** | |
* Constructor. | |
* | |
* @return void | |
@@ -132,51 +118,97 @@ class Mage_ImportExport_Model_Export_Entity_Customer extends Mage_ImportExport_M | |
} | |
/** | |
- * Export process. | |
+ * Export process and return contents of temporary file | |
+ * | |
+ * @deprecated after ver 1.9.2.4 use $this->exportFile() instead | |
* | |
* @return string | |
*/ | |
public function export() | |
{ | |
- $collection = $this->_prepareEntityCollection(Mage::getResourceModel('customer/customer_collection')); | |
+ $this->_prepareExport(); | |
+ | |
+ return $this->getWriter()->getContents(); | |
+ } | |
+ | |
+ /** | |
+ * Export process and return temporary file through array | |
+ * | |
+ * This method will return following array: | |
+ * | |
+ * array( | |
+ * 'rows' => count of written rows, | |
+ * 'value' => path to created file | |
+ * ) | |
+ * | |
+ * @return array | |
+ */ | |
+ public function exportFile() | |
+ { | |
+ $this->_prepareExport(); | |
+ | |
+ $writer = $this->getWriter(); | |
+ | |
+ return array( | |
+ 'rows' => $writer->getRowsCount(), | |
+ 'value' => $writer->getDestination() | |
+ ); | |
+ } | |
+ | |
+ /** | |
+ * Prepare data for export and write its to temporary file through writer. | |
+ * | |
+ * @return void | |
+ */ | |
+ protected function _prepareExport() | |
+ { | |
+ $collection = $this->_prepareEntityCollection(Mage::getResourceModel('customer/customer_collection')); | |
$validAttrCodes = $this->_getExportAttrCodes(); | |
$writer = $this->getWriter(); | |
$defaultAddrMap = Mage_ImportExport_Model_Import_Entity_Customer_Address::getDefaultAddressAttrMapping(); | |
// prepare address data | |
- $addrAttributes = array(); | |
- $addrColNames = array(); | |
- $customerAddrs = array(); | |
- | |
- foreach (Mage::getResourceModel('customer/address_attribute_collection') | |
- ->addSystemHiddenFilter() | |
- ->addExcludeHiddenFrontendFilter() as $attribute) { | |
- $options = array(); | |
- $attrCode = $attribute->getAttributeCode(); | |
+ $allAddressAttributeOptions = array(); | |
+ $addrColNames = array(); | |
+ $customerAddrs = array(); | |
+ $addressAttributeCollection = Mage::getResourceModel('customer/address_attribute_collection') | |
+ ->addSystemHiddenFilter() | |
+ ->addExcludeHiddenFrontendFilter(); | |
+ $addressAttributes = array(); | |
+ $addrAttributeMultiSelect = array(); | |
+ $customerAttributeMultiSelect = array(); | |
- if ($attribute->usesSource() && 'country_id' != $attrCode) { | |
- foreach ($attribute->getSource()->getAllOptions(false) as $option) { | |
- foreach (is_array($option['value']) ? $option['value'] : array($option) as $innerOption) { | |
- if (strlen($innerOption['value'])) { // skip ' -- Please Select -- ' option | |
- $options[$innerOption['value']] = $innerOption['label']; | |
- } | |
- } | |
- } | |
- } | |
- $addrAttributes[$attrCode] = $options; | |
+ foreach ($addressAttributeCollection as $attribute) { | |
+ $attrCode = $attribute->getAttributeCode(); | |
+ $allAddressAttributeOptions[$attrCode] = $this->_getAddressAttributeOptions($attribute); | |
$addrColNames[] = Mage_ImportExport_Model_Import_Entity_Customer_Address::getColNameForAttrCode($attrCode); | |
} | |
foreach (Mage::getResourceModel('customer/address_collection')->addAttributeToSelect('*') as $address) { | |
$addrRow = array(); | |
- foreach ($addrAttributes as $attrCode => $attrValues) { | |
+ if (empty($addressAttributes)) { | |
+ $addressAttributes = $address->getAttributes(); | |
+ } | |
+ foreach ($allAddressAttributeOptions as $attrCode => $attrValues) { | |
+ $column = Mage_ImportExport_Model_Import_Entity_Customer_Address::getColNameForAttrCode($attrCode); | |
if (null !== $address->getData($attrCode)) { | |
- $value = $address->getData($attrCode); | |
+ if (!isset($addressAttributes[$attrCode])) { | |
+ $addressAttributes = array_merge($addressAttributes, $address->getAttributes()); | |
+ } | |
+ $addressAttribute = $addressAttributes[$attrCode]; | |
+ $value = $address->getData($attrCode); | |
- if ($attrValues) { | |
+ if ($addressAttribute->getFrontendInput() == 'multiselect') { | |
+ $optionIds = explode(',', $value); | |
+ $optionTexts = array(); | |
+ foreach ($optionIds as $optionId) { | |
+ $optionText = $addressAttribute->getSource()->getOptionText($optionId); | |
+ $optionTexts[$optionId] = $optionText; | |
+ } | |
+ $addrAttributeMultiSelect[$address['parent_id']][$address->getId()][$column] = $optionTexts; | |
+ } elseif ($attrValues) { | |
$value = $attrValues[$value]; | |
} | |
- $column = Mage_ImportExport_Model_Import_Entity_Customer_Address::getColNameForAttrCode($attrCode); | |
$addrRow[$column] = $value; | |
} | |
} | |
@@ -189,49 +221,108 @@ class Mage_ImportExport_Model_Export_Entity_Customer extends Mage_ImportExport_M | |
array('password'), $addrColNames, | |
array_keys($defaultAddrMap) | |
)); | |
- foreach ($collection as $itemId => $item) { // go through all customers | |
- $row = array(); | |
+ foreach ($collection as $customerId => $customer) { | |
+ $customerAddress = array(); | |
+ if (isset($customerAddrs[$customerId])) { | |
+ $customerAddress = $customerAddrs[$customerId]; | |
+ } | |
+ $addressMultiselect= array(); | |
+ if (isset($addrAttributeMultiSelect[$customerId])) { | |
+ $addressMultiselect = $addrAttributeMultiSelect[$customerId]; | |
+ } | |
- // go through all valid attribute codes | |
- foreach ($validAttrCodes as $attrCode) { | |
- $attrValue = $item->getData($attrCode); | |
+ $row = $this->_prepareExportRow($customer, $customerAttributeMultiSelect); | |
+ $defaultAddrs = $this->_prepareDefaultAddress($customer); | |
- if (isset($this->_attributeValues[$attrCode]) | |
- && isset($this->_attributeValues[$attrCode][$attrValue]) | |
- ) { | |
- $attrValue = $this->_attributeValues[$attrCode][$attrValue]; | |
- } | |
- if (null !== $attrValue) { | |
- $row[$attrCode] = $attrValue; | |
- } | |
+ $addrRow = array(); | |
+ $currentAddressId = 0; | |
+ if (isset($customerAddrs[$customerId])) { | |
+ list($addressId, $addrRow) = $this->_getNextAddressRow($customerAddress); | |
+ $row = $this->_addDefaultAddressFields($defaultAddrs, $addressId, $row); | |
+ $addrRow = $this->_addNextAddressOptions($addressMultiselect, $addressId, $addrRow); | |
+ $currentAddressId = $addressId; | |
+ } | |
+ foreach ($customerAttributeMultiSelect as $column => &$multiSelectOptions) { | |
+ $row[$column] = array_shift($multiSelectOptions); | |
} | |
- $row[self::COL_WEBSITE] = $this->_websiteIdToCode[$item['website_id']]; | |
- $row[self::COL_STORE] = $this->_storeIdToCode[$item['store_id']]; | |
+ $writeRow = array_merge($row, $addrRow); | |
+ $writer->writeRow($writeRow); | |
- // addresses injection | |
- $defaultAddrs = array(); | |
+ $additionalRowsCount = $this->_getAdditionalRowsCount($customerAddress, | |
+ $addressMultiselect, $customerAttributeMultiSelect); | |
+ if ($additionalRowsCount) { | |
+ for ($i = 0; $i < $additionalRowsCount; $i++) { | |
+ $writeRow = array(); | |
- foreach ($defaultAddrMap as $colName => $addrAttrCode) { | |
- if (!empty($item[$addrAttrCode])) { | |
- $defaultAddrs[$item[$addrAttrCode]][] = $colName; | |
- } | |
- } | |
- if (isset($customerAddrs[$itemId])) { | |
- while (($addrRow = each($customerAddrs[$itemId]))) { | |
- if (isset($defaultAddrs[$addrRow['key']])) { | |
- foreach ($defaultAddrs[$addrRow['key']] as $colName) { | |
- $row[$colName] = 1; | |
- } | |
+ foreach ($customerAttributeMultiSelect as $column => &$multiSelectOptions) { | |
+ $writeRow[$column] = array_shift($multiSelectOptions); | |
+ } | |
+ if (!$this->_isExistMultiSelectOptions($addressMultiselect, $currentAddressId)) { | |
+ list($addressId, $addrRow) = $this->_getNextAddressRow($customerAddress); | |
+ $currentAddressId = $addressId; | |
+ $addrRow = $this->_addNextAddressOptions($addressMultiselect, $currentAddressId, $addrRow); | |
+ } else { | |
+ $addrRow = array(); | |
+ $addrRow = $this->_addNextAddressOptions($addressMultiselect, $currentAddressId, $addrRow); | |
} | |
- $writer->writeRow(array_merge($row, $addrRow['value'])); | |
- $row = array(); | |
+ if ($addrRow) { | |
+ $writeRow = array_merge($writeRow, $addrRow); | |
+ } | |
+ $writer->writeRow($writeRow); | |
} | |
- } else { | |
- $writer->writeRow($row); | |
} | |
} | |
- return $writer->getContents(); | |
+ } | |
+ | |
+ /** | |
+ * Get Additional Rows Count | |
+ * | |
+ * @param array $customerAddress | |
+ * @param array $addrMultiSelect | |
+ * @param array $customerMultiSelect | |
+ * @return int | |
+ */ | |
+ protected function _getAdditionalRowsCount($customerAddress, $addrMultiSelect, $customerMultiSelect) | |
+ { | |
+ $additionalRowsCount = count($customerAddress); | |
+ $addressRowCount = 0; | |
+ $allAddressRowCount = array(); | |
+ | |
+ foreach ($addrMultiSelect as $addressId => $addressAttributeOptions) { | |
+ foreach ($addressAttributeOptions as $options) { | |
+ $addressRowCount = max(count($options), $addressRowCount); | |
+ $allAddressRowCount[$addressId] = $addressRowCount; | |
+ } | |
+ $addressRowCount = 0; | |
+ } | |
+ | |
+ $additionalRowsCount = max(array_sum($allAddressRowCount), $additionalRowsCount); | |
+ | |
+ foreach ($customerMultiSelect as $options) { | |
+ $additionalRowsCount = max(count($options), $additionalRowsCount); | |
+ } | |
+ | |
+ return $additionalRowsCount; | |
+ } | |
+ | |
+ /** | |
+ * Get Next Address Row | |
+ * | |
+ * @param array $customerAddress | |
+ * @return array | |
+ */ | |
+ protected function _getNextAddressRow(&$customerAddress) | |
+ { | |
+ if (!empty($customerAddress)) { | |
+ reset($customerAddress); | |
+ $addressId = key($customerAddress); | |
+ $addressRow = current($customerAddress); | |
+ unset($customerAddress[$addressId]); | |
+ | |
+ return array($addressId, $addressRow); | |
+ } | |
+ return array(null, null); | |
} | |
/** | |
@@ -247,7 +338,7 @@ class Mage_ImportExport_Model_Export_Entity_Customer extends Mage_ImportExport_M | |
$data = $this->_attributeOverrides[$attribute->getAttributeCode()]; | |
if (isset($data['options_method']) && method_exists($this, $data['options_method'])) { | |
- $data['filter_options'] = $this->$data['options_method'](); | |
+ $data['filter_options'] = $this->{$data['options_method']}(); | |
} | |
$attribute->addData($data); | |
} | |
@@ -274,4 +365,152 @@ class Mage_ImportExport_Model_Export_Entity_Customer extends Mage_ImportExport_M | |
{ | |
return 'customer'; | |
} | |
+ | |
+ /** | |
+ * Get Address Attributes | |
+ * | |
+ * @param $attribute | |
+ * @return array | |
+ */ | |
+ protected function _getAddressAttributeOptions($attribute) | |
+ { | |
+ $options = array(); | |
+ $attrCode = $attribute->getAttributeCode(); | |
+ | |
+ if ($attribute->usesSource() && 'country_id' != $attrCode) { | |
+ foreach ($attribute->getSource()->getAllOptions(false) as $option) { | |
+ $innerOptions = is_array($option['value']) ? $option['value'] : array($option); | |
+ foreach ($innerOptions as $innerOption) { | |
+ // skip ' -- Please Select -- ' option | |
+ if (strlen($innerOption['value'])) { | |
+ $options[$innerOption['value']] = $innerOption['label']; | |
+ } | |
+ } | |
+ } | |
+ } | |
+ return $options; | |
+ } | |
+ | |
+ /** | |
+ * Prepare Export Row | |
+ * | |
+ * @param Mage_Customer_Model_Customer $customer | |
+ * @param array $attributeMultiSelect | |
+ * @return array | |
+ */ | |
+ protected function _prepareExportRow($customer, &$attributeMultiSelect) | |
+ { | |
+ $row = array(); | |
+ $validAttrCodes = $this->_getExportAttrCodes(); | |
+ | |
+ // go through all valid attribute codes | |
+ foreach ($validAttrCodes as $attrCode) { | |
+ $attribute = $customer->getAttribute($attrCode); | |
+ $attrValue = $customer->getData($attrCode); | |
+ | |
+ if ($attribute && $attribute->getFrontendInput() == 'multiselect') { | |
+ $optionText = (array)$attribute->getSource()->getOptionText($attrValue); | |
+ if ($optionText) { | |
+ $attributeMultiSelect[$attrCode] = $optionText; | |
+ $attrValue = null; | |
+ } | |
+ } elseif (isset($this->_attributeValues[$attrCode]) | |
+ && isset($this->_attributeValues[$attrCode][$attrValue]) | |
+ ) { | |
+ $attrValue = $this->_attributeValues[$attrCode][$attrValue]; | |
+ } | |
+ if (null !== $attrValue) { | |
+ $row[$attrCode] = $attrValue; | |
+ } | |
+ } | |
+ $row[self::COL_WEBSITE] = $this->_websiteIdToCode[$customer['website_id']]; | |
+ $row[self::COL_STORE] = $this->_storeIdToCode[$customer['store_id']]; | |
+ | |
+ return $row; | |
+ } | |
+ | |
+ /** | |
+ * Prepare Default Address | |
+ * | |
+ * @param Mage_Customer_Model_Customer $customer | |
+ * @return array | |
+ */ | |
+ protected function _prepareDefaultAddress($customer) | |
+ { | |
+ $defaultAddrMap = Mage_ImportExport_Model_Import_Entity_Customer_Address::getDefaultAddressAttrMapping(); | |
+ $defaultAddrs = array(); | |
+ | |
+ foreach ($defaultAddrMap as $colName => $addrAttrCode) { | |
+ if (!empty($customer[$addrAttrCode])) { | |
+ $defaultAddrs[$customer[$addrAttrCode]][] = $colName; | |
+ } | |
+ } | |
+ return $defaultAddrs; | |
+ } | |
+ | |
+ /** | |
+ * Add default fields to row | |
+ * | |
+ * @param $defaultAddrs | |
+ * @param $addressId | |
+ * @param $row | |
+ * @return mixed | |
+ */ | |
+ protected function _addDefaultAddressFields($defaultAddrs, $addressId, $row) | |
+ { | |
+ if (isset($defaultAddrs[$addressId])) { | |
+ foreach ($defaultAddrs[$addressId] as $colName) { | |
+ $row[$colName] = 1; | |
+ } | |
+ return $row; | |
+ } | |
+ return $row; | |
+ } | |
+ | |
+ /** | |
+ * Get Next Address MultiSelect option | |
+ * | |
+ * @param array $addrAttributeMultiSelect | |
+ * @param int $addressId | |
+ * @param array $addrRow | |
+ * @return array | |
+ */ | |
+ protected function _addNextAddressOptions(&$addrAttributeMultiSelect, $addressId, $addrRow) | |
+ { | |
+ if (!isset($addrAttributeMultiSelect[$addressId])) { | |
+ return $addrRow; | |
+ } | |
+ $addrMultiSelectOption = &$addrAttributeMultiSelect[$addressId]; | |
+ if (is_array($addrMultiSelectOption)) { | |
+ foreach ($addrMultiSelectOption as $column => &$options) { | |
+ $addrRow[$column] = array_shift($options); | |
+ } | |
+ } | |
+ return $addrRow; | |
+ } | |
+ | |
+ /** | |
+ * Check if exist MultiSelect Options | |
+ * | |
+ * @param array $addrAttributeMultiSelect | |
+ * @param int $addressId | |
+ * @return bool | |
+ */ | |
+ protected function _isExistMultiSelectOptions($addrAttributeMultiSelect, $addressId) | |
+ { | |
+ $result = false; | |
+ if (!isset($addrAttributeMultiSelect[$addressId])) { | |
+ return $result; | |
+ } | |
+ $addrMultiSelectOption = $addrAttributeMultiSelect[$addressId]; | |
+ if (is_array($addrMultiSelectOption)) { | |
+ foreach ($addrMultiSelectOption as $option) { | |
+ if (!empty($option)) { | |
+ $result = true; | |
+ break; | |
+ } | |
+ } | |
+ } | |
+ return $result; | |
+ } | |
} | |
diff --git a/app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php b/app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php | |
index c1592ae..74df9c0 100644 | |
--- a/app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php | |
+++ b/app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php | |
@@ -102,24 +102,18 @@ class Mage_ImportExport_Model_Export_Entity_Product extends Mage_ImportExport_Mo | |
protected $_productTypeModels = array(); | |
/** | |
- * Array of pairs store ID to its code. | |
+ * Attribute types | |
* | |
* @var array | |
*/ | |
- protected $_storeIdToCode = array(); | |
+ protected $_attributeTypes = array(); | |
/** | |
- * Website ID-to-code. | |
+ * Attribute scopes | |
* | |
* @var array | |
*/ | |
- protected $_websiteIdToCode = array(); | |
- | |
- /** | |
- * Attribute types | |
- * @var array | |
- */ | |
- protected $_attributeTypes = array(); | |
+ protected $_attributeScopes = array(); | |
/** | |
* Constructor. | |
@@ -546,12 +540,50 @@ class Mage_ImportExport_Model_Export_Entity_Product extends Mage_ImportExport_Mo | |
} | |
/** | |
- * Export process. | |
+ * Export process and return contents of temporary file. | |
+ * | |
+ * @deprecated after ver 1.9.2.4 use $this->exportFile() instead | |
* | |
* @return string | |
*/ | |
public function export() | |
{ | |
+ $this->_prepareExport(); | |
+ | |
+ return $this->getWriter()->getContents(); | |
+ } | |
+ | |
+ /** | |
+ * Export process and return temporary file through array. | |
+ * | |
+ * This method will return following array: | |
+ * | |
+ * array( | |
+ * 'rows' => count of written rows, | |
+ * 'value' => path to created file | |
+ * ) | |
+ * | |
+ * @return array | |
+ */ | |
+ public function exportFile() | |
+ { | |
+ $this->_prepareExport(); | |
+ | |
+ $writer = $this->getWriter(); | |
+ | |
+ return array( | |
+ 'rows' => $writer->getRowsCount(), | |
+ 'value' => $writer->getDestination() | |
+ ); | |
+ } | |
+ | |
+ /** | |
+ * Prepare data for export. | |
+ * | |
+ * @return void | |
+ */ | |
+ protected function _prepareExport() | |
+ { | |
//Execution time may be very long | |
set_time_limit(0); | |
@@ -637,7 +669,41 @@ class Mage_ImportExport_Model_Export_Entity_Product extends Mage_ImportExport_Mo | |
$this->_attributeValues[$attrCode], | |
array_flip($attrValue) | |
); | |
- $rowMultiselects[$itemId][$attrCode] = $attrValue; | |
+ | |
+ switch ($this->_attributeScopes[$attrCode]) { | |
+ case Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE: | |
+ if (isset($rowMultiselects[$itemId][0][$attrCode]) | |
+ && $attrValue == $rowMultiselects[$itemId][0][$attrCode] | |
+ ) { | |
+ $attrValue = null; | |
+ } | |
+ break; | |
+ | |
+ case Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL: | |
+ if ($storeId != $defaultStoreId) { | |
+ $attrValue = null; | |
+ } | |
+ break; | |
+ | |
+ case Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE: | |
+ $websiteId = $this->_storeIdToWebsiteId[$storeId]; | |
+ $websiteStoreId = array_search($websiteId, $this->_storeIdToWebsiteId); | |
+ if ((isset($rowMultiselects[$itemId][$websiteStoreId][$attrCode]) | |
+ && $attrValue == $rowMultiselects[$itemId][$websiteStoreId][$attrCode]) | |
+ || $attrValue == $rowMultiselects[$itemId][0][$attrCode] | |
+ ) { | |
+ $attrValue = null; | |
+ } | |
+ break; | |
+ | |
+ default: | |
+ break; | |
+ } | |
+ | |
+ if ($attrValue) { | |
+ $rowMultiselects[$itemId][$storeId][$attrCode] = $attrValue; | |
+ $rowIsEmpty = false; | |
+ } | |
} else if (isset($this->_attributeValues[$attrCode][$attrValue])) { | |
$attrValue = $this->_attributeValues[$attrCode][$attrValue]; | |
} else { | |
@@ -737,6 +803,7 @@ class Mage_ImportExport_Model_Export_Entity_Product extends Mage_ImportExport_Mo | |
); | |
foreach ($this->_storeIdToCode as $storeId => &$storeCode) { | |
+ $skip = false; | |
$options = Mage::getResourceModel('catalog/product_option_collection') | |
->reset() | |
->addTitleToResult($storeId) | |
@@ -769,7 +836,7 @@ class Mage_ImportExport_Model_Export_Entity_Product extends Mage_ImportExport_Mo | |
} | |
$values = $option->getValues(); | |
if ($values) { | |
- $firstValue = array_shift($values); | |
+ $firstValue = reset($values); | |
$priceType = $firstValue['price_type'] == 'percent' ? '%' : ''; | |
if ($defaultStoreId == $storeId) { | |
@@ -788,8 +855,14 @@ class Mage_ImportExport_Model_Export_Entity_Product extends Mage_ImportExport_Mo | |
$row['_custom_option_store'] = $this->_storeIdToCode[$storeId]; | |
} | |
$customOptionsDataPre[$productId][$optionId][] = $row; | |
+ $skip = true; | |
} | |
foreach ($values as $value) { | |
+ if ($skip) { | |
+ $skip = false; | |
+ continue; | |
+ } | |
+ | |
$row = array(); | |
$valuePriceType = $value['price_type'] == 'percent' ? '%' : ''; | |
@@ -798,7 +871,7 @@ class Mage_ImportExport_Model_Export_Entity_Product extends Mage_ImportExport_Mo | |
$row['_custom_option_row_price'] = $value['price'] . $valuePriceType; | |
$row['_custom_option_row_sku'] = $value['sku']; | |
$row['_custom_option_row_sort'] = $value['sort_order']; | |
- } elseif ($value['title'] != $customOptions[0]['_custom_option_row_title']) { | |
+ } else { | |
$row['_custom_option_row_title'] = $value['title']; | |
} | |
if ($row) { | |
@@ -905,94 +978,93 @@ class Mage_ImportExport_Model_Export_Entity_Product extends Mage_ImportExport_Mo | |
if (!empty($configurableData[$productId])) { | |
$dataRow = array_merge($dataRow, array_shift($configurableData[$productId])); | |
} | |
- if(!empty($rowMultiselects[$productId])) { | |
- foreach ($rowMultiselects[$productId] as $attrKey => $attrVal) { | |
- if (!empty($rowMultiselects[$productId][$attrKey])) { | |
- $dataRow[$attrKey] = array_shift($rowMultiselects[$productId][$attrKey]); | |
+ if(!empty($rowMultiselects[$productId][$storeId])) { | |
+ foreach ($rowMultiselects[$productId][$storeId] as $attrKey => $attrVal) { | |
+ if (isset($rowMultiselects[$productId][$storeId][$attrKey])) { | |
+ $dataRow[$attrKey] = array_shift($rowMultiselects[$productId][$storeId][$attrKey]); | |
} | |
} | |
} | |
$writer->writeRow($dataRow); | |
- } | |
- // calculate largest links block | |
- $largestLinks = 0; | |
+ // calculate largest links block | |
+ $largestLinks = 0; | |
- if (isset($linksRows[$productId])) { | |
- $linksRowsKeys = array_keys($linksRows[$productId]); | |
- foreach ($linksRowsKeys as $linksRowsKey) { | |
- $largestLinks = max($largestLinks, count($linksRows[$productId][$linksRowsKey])); | |
+ if (isset($linksRows[$productId])) { | |
+ $linksRowsKeys = array_keys($linksRows[$productId]); | |
+ foreach ($linksRowsKeys as $linksRowsKey) { | |
+ $largestLinks = max($largestLinks, count($linksRows[$productId][$linksRowsKey])); | |
+ } | |
} | |
- } | |
- $additionalRowsCount = max( | |
- count($rowCategories[$productId]), | |
- count($rowWebsites[$productId]), | |
- $largestLinks | |
- ); | |
- if (!empty($rowTierPrices[$productId])) { | |
- $additionalRowsCount = max($additionalRowsCount, count($rowTierPrices[$productId])); | |
- } | |
- if (!empty($rowGroupPrices[$productId])) { | |
- $additionalRowsCount = max($additionalRowsCount, count($rowGroupPrices[$productId])); | |
- } | |
- if (!empty($mediaGalery[$productId])) { | |
- $additionalRowsCount = max($additionalRowsCount, count($mediaGalery[$productId])); | |
- } | |
- if (!empty($customOptionsData[$productId])) { | |
- $additionalRowsCount = max($additionalRowsCount, count($customOptionsData[$productId])); | |
- } | |
- if (!empty($configurableData[$productId])) { | |
- $additionalRowsCount = max($additionalRowsCount, count($configurableData[$productId])); | |
- } | |
- if (!empty($rowMultiselects[$productId])) { | |
- foreach($rowMultiselects[$productId] as $attributes) { | |
- $additionalRowsCount = max($additionalRowsCount, count($attributes)); | |
+ $additionalRowsCount = max( | |
+ count($rowCategories[$productId]), | |
+ count($rowWebsites[$productId]), | |
+ $largestLinks | |
+ ); | |
+ if (!empty($rowTierPrices[$productId])) { | |
+ $additionalRowsCount = max($additionalRowsCount, count($rowTierPrices[$productId])); | |
} | |
- } | |
- | |
- if ($additionalRowsCount) { | |
- for ($i = 0; $i < $additionalRowsCount; $i++) { | |
- $dataRow = array(); | |
- | |
- $this->_updateDataWithCategoryColumns($dataRow, $rowCategories, $productId); | |
- if ($rowWebsites[$productId]) { | |
- $dataRow['_product_websites'] = $this | |
- ->_websiteIdToCode[array_shift($rowWebsites[$productId])]; | |
- } | |
- if (!empty($rowTierPrices[$productId])) { | |
- $dataRow = array_merge($dataRow, array_shift($rowTierPrices[$productId])); | |
- } | |
- if (!empty($rowGroupPrices[$productId])) { | |
- $dataRow = array_merge($dataRow, array_shift($rowGroupPrices[$productId])); | |
- } | |
- if (!empty($mediaGalery[$productId])) { | |
- $dataRow = array_merge($dataRow, array_shift($mediaGalery[$productId])); | |
+ if (!empty($rowGroupPrices[$productId])) { | |
+ $additionalRowsCount = max($additionalRowsCount, count($rowGroupPrices[$productId])); | |
+ } | |
+ if (!empty($mediaGalery[$productId])) { | |
+ $additionalRowsCount = max($additionalRowsCount, count($mediaGalery[$productId])); | |
+ } | |
+ if (!empty($customOptionsData[$productId])) { | |
+ $additionalRowsCount = max($additionalRowsCount, count($customOptionsData[$productId])); | |
+ } | |
+ if (!empty($configurableData[$productId])) { | |
+ $additionalRowsCount = max($additionalRowsCount, count($configurableData[$productId])); | |
+ } | |
+ if (!empty($rowMultiselects[$productId][$storeId])) { | |
+ foreach($rowMultiselects[$productId][$storeId] as $attributes) { | |
+ $additionalRowsCount = max($additionalRowsCount, count($attributes)); | |
} | |
- foreach ($linkIdColPrefix as $linkId => &$colPrefix) { | |
- if (!empty($linksRows[$productId][$linkId])) { | |
- $linkData = array_shift($linksRows[$productId][$linkId]); | |
- $dataRow[$colPrefix . 'position'] = $linkData['position']; | |
- $dataRow[$colPrefix . 'sku'] = $linkData['sku']; | |
- | |
- if (null !== $linkData['default_qty']) { | |
- $dataRow[$colPrefix . 'default_qty'] = $linkData['default_qty']; | |
+ } | |
+ if ($additionalRowsCount) { | |
+ for ($i = 0; $i < $additionalRowsCount; $i++) { | |
+ $dataRow = array(); | |
+ | |
+ $this->_updateDataWithCategoryColumns($dataRow, $rowCategories, $productId); | |
+ if ($rowWebsites[$productId]) { | |
+ $dataRow['_product_websites'] = $this | |
+ ->_websiteIdToCode[array_shift($rowWebsites[$productId])]; | |
+ } | |
+ if (!empty($rowTierPrices[$productId])) { | |
+ $dataRow = array_merge($dataRow, array_shift($rowTierPrices[$productId])); | |
+ } | |
+ if (!empty($rowGroupPrices[$productId])) { | |
+ $dataRow = array_merge($dataRow, array_shift($rowGroupPrices[$productId])); | |
+ } | |
+ if (!empty($mediaGalery[$productId])) { | |
+ $dataRow = array_merge($dataRow, array_shift($mediaGalery[$productId])); | |
+ } | |
+ foreach ($linkIdColPrefix as $linkId => &$colPrefix) { | |
+ if (!empty($linksRows[$productId][$linkId])) { | |
+ $linkData = array_shift($linksRows[$productId][$linkId]); | |
+ $dataRow[$colPrefix . 'position'] = $linkData['position']; | |
+ $dataRow[$colPrefix . 'sku'] = $linkData['sku']; | |
+ | |
+ if (null !== $linkData['default_qty']) { | |
+ $dataRow[$colPrefix . 'default_qty'] = $linkData['default_qty']; | |
+ } | |
} | |
} | |
- } | |
- if (!empty($customOptionsData[$productId])) { | |
- $dataRow = array_merge($dataRow, array_shift($customOptionsData[$productId])); | |
- } | |
- if (!empty($configurableData[$productId])) { | |
- $dataRow = array_merge($dataRow, array_shift($configurableData[$productId])); | |
- } | |
- if(!empty($rowMultiselects[$productId])) { | |
- foreach($rowMultiselects[$productId] as $attrKey=>$attrVal) { | |
- if(!empty($rowMultiselects[$productId][$attrKey])) { | |
- $dataRow[$attrKey] = array_shift($rowMultiselects[$productId][$attrKey]); | |
+ if (!empty($customOptionsData[$productId])) { | |
+ $dataRow = array_merge($dataRow, array_shift($customOptionsData[$productId])); | |
+ } | |
+ if (!empty($configurableData[$productId])) { | |
+ $dataRow = array_merge($dataRow, array_shift($configurableData[$productId])); | |
+ } | |
+ if(!empty($rowMultiselects[$productId][$storeId])) { | |
+ foreach($rowMultiselects[$productId][$storeId] as $attrKey=>$attrVal) { | |
+ if(isset($rowMultiselects[$productId][$storeId][$attrKey])) { | |
+ $dataRow[$attrKey] = array_shift($rowMultiselects[$productId][$storeId][$attrKey]); | |
+ } | |
} | |
} | |
+ $writer->writeRow($dataRow); | |
} | |
- $writer->writeRow($dataRow); | |
} | |
} | |
} | |
@@ -1058,6 +1130,7 @@ class Mage_ImportExport_Model_Export_Entity_Product extends Mage_ImportExport_Mo | |
$this->_attributeValues[$attribute->getAttributeCode()] = $this->getAttributeOptions($attribute); | |
$this->_attributeTypes[$attribute->getAttributeCode()] = | |
Mage_ImportExport_Model_Import::getAttributeType($attribute); | |
+ $this->_attributeScopes[$attribute->getAttributeCode()] = $attribute->getIsGlobal(); | |
} | |
return $this; | |
} | |
diff --git a/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Abstract.php b/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Abstract.php | |
index 10cab41..cac0b16 100644 | |
--- a/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Abstract.php | |
+++ b/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Abstract.php | |
@@ -96,7 +96,7 @@ abstract class Mage_ImportExport_Model_Export_Entity_Product_Type_Abstract | |
$data = $this->_attributeOverrides[$attribute->getAttributeCode()]; | |
if (isset($data['options_method']) && method_exists($this, $data['options_method'])) { | |
- $data['filter_options'] = $this->$data['options_method'](); | |
+ $data['filter_options'] = $this->{$data['options_method']}(); | |
} | |
$attribute->addData($data); | |
diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer.php | |
index 592c213..be7da74 100644 | |
--- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer.php | |
+++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer.php | |
@@ -43,6 +43,7 @@ class Mage_ImportExport_Model_Import_Entity_Customer extends Mage_ImportExport_M | |
*/ | |
const SCOPE_DEFAULT = 1; | |
const SCOPE_ADDRESS = -1; | |
+ const SCOPE_OPTIONS = 2; | |
/** | |
* Permanent column names. | |
@@ -50,9 +51,10 @@ class Mage_ImportExport_Model_Import_Entity_Customer extends Mage_ImportExport_M | |
* Names that begins with underscore is not an attribute. This name convention is for | |
* to avoid interference with same attribute name. | |
*/ | |
- const COL_EMAIL = 'email'; | |
- const COL_WEBSITE = '_website'; | |
- const COL_STORE = '_store'; | |
+ const COL_EMAIL = 'email'; | |
+ const COL_WEBSITE = '_website'; | |
+ const COL_STORE = '_store'; | |
+ const COL_POSTCODE = '_address_postcode'; | |
/** | |
* Error codes. | |
@@ -96,6 +98,13 @@ class Mage_ImportExport_Model_Import_Entity_Customer extends Mage_ImportExport_M | |
protected $_attributes = array(); | |
/** | |
+ * MultiSelect Attributes | |
+ * | |
+ * @var array | |
+ */ | |
+ protected $_multiSelectAttributes = array(); | |
+ | |
+ /** | |
* Customer account sharing. TRUE - is global, FALSE - is per website. | |
* | |
* @var boolean | |
@@ -276,7 +285,7 @@ class Mage_ImportExport_Model_Import_Entity_Customer extends Mage_ImportExport_M | |
{ | |
$collection = Mage::getResourceModel('customer/attribute_collection')->addSystemHiddenFilterWithPasswordHash(); | |
foreach ($collection as $attribute) { | |
- $this->_attributes[$attribute->getAttributeCode()] = array( | |
+ $attributeArray = array( | |
'id' => $attribute->getId(), | |
'is_required' => $attribute->getIsRequired(), | |
'is_static' => $attribute->isStatic(), | |
@@ -284,6 +293,10 @@ class Mage_ImportExport_Model_Import_Entity_Customer extends Mage_ImportExport_M | |
'type' => Mage_ImportExport_Model_Import::getAttributeType($attribute), | |
'options' => $this->getAttributeOptions($attribute) | |
); | |
+ $this->_attributes[$attribute->getAttributeCode()] = $attributeArray; | |
+ if (Mage_ImportExport_Model_Import::getAttributeType($attribute) == 'multiselect') { | |
+ $this->_multiSelectAttributes[$attribute->getAttributeCode()] = $attributeArray; | |
+ } | |
} | |
return $this; | |
} | |
@@ -363,6 +376,7 @@ class Mage_ImportExport_Model_Import_Entity_Customer extends Mage_ImportExport_M | |
$nextEntityId = Mage::getResourceHelper('importexport')->getNextAutoincrement($table); | |
$passId = $resource->getAttribute('password_hash')->getId(); | |
$passTable = $resource->getAttribute('password_hash')->getBackend()->getTable(); | |
+ $multiSelect = array(); | |
while ($bunch = $this->_dataSourceModel->getNextBunch()) { | |
$entityRowsIn = array(); | |
@@ -415,6 +429,11 @@ class Mage_ImportExport_Model_Import_Entity_Customer extends Mage_ImportExport_M | |
$value = $attrParams['options'][strtolower($value)]; | |
} elseif ('datetime' == $attrParams['type']) { | |
$value = gmstrftime($strftimeFormat, strtotime($value)); | |
+ } elseif ('multiselect' == $attrParams['type']) { | |
+ $value = (array)$attrParams['options'][strtolower($value)]; | |
+ $attribute->getBackend()->beforeSave($resource->setData($attrCode, $value)); | |
+ $value = $resource->getData($attrCode); | |
+ $multiSelect[$entityId][] = $value; | |
} elseif ($backModel) { | |
$attribute->getBackend()->beforeSave($resource->setData($attrCode, $value)); | |
$value = $resource->getData($attrCode); | |
@@ -429,6 +448,24 @@ class Mage_ImportExport_Model_Import_Entity_Customer extends Mage_ImportExport_M | |
if (isset($rowData['password']) && strlen($rowData['password'])) { | |
$attributes[$passTable][$entityId][$passId] = $resource->hashPassword($rowData['password']); | |
} | |
+ } elseif (self::SCOPE_OPTIONS == $this->getRowScope($rowData)) { | |
+ foreach (array_intersect_key($rowData, $this->_attributes) as $attrCode => $value) { | |
+ $attribute = $resource->getAttribute($attrCode); | |
+ $attrParams = $this->_attributes[$attrCode]; | |
+ if ($attrParams['type'] == 'multiselect') { | |
+ if (!isset($attrParams['options'][strtolower($value)])) { | |
+ continue; | |
+ } | |
+ $value = $attrParams['options'][strtolower($value)]; | |
+ if (isset($multiSelect[$entityId])) { | |
+ $multiSelect[$entityId][] = $value; | |
+ $value = $multiSelect[$entityId]; | |
+ } | |
+ $attribute->getBackend()->beforeSave($resource->setData($attrCode, $value)); | |
+ $value = $resource->getData($attrCode); | |
+ $attributes[$attribute->getBackend()->getTable()][$entityId][$attrParams['id']] = $value; | |
+ } | |
+ } | |
} | |
} | |
$this->_saveCustomerEntity($entityRowsIn, $entityRowsUp)->_saveCustomerAttributes($attributes); | |
@@ -521,7 +558,22 @@ class Mage_ImportExport_Model_Import_Entity_Customer extends Mage_ImportExport_M | |
*/ | |
public function getRowScope(array $rowData) | |
{ | |
- return strlen(trim($rowData[self::COL_EMAIL])) ? self::SCOPE_DEFAULT : self::SCOPE_ADDRESS; | |
+ $foundOptions = false; | |
+ foreach ($this->_multiSelectAttributes as $attrCode => $attribute) { | |
+ if ($rowData[$attrCode]) { | |
+ $foundOptions = true; | |
+ } | |
+ } | |
+ | |
+ $scope = self::SCOPE_OPTIONS; | |
+ if (strlen(trim($rowData[self::COL_EMAIL]))) { | |
+ $scope = self::SCOPE_DEFAULT; | |
+ } elseif ($foundOptions) { | |
+ $scope = self::SCOPE_OPTIONS; | |
+ } elseif (strlen(trim($rowData[self::COL_POSTCODE]))) { | |
+ $scope = self::SCOPE_ADDRESS; | |
+ } | |
+ return $scope; | |
} | |
/** | |
@@ -607,15 +659,17 @@ class Mage_ImportExport_Model_Import_Entity_Customer extends Mage_ImportExport_M | |
if (isset($this->_invalidRows[$rowNum])) { | |
$email = false; // mark row as invalid for next address rows | |
} | |
- } else { | |
+ } elseif (self::SCOPE_OPTIONS != $rowScope) { | |
if (null === $email) { // first row is not SCOPE_DEFAULT | |
$this->addRowError(self::ERROR_EMAIL_IS_EMPTY, $rowNum); | |
} elseif (false === $email) { // SCOPE_DEFAULT row is invalid | |
$this->addRowError(self::ERROR_ROW_IS_ORPHAN, $rowNum); | |
} | |
} | |
- // validate row data by address entity | |
- $this->_addressEntity->validateRow($rowData, $rowNum); | |
+ | |
+ if ($rowScope != self::SCOPE_OPTIONS) { | |
+ $this->_addressEntity->validateRow($rowData, $rowNum); | |
+ } | |
return !isset($this->_invalidRows[$rowNum]); | |
} | |
diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer/Address.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer/Address.php | |
index dcdf97e..1d17628 100644 | |
--- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer/Address.php | |
+++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer/Address.php | |
@@ -175,6 +175,7 @@ class Mage_ImportExport_Model_Import_Entity_Customer_Address extends Mage_Import | |
$regionIdTable = $regionIdAttr->getBackend()->getTable(); | |
$regionIdAttrId = $regionIdAttr->getId(); | |
$isAppendMode = Mage_ImportExport_Model_Import::BEHAVIOR_APPEND == $this->_customer->getBehavior(); | |
+ $multiSelect = array(); | |
while ($bunch = $this->_dataSourceModel->getNextBunch()) { | |
$entityRows = array(); | |
@@ -182,15 +183,17 @@ class Mage_ImportExport_Model_Import_Entity_Customer_Address extends Mage_Import | |
$defaults = array(); // customer default addresses (billing/shipping) data | |
foreach ($bunch as $rowNum => $rowData) { | |
- if (!empty($rowData[Mage_ImportExport_Model_Import_Entity_Customer::COL_EMAIL]) | |
- && !empty($rowData[Mage_ImportExport_Model_Import_Entity_Customer::COL_WEBSITE]) | |
- ) { | |
+ $rowScope = $this->_getRowScope($rowData); | |
+ if ($rowScope == Mage_ImportExport_Model_Import_Entity_Customer::SCOPE_DEFAULT) { | |
$customerId = $this->_customer->getCustomerId( | |
$rowData[Mage_ImportExport_Model_Import_Entity_Customer::COL_EMAIL], | |
$rowData[Mage_ImportExport_Model_Import_Entity_Customer::COL_WEBSITE] | |
); | |
} | |
- if (!$customerId || !$this->_isRowWithAddress($rowData) || !$this->validateRow($rowData, $rowNum)) { | |
+ if ($rowScope != Mage_ImportExport_Model_Import_Entity_Customer::SCOPE_OPTIONS) { | |
+ $multiSelect = array(); | |
+ } | |
+ if (!$customerId) { | |
continue; | |
} | |
@@ -205,6 +208,9 @@ class Mage_ImportExport_Model_Import_Entity_Customer_Address extends Mage_Import | |
$value = $attrParams['options'][strtolower($rowData[$attrAlias])]; | |
} elseif ('datetime' == $attrParams['type']) { | |
$value = gmstrftime($strftimeFormat, strtotime($rowData[$attrAlias])); | |
+ } elseif ('multiselect' == $attrParams['type']) { | |
+ $value = $attrParams['options'][strtolower($rowData[$attrAlias])]; | |
+ $multiSelect[$attrParams['id']][] = $value; | |
} else { | |
$value = $rowData[$attrAlias]; | |
} | |
@@ -220,40 +226,56 @@ class Mage_ImportExport_Model_Import_Entity_Customer_Address extends Mage_Import | |
$entityId = $nextEntityId++; | |
- // entity table data | |
- $entityRows[] = array( | |
- 'entity_id' => $entityId, | |
- 'entity_type_id' => $this->_entityTypeId, | |
- 'parent_id' => $customerId, | |
- 'created_at' => now(), | |
- 'updated_at' => now() | |
- ); | |
- // attribute values | |
- foreach ($this->_attributes as $attrAlias => $attrParams) { | |
- if (isset($addressAttributes[$attrParams['id']])) { | |
- $attributes[$attrParams['table']][$entityId][$attrParams['id']] | |
- = $addressAttributes[$attrParams['id']]; | |
+ if ($rowScope == Mage_ImportExport_Model_Import_Entity_Customer::SCOPE_DEFAULT | |
+ || $rowScope == Mage_ImportExport_Model_Import_Entity_Customer::SCOPE_ADDRESS | |
+ ) { | |
+ // entity table data | |
+ $entityRows[] = array( | |
+ 'entity_id' => $entityId, | |
+ 'entity_type_id' => $this->_entityTypeId, | |
+ 'parent_id' => $customerId, | |
+ 'created_at' => now(), | |
+ 'updated_at' => now() | |
+ ); | |
+ // attribute values | |
+ foreach ($this->_attributes as $attrAlias => $attrParams) { | |
+ if (isset($addressAttributes[$attrParams['id']])) { | |
+ $attributes[$attrParams['table']][$entityId][$attrParams['id']] | |
+ = $addressAttributes[$attrParams['id']]; | |
+ } | |
} | |
- } | |
- // customer default addresses | |
- foreach (self::getDefaultAddressAttrMapping() as $colName => $customerAttrCode) { | |
- if (!empty($rowData[$colName])) { | |
- $attribute = $customer->getAttribute($customerAttrCode); | |
- $defaults[$attribute->getBackend()->getTable()][$customerId][$attribute->getId()] = $entityId; | |
+ // customer default addresses | |
+ foreach (self::getDefaultAddressAttrMapping() as $colName => $customerAttrCode) { | |
+ if (!empty($rowData[$colName])) { | |
+ $attribute = $customer->getAttribute($customerAttrCode); | |
+ $backendTable = $attribute->getBackend()->getTable(); | |
+ $defaults[$backendTable][$customerId][$attribute->getId()] = $entityId; | |
+ } | |
} | |
- } | |
- // let's try to find region ID | |
- if (!empty($rowData[$regionColName])) { | |
- $countryNormalized = strtolower($rowData[$countryColName]); | |
- $regionNormalized = strtolower($rowData[$regionColName]); | |
- | |
- if (isset($this->_countryRegions[$countryNormalized][$regionNormalized])) { | |
- $regionId = $this->_countryRegions[$countryNormalized][$regionNormalized]; | |
- $attributes[$regionIdTable][$entityId][$regionIdAttrId] = $regionId; | |
- // set 'region' attribute value as default name | |
- $tbl = $this->_attributes[$regionColName]['table']; | |
- $regionColNameId = $this->_attributes[$regionColName]['id']; | |
- $attributes[$tbl][$entityId][$regionColNameId] = $this->_regions[$regionId]; | |
+ // let's try to find region ID | |
+ if (!empty($rowData[$regionColName])) { | |
+ $countryNormalized = strtolower($rowData[$countryColName]); | |
+ $regionNormalized = strtolower($rowData[$regionColName]); | |
+ | |
+ if (isset($this->_countryRegions[$countryNormalized][$regionNormalized])) { | |
+ $regionId = $this->_countryRegions[$countryNormalized][$regionNormalized]; | |
+ $attributes[$regionIdTable][$entityId][$regionIdAttrId] = $regionId; | |
+ // set 'region' attribute value as default name | |
+ $tbl = $this->_attributes[$regionColName]['table']; | |
+ $regionColNameId = $this->_attributes[$regionColName]['id']; | |
+ $attributes[$tbl][$entityId][$regionColNameId] = $this->_regions[$regionId]; | |
+ } | |
+ } | |
+ } else { | |
+ foreach (array_intersect_key($rowData, $this->_attributes) as $attrCode => $value) { | |
+ $attrParams = $this->_attributes[$attrCode]; | |
+ if ($attrParams['type'] == 'multiselect') { | |
+ $value = ''; | |
+ if (isset($multiSelect[$attrParams['id']])) { | |
+ $value = implode(',', $multiSelect[$attrParams['id']]); | |
+ } | |
+ $attributes[$this->_attributes[$attrCode]['table']][$entityId][$attrParams['id']] = $value; | |
+ } | |
} | |
} | |
} | |
@@ -486,4 +508,22 @@ class Mage_ImportExport_Model_Import_Entity_Customer_Address extends Mage_Import | |
} | |
return $rowIsValid; | |
} | |
+ | |
+ /** | |
+ * Get current scope | |
+ * | |
+ * @param $rowData | |
+ * @return int | |
+ */ | |
+ protected function _getRowScope($rowData) | |
+ { | |
+ if (strlen(trim($rowData[Mage_ImportExport_Model_Import_Entity_Customer::COL_EMAIL]))) { | |
+ $scope = Mage_ImportExport_Model_Import_Entity_Customer::SCOPE_DEFAULT; | |
+ } elseif (strlen(trim($rowData[Mage_ImportExport_Model_Import_Entity_Customer::COL_POSTCODE]))) { | |
+ $scope = Mage_ImportExport_Model_Import_Entity_Customer::SCOPE_ADDRESS; | |
+ } else { | |
+ $scope = Mage_ImportExport_Model_Import_Entity_Customer::SCOPE_OPTIONS; | |
+ } | |
+ return $scope; | |
+ } | |
} | |
diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php | |
index 6b3589d..1d03161 100644 | |
--- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php | |
+++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php | |
@@ -423,6 +423,13 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo | |
protected $_fileUploader; | |
/** | |
+ * url_key attribute id | |
+ * | |
+ * @var int | |
+ */ | |
+ protected $_urlKeyAttributeId; | |
+ | |
+ /** | |
* Constructor. | |
* | |
*/ | |
@@ -823,6 +830,9 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo | |
); | |
$alreadyUsedProductIds = array(); | |
+ $lastStoreId = null; | |
+ $lastProductId = null; | |
+ $currentValueId = null; | |
while ($bunch = $this->_dataSourceModel->getNextBunch()) { | |
$customOptions = array( | |
'product_id' => array(), | |
@@ -833,7 +843,8 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo | |
$typeTitleTable => array(), | |
$typeValueTable => array() | |
); | |
- | |
+ $flagNewOption = true; | |
+ $firstKeyOption = null; | |
foreach ($bunch as $rowNum => $rowData) { | |
$this->_filterRowData($rowData); | |
if (!$this->isRowAllowedToImport($rowData, $rowNum)) { | |
@@ -844,6 +855,13 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo | |
} elseif (!isset($productId)) { | |
continue; | |
} | |
+ | |
+ if ($lastProductId != $productId) { | |
+ $lastStoreId = Mage_Catalog_Model_Abstract::DEFAULT_STORE_ID; | |
+ $currentValueId = null; | |
+ $lastProductId = $productId; | |
+ } | |
+ | |
if (!empty($rowData['_custom_option_store'])) { | |
if (!isset($this->_storeCodeToId[$rowData['_custom_option_store']])) { | |
continue; | |
@@ -920,41 +938,66 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo | |
} | |
$prevOptionId = $nextOptionId++; // increment option id, but preserve value for $typeValueTable | |
} | |
- if ($typeSpecific[$type] === true && !empty($rowData['_custom_option_row_title']) | |
- && empty($rowData['_custom_option_store'])) { | |
- // complex CO option row | |
- $customOptions[$typeValueTable][$prevOptionId][] = array( | |
- 'option_type_id' => $nextValueId, | |
- 'sort_order' => empty($rowData['_custom_option_row_sort']) | |
- ? 0 : abs($rowData['_custom_option_row_sort']), | |
- 'sku' => !empty($rowData['_custom_option_row_sku']) | |
- ? $rowData['_custom_option_row_sku'] : '' | |
- ); | |
- if (!isset($customOptions[$typeTitleTable][$nextValueId][0])) { // ensure default title is set | |
- $customOptions[$typeTitleTable][$nextValueId][0] = $rowData['_custom_option_row_title']; | |
- } | |
- $customOptions[$typeTitleTable][$nextValueId][$storeId] = $rowData['_custom_option_row_title']; | |
- if (!empty($rowData['_custom_option_row_price'])) { | |
- $typePriceRow = array( | |
- 'price' => (float) rtrim($rowData['_custom_option_row_price'], '%'), | |
- 'price_type' => 'fixed' | |
+ if ($typeSpecific[$type] === true && !empty($rowData['_custom_option_row_title'])) { | |
+ if (empty($rowData['_custom_option_store'])) { | |
+ // complex CO option row | |
+ $customOptions[$typeValueTable][$prevOptionId][] = array( | |
+ 'option_type_id' => $nextValueId, | |
+ 'sort_order' => empty($rowData['_custom_option_row_sort']) | |
+ ? 0 : abs($rowData['_custom_option_row_sort']), | |
+ 'sku' => !empty($rowData['_custom_option_row_sku']) | |
+ ? $rowData['_custom_option_row_sku'] : '' | |
); | |
- if ('%' == substr($rowData['_custom_option_row_price'], -1)) { | |
- $typePriceRow['price_type'] = 'percent'; | |
+ if (!isset($customOptions[$typeTitleTable][$nextValueId][0])) { // ensure default title is set | |
+ $customOptions[$typeTitleTable][$nextValueId][0] = $rowData['_custom_option_row_title']; | |
} | |
- if ($priceIsGlobal) { | |
- $customOptions[$typePriceTable][$nextValueId][0] = $typePriceRow; | |
- } else { | |
- // ensure default price is set | |
- if (!isset($customOptions[$typePriceTable][$nextValueId][0])) { | |
+ $customOptions[$typeTitleTable][$nextValueId][$storeId] = $rowData['_custom_option_row_title']; | |
+ | |
+ if (!empty($rowData['_custom_option_row_price'])) { | |
+ $typePriceRow = array( | |
+ 'price' => (float) rtrim($rowData['_custom_option_row_price'], '%'), | |
+ 'price_type' => 'fixed' | |
+ ); | |
+ if ('%' == substr($rowData['_custom_option_row_price'], -1)) { | |
+ $typePriceRow['price_type'] = 'percent'; | |
+ } | |
+ if ($priceIsGlobal) { | |
$customOptions[$typePriceTable][$nextValueId][0] = $typePriceRow; | |
+ } else { | |
+ // ensure default price is set | |
+ if (!isset($customOptions[$typePriceTable][$nextValueId][0])) { | |
+ $customOptions[$typePriceTable][$nextValueId][0] = $typePriceRow; | |
+ } | |
+ $customOptions[$typePriceTable][$nextValueId][$storeId] = $typePriceRow; | |
} | |
- $customOptions[$typePriceTable][$nextValueId][$storeId] = $typePriceRow; | |
+ } | |
+ if ($flagNewOption) { | |
+ $firstKeyOption = $nextValueId; | |
+ $flagNewOption = false; | |
+ } | |
+ $nextValueId++; | |
+ } else { | |
+ $flagNewOption = true; | |
+ if ($lastStoreId != $storeId) { | |
+ if (!$firstKeyOption) { | |
+ reset($customOptions[$typeTitleTable]); | |
+ $firstKeyOption = key($customOptions[$typeTitleTable]); | |
+ } | |
+ $currentValueId = $firstKeyOption; | |
+ $lastStoreId = $storeId; | |
+ } else { | |
+ $currentValueId++; | |
+ } | |
+ | |
+ $defaultValue = $customOptions[$typeTitleTable][$currentValueId][0]; | |
+ if ($defaultValue != $rowData['_custom_option_row_title']) { | |
+ $customOptions[$typeTitleTable][$currentValueId][$storeId] | |
+ = $rowData['_custom_option_row_title']; | |
} | |
} | |
- $nextValueId++; | |
} | |
+ | |
if (!empty($rowData['_custom_option_title'])) { | |
if (!isset($customOptions[$titleTable][$prevOptionId][0])) { // ensure default title is set | |
$customOptions[$titleTable][$prevOptionId][0] = $rowData['_custom_option_title']; | |
@@ -1105,13 +1148,13 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo | |
$sku = $rowData[self::COL_SKU]; | |
} | |
foreach ($this->_linkNameToId as $linkName => $linkId) { | |
- $productId = $this->_newSku[$sku]['entity_id']; | |
- $productIds[] = $productId; | |
if (isset($rowData[$linkName . 'sku'])) { | |
- $linkedSku = $rowData[$linkName . 'sku']; | |
+ $productId = $this->_newSku[$sku]['entity_id']; | |
+ $productIds[] = $productId; | |
+ $linkedSku = $rowData[$linkName . 'sku']; | |
if ((isset($this->_newSku[$linkedSku]) || isset($this->_oldSku[$linkedSku])) | |
- && $linkedSku != $sku) { | |
+ && $linkedSku != $sku) { | |
if (isset($this->_newSku[$linkedSku])) { | |
$linkedId = $this->_newSku[$linkedSku]['entity_id']; | |
} else { | |
@@ -1189,19 +1232,21 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo | |
); | |
} | |
- /* | |
- If the store based values are not provided for a particular store, | |
- we default to the default scope values. | |
- In this case, remove all the existing store based values stored in the table. | |
- */ | |
- $where = $this->_connection->quoteInto('store_id NOT IN (?)', array_keys($storeValues)) . | |
- $this->_connection->quoteInto(' AND attribute_id = ?', $attributeId) . | |
- $this->_connection->quoteInto(' AND entity_id = ?', $productId) . | |
- $this->_connection->quoteInto(' AND entity_type_id = ?', $this->_entityTypeId); | |
- | |
- $this->_connection->delete( | |
- $tableName, $where | |
- ); | |
+ if ($attributeId == $this->_getUrlKeyAttributeId()) { | |
+ /* | |
+ If the store based values are not provided for a particular store, | |
+ we default to the default scope values. | |
+ In this case, remove all the existing store based values stored in the table. | |
+ */ | |
+ $where = $this->_connection->quoteInto('store_id NOT IN (?)', array_keys($storeValues)) . | |
+ $this->_connection->quoteInto(' AND attribute_id = ?', $attributeId) . | |
+ $this->_connection->quoteInto(' AND entity_id = ?', $productId) . | |
+ $this->_connection->quoteInto(' AND entity_type_id = ?', $this->_entityTypeId); | |
+ | |
+ $this->_connection->delete( | |
+ $tableName, $where | |
+ ); | |
+ } | |
} | |
} | |
$this->_connection->insertOnDuplicate($tableName, $tableData, array('value')); | |
@@ -1404,7 +1449,7 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo | |
if (!is_null($productType)) { | |
$previousType = $productType; | |
} | |
- if (!is_null($rowData[self::COL_ATTR_SET])) { | |
+ if (isset($rowData[self::COL_ATTR_SET]) && !is_null($rowData[self::COL_ATTR_SET])) { | |
$previousAttributeSet = $rowData[Mage_ImportExport_Model_Import_Entity_Product::COL_ATTR_SET]; | |
} | |
if (self::SCOPE_NULL == $rowScope) { | |
@@ -1511,6 +1556,8 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo | |
// check website defaults already set | |
if (!isset($attributes[$attrTable][$rowSku][$attrId][$rowStore])) { | |
$storeIds = $this->_storeIdToWebsiteStoreIds[$rowStore]; | |
+ } else { | |
+ $storeIds = array($rowStore); | |
} | |
} elseif (self::SCOPE_STORE == $attribute->getIsGlobal()) { | |
$storeIds = array($rowStore); | |
@@ -2136,4 +2183,29 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo | |
} | |
return $productIds; | |
} | |
+ | |
+ /** | |
+ * Get product url_key attribute id | |
+ * | |
+ * @return null|int | |
+ */ | |
+ protected function _getUrlKeyAttributeId() | |
+ { | |
+ if ($this->_urlKeyAttributeId === null) { | |
+ $adapter = $this->getConnection(); | |
+ $resource = $this->getResourceModel('eav/entity_attribute'); | |
+ | |
+ $select = $adapter->select() | |
+ ->from( | |
+ $resource->getMainTable(), | |
+ array('attribute_id') | |
+ ) | |
+ ->where('attribute_code = ?', 'url_key') | |
+ ->where('entity_type_id = ?', $this->_entityTypeId); | |
+ | |
+ $this->_urlKeyAttributeId = $adapter->fetchOne($select); | |
+ } | |
+ | |
+ return $this->_urlKeyAttributeId; | |
+ } | |
} | |
diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Configurable.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Configurable.php | |
index e1e0009..5c94c2e 100644 | |
--- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Configurable.php | |
+++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Configurable.php | |
@@ -230,18 +230,34 @@ class Mage_ImportExport_Model_Import_Entity_Product_Type_Configurable | |
->getNode('global/catalog/product/type/configurable/allow_product_types')->children() as $type) { | |
$allowProductTypes[] = $type->getName(); | |
} | |
- foreach (Mage::getResourceModel('catalog/product_collection') | |
+ /** @var Mage_Catalog_Model_Resource_Product_Collection $collection */ | |
+ $collection = Mage::getResourceModel('catalog/product_collection') | |
->addFieldToFilter('type_id', $allowProductTypes) | |
- ->addAttributeToSelect(array_keys($this->_superAttributes)) as $product) { | |
- $attrSetName = $attrSetIdToName[$product->getAttributeSetId()]; | |
- | |
- $data = array_intersect_key( | |
- $product->getData(), | |
- $this->_superAttributes | |
- ); | |
- foreach ($data as $attrCode => $value) { | |
- $attrId = $this->_superAttributes[$attrCode]['id']; | |
- $this->_skuSuperAttributeValues[$attrSetName][$product->getId()][$attrId] = $value; | |
+ ->addAttributeToSelect(array_keys($this->_superAttributes)); | |
+ | |
+ $collectionSize = $collection->getSize(); | |
+ if ($collectionSize) { | |
+ $configPageSize = Mage::helper('importexport')->getImportConfigurablePageSize(); | |
+ $pageSize = ($configPageSize > 0) ? $configPageSize : $collectionSize; | |
+ $page = 0; | |
+ $collection->setPageSize($pageSize); | |
+ while ($pageSize * $page < $collectionSize) { | |
+ $page++; | |
+ $collection->setCurPage($page); | |
+ | |
+ foreach ($collection as $product) { | |
+ $attrSetName = $attrSetIdToName[$product->getAttributeSetId()]; | |
+ | |
+ $data = array_intersect_key( | |
+ $product->getData(), | |
+ $this->_superAttributes | |
+ ); | |
+ foreach ($data as $attrCode => $value) { | |
+ $attrId = $this->_superAttributes[$attrCode]['id']; | |
+ $this->_skuSuperAttributeValues[$attrSetName][$product->getId()][$attrId] = $value; | |
+ } | |
+ } | |
+ $collection->clear(); | |
} | |
} | |
} | |
diff --git a/app/code/core/Mage/ImportExport/Model/Import/Uploader.php b/app/code/core/Mage/ImportExport/Model/Import/Uploader.php | |
index 247022a..2d1a40e 100644 | |
--- a/app/code/core/Mage/ImportExport/Model/Import/Uploader.php | |
+++ b/app/code/core/Mage/ImportExport/Model/Import/Uploader.php | |
@@ -132,7 +132,7 @@ class Mage_ImportExport_Model_Import_Uploader extends Mage_Core_Model_File_Uploa | |
//run validate callbacks | |
foreach ($this->_validateCallbacks as $params) { | |
if (is_object($params['object']) && method_exists($params['object'], $params['method'])) { | |
- $params['object']->$params['method']($filePath); | |
+ $params['object']->{$params['method']}($filePath); | |
} | |
} | |
} | |
diff --git a/app/code/core/Mage/ImportExport/controllers/Adminhtml/ExportController.php b/app/code/core/Mage/ImportExport/controllers/Adminhtml/ExportController.php | |
index 13bd611..dd68f9d 100644 | |
--- a/app/code/core/Mage/ImportExport/controllers/Adminhtml/ExportController.php | |
+++ b/app/code/core/Mage/ImportExport/controllers/Adminhtml/ExportController.php | |
@@ -81,9 +81,12 @@ class Mage_ImportExport_Adminhtml_ExportController extends Mage_Adminhtml_Contro | |
$model = Mage::getModel('importexport/export'); | |
$model->setData($this->getRequest()->getParams()); | |
+ $result = $model->exportFile(); | |
+ $result['type'] = 'filename'; | |
+ | |
return $this->_prepareDownloadResponse( | |
$model->getFileName(), | |
- $model->export(), | |
+ $result, | |
$model->getContentType() | |
); | |
} catch (Mage_Core_Exception $e) { | |
diff --git a/app/code/core/Mage/ImportExport/etc/config.xml b/app/code/core/Mage/ImportExport/etc/config.xml | |
index e088d28..e28c112 100644 | |
--- a/app/code/core/Mage/ImportExport/etc/config.xml | |
+++ b/app/code/core/Mage/ImportExport/etc/config.xml | |
@@ -139,6 +139,9 @@ | |
<export_csv> | |
<escaping>1</escaping> | |
</export_csv> | |
+ <import_csv> | |
+ <configurable_page_size>1000</configurable_page_size> | |
+ </import_csv> | |
</system> | |
<general> | |
<file> | |
diff --git a/app/code/core/Mage/ImportExport/etc/system.xml b/app/code/core/Mage/ImportExport/etc/system.xml | |
index c14d2d5..764fa1a 100644 | |
--- a/app/code/core/Mage/ImportExport/etc/system.xml | |
+++ b/app/code/core/Mage/ImportExport/etc/system.xml | |
@@ -48,6 +48,25 @@ | |
</escaping> | |
</fields> | |
</export_csv> | |
+ <import_csv translate="label"> | |
+ <label>Import CSV</label> | |
+ <show_in_default>1</show_in_default> | |
+ <show_in_website>1</show_in_website> | |
+ <show_in_store>1</show_in_store> | |
+ <sort_order>500</sort_order> | |
+ <fields> | |
+ <configurable_page_size translate="label,comment"> | |
+ <label>Page size for import configurable products</label> | |
+ <frontend_type>text</frontend_type> | |
+ <validate>validate-number</validate> | |
+ <sort_order>1</sort_order> | |
+ <show_in_default>1</show_in_default> | |
+ <show_in_website>0</show_in_website> | |
+ <show_in_store>0</show_in_store> | |
+ <comment>This option will be ignore if it set less than 1.</comment> | |
+ </configurable_page_size> | |
+ </fields> | |
+ </import_csv> | |
</groups> | |
</system> | |
</sections> | |
diff --git a/app/code/core/Mage/Payment/Model/Method/Cc.php b/app/code/core/Mage/Payment/Model/Method/Cc.php | |
index 40c741f..fd366f0 100644 | |
--- a/app/code/core/Mage/Payment/Model/Method/Cc.php | |
+++ b/app/code/core/Mage/Payment/Model/Method/Cc.php | |
@@ -122,7 +122,7 @@ class Mage_Payment_Model_Method_Cc extends Mage_Payment_Model_Method_Abstract | |
// Visa | |
'VI' => '/^4[0-9]{12}([0-9]{3})?$/', | |
// Master Card | |
- 'MC' => '/^5[1-5][0-9]{14}$/', | |
+ 'MC' => '/^(5[1-5][0-9]{14}|2(22[1-9][0-9]{12}|2[3-9][0-9]{13}|[3-6][0-9]{14}|7[0-1][0-9]{13}|720[0-9]{12}))$/', | |
// American Express | |
'AE' => '/^3[47][0-9]{13}$/', | |
// Discover Network | |
diff --git a/app/code/core/Mage/Paypal/Model/Api/Nvp.php b/app/code/core/Mage/Paypal/Model/Api/Nvp.php | |
index ca8252c..237d452 100644 | |
--- a/app/code/core/Mage/Paypal/Model/Api/Nvp.php | |
+++ b/app/code/core/Mage/Paypal/Model/Api/Nvp.php | |
@@ -520,7 +520,8 @@ class Mage_Paypal_Model_Api_Nvp extends Mage_Paypal_Model_Api_Abstract | |
* @var array | |
*/ | |
protected $_requiredResponseParams = array( | |
- self::DO_DIRECT_PAYMENT => array('ACK', 'CORRELATIONID', 'AMT') | |
+ self::DO_DIRECT_PAYMENT => array('ACK', 'CORRELATIONID', 'AMT'), | |
+ self::DO_EXPRESS_CHECKOUT_PAYMENT => array('ACK', 'CORRELATIONID', 'AMT'), | |
); | |
/** | |
diff --git a/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction.php b/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction.php | |
index c6857c3..8be507b 100644 | |
--- a/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction.php | |
+++ b/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction.php | |
@@ -53,11 +53,7 @@ class Mage_Paypal_Model_Resource_Payment_Transaction extends Mage_Core_Model_Res | |
} | |
/** | |
- * Unserialize Varien_Object field in an object | |
- * | |
- * @param Mage_Core_Model_Abstract $object | |
- * @param string $field | |
- * @param mixed $defaultValue | |
+ * @see Mage_Core_Model_Resource_Abstract::_unserializeField() | |
*/ | |
protected function _unserializeField(Varien_Object $object, $field, $defaultValue = null) | |
{ | |
diff --git a/app/code/core/Mage/Persistent/Model/Persistent/Config.php b/app/code/core/Mage/Persistent/Model/Persistent/Config.php | |
index 4b0c0ed..424003e 100644 | |
--- a/app/code/core/Mage/Persistent/Model/Persistent/Config.php | |
+++ b/app/code/core/Mage/Persistent/Model/Persistent/Config.php | |
@@ -71,7 +71,9 @@ class Mage_Persistent_Model_Persistent_Config | |
if (is_null($this->_xmlConfig)) { | |
$filePath = $this->_configFilePath; | |
if (!is_file($filePath) || !is_readable($filePath)) { | |
- Mage::throwException(Mage::helper('persistent')->__('Cannot load configuration from file %s.', $filePath)); | |
+ $io = new Varien_Io_File(); | |
+ Mage::throwException(Mage::helper('persistent')->__('Cannot load configuration from file %s.', | |
+ $io->getFilteredPath($filePath))); | |
} | |
$xml = file_get_contents($filePath); | |
$this->_xmlConfig = new Varien_Simplexml_Element($xml); | |
diff --git a/app/code/core/Mage/Reports/Model/Product/Index/Abstract.php b/app/code/core/Mage/Reports/Model/Product/Index/Abstract.php | |
index 010af2c..91cfa5a 100644 | |
--- a/app/code/core/Mage/Reports/Model/Product/Index/Abstract.php | |
+++ b/app/code/core/Mage/Reports/Model/Product/Index/Abstract.php | |
@@ -65,7 +65,16 @@ abstract class Mage_Reports_Model_Product_Index_Abstract extends Mage_Core_Model | |
// Thanks to new performance tweaks it is possible to switch off visitor logging | |
// This check is needed to make sure report record has either visitor id or customer id | |
if ($this->hasVisitorId() || $this->hasCustomerId()) { | |
- parent::save(); | |
+ try { | |
+ parent::save(); | |
+ } catch (Exception $exception) { | |
+ if ($this->hasCustomerId()) { | |
+ $this->updateCustomerFromVisitor(); | |
+ parent::save(); | |
+ } else { | |
+ Mage::logException($exception); | |
+ } | |
+ } | |
} | |
return $this; | |
@@ -223,7 +232,16 @@ abstract class Mage_Reports_Model_Product_Index_Abstract extends Mage_Core_Model | |
*/ | |
public function registerIds($productIds) | |
{ | |
- $this->_getResource()->registerIds($this, $productIds); | |
+ try { | |
+ $this->_getResource()->registerIds($this, $productIds); | |
+ } catch (Exception $exception) { | |
+ if ($this->hasCustomerId()) { | |
+ $this->updateCustomerFromVisitor(); | |
+ $this->_getResource()->registerIds($this, $productIds); | |
+ } else { | |
+ Mage::logException($exception); | |
+ } | |
+ } | |
$this->_getSession()->unsData($this->_countCacheKey); | |
return $this; | |
} | |
diff --git a/app/code/core/Mage/Reports/Model/Resource/Helper/Mysql4.php b/app/code/core/Mage/Reports/Model/Resource/Helper/Mysql4.php | |
index cf8519e..e69429f 100644 | |
--- a/app/code/core/Mage/Reports/Model/Resource/Helper/Mysql4.php | |
+++ b/app/code/core/Mage/Reports/Model/Resource/Helper/Mysql4.php | |
@@ -77,22 +77,44 @@ class Mage_Reports_Model_Resource_Helper_Mysql4 extends Mage_Core_Model_Resource | |
} | |
$columns = array( | |
- 'period' => 't.period', | |
- 'store_id' => 't.store_id', | |
- 'product_id' => 't.product_id', | |
- 'product_name' => 't.product_name', | |
- 'product_price' => 't.product_price', | |
+ 'period' => 't.period', | |
+ 'store_id' => 't.store_id', | |
+ 'product_id' => 't.product_id', | |
+ 'product_name' => 't.product_name', | |
+ 'product_price' => 't.product_price', | |
); | |
if ($type == 'day') { | |
$columns['id'] = 't.id'; // to speed-up insert on duplicate key update | |
} | |
+ if ($column == 'qty_ordered') | |
+ { | |
+ $columns['product_type_id'] = 't.product_type_id'; | |
+ } | |
+ | |
$cols = array_keys($columns); | |
$cols['total_qty'] = new Zend_Db_Expr('SUM(t.' . $column . ')'); | |
+ | |
$periodSubSelect->from(array('t' => $mainTable), $cols) | |
- ->group(array('t.store_id', $periodCol, 't.product_id')) | |
- ->order(array('t.store_id', $periodCol, 'total_qty DESC')); | |
+ ->group(array('t.store_id', $periodCol, 't.product_id')); | |
+ | |
+ if ($column == 'qty_ordered') { | |
+ $productTypesInExpr = $adapter->quoteInto( | |
+ 't.product_type_id IN (?)', | |
+ Mage_Catalog_Model_Product_Type::getCompositeTypes() | |
+ ); | |
+ $periodSubSelect->order( | |
+ array( | |
+ 't.store_id', | |
+ $periodCol, | |
+ $adapter->getCheckSql($productTypesInExpr, 1, 0), | |
+ 'total_qty DESC' | |
+ ) | |
+ ); | |
+ } else { | |
+ $periodSubSelect->order(array('t.store_id', $periodCol, 'total_qty DESC')); | |
+ } | |
$cols = $columns; | |
$cols[$column] = 't.total_qty'; | |
diff --git a/app/code/core/Mage/Rss/Controller/Abstract.php b/app/code/core/Mage/Rss/Controller/Abstract.php | |
new file mode 100644 | |
index 0000000..e94fe66 | |
--- /dev/null | |
+++ b/app/code/core/Mage/Rss/Controller/Abstract.php | |
@@ -0,0 +1,77 @@ | |
+<?php | |
+/** | |
+ * Magento | |
+ * | |
+ * NOTICE OF LICENSE | |
+ * | |
+ * This source file is subject to the Open Software License (OSL 3.0) | |
+ * that is bundled with this package in the file LICENSE.txt. | |
+ * It is also available through the world-wide-web at this URL: | |
+ * http://opensource.org/licenses/osl-3.0.php | |
+ * If you did not receive a copy of the license and are unable to | |
+ * obtain it through the world-wide-web, please send an email | |
+ * to [email protected] so we can send you a copy immediately. | |
+ * | |
+ * DISCLAIMER | |
+ * | |
+ * Do not edit or add to this file if you wish to upgrade Magento to newer | |
+ * versions in the future. If you wish to customize Magento for your | |
+ * needs please refer to http://www.magento.com for more information. | |
+ * | |
+ * @category Mage | |
+ * @package Mage_Rss | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
+ */ | |
+ | |
+/** | |
+ * Rss abstract controller | |
+ * | |
+ * @category Mage | |
+ * @package Mage_Rss | |
+ * @author Magento Core Team <[email protected]> | |
+ */ | |
+class Mage_Rss_Controller_Abstract extends Mage_Core_Controller_Front_Action | |
+{ | |
+ /** | |
+ * Check feed enabled in config | |
+ * | |
+ * @param string $code | |
+ * @return boolean | |
+ */ | |
+ protected function isFeedEnable($code) | |
+ { | |
+ return $this->_getHelper('rss')->isRssEnabled() | |
+ && Mage::getStoreConfig('rss/'. $code); | |
+ } | |
+ | |
+ /** | |
+ * Do check feed enabled and prepare response | |
+ * | |
+ * @param string $code | |
+ * @return boolean | |
+ */ | |
+ protected function checkFeedEnable($code) | |
+ { | |
+ if ($this->isFeedEnable($code)) { | |
+ $this->getResponse()->setHeader('Content-type', 'text/xml; charset=UTF-8'); | |
+ return true; | |
+ } else { | |
+ $this->getResponse()->setHeader('HTTP/1.1', '404 Not Found'); | |
+ $this->getResponse()->setHeader('Status', '404 File not found'); | |
+ $this->_forward('nofeed', 'index', 'rss'); | |
+ return false; | |
+ } | |
+ } | |
+ | |
+ /** | |
+ * Retrieve helper instance | |
+ * | |
+ * @param string $name | |
+ * @return Mage_Core_Helper_Abstract | |
+ */ | |
+ protected function _getHelper($name) | |
+ { | |
+ return Mage::helper($name); | |
+ } | |
+} | |
diff --git a/app/code/core/Mage/Rss/controllers/CatalogController.php b/app/code/core/Mage/Rss/controllers/CatalogController.php | |
index 33d71a6..9bc8803 100644 | |
--- a/app/code/core/Mage/Rss/controllers/CatalogController.php | |
+++ b/app/code/core/Mage/Rss/controllers/CatalogController.php | |
@@ -32,55 +32,41 @@ | |
* @author Magento Core Team <[email protected]> | |
*/ | |
-class Mage_Rss_CatalogController extends Mage_Core_Controller_Front_Action | |
+class Mage_Rss_CatalogController extends Mage_Rss_Controller_Abstract | |
{ | |
- protected function isFeedEnable($code) | |
- { | |
- return Mage::getStoreConfig('rss/catalog/'.$code); | |
- } | |
- | |
- protected function checkFeedEnable($code) | |
- { | |
- if ($this->isFeedEnable($code)) { | |
- $this->getResponse()->setHeader('Content-type', 'text/xml; charset=UTF-8'); | |
- return true; | |
- } else { | |
- $this->getResponse()->setHeader('HTTP/1.1','404 Not Found'); | |
- $this->getResponse()->setHeader('Status','404 File not found'); | |
- $this->_forward('nofeed','index','rss'); | |
- return false; | |
- } | |
- } | |
- | |
public function newAction() | |
{ | |
- $this->checkFeedEnable('new'); | |
- $this->loadLayout(false); | |
- $this->renderLayout(); | |
+ if ($this->checkFeedEnable('catalog/new')) { | |
+ $this->loadLayout(false); | |
+ $this->renderLayout(); | |
+ } | |
} | |
public function specialAction() | |
{ | |
- $this->checkFeedEnable('special'); | |
- $this->loadLayout(false); | |
- $this->renderLayout(); | |
+ if ($this->checkFeedEnable('catalog/special')) { | |
+ $this->loadLayout(false); | |
+ $this->renderLayout(); | |
+ } | |
} | |
public function salesruleAction() | |
{ | |
- $this->checkFeedEnable('salesrule'); | |
- $this->loadLayout(false); | |
- $this->renderLayout(); | |
+ if ($this->checkFeedEnable('catalog/salesrule')) { | |
+ $this->loadLayout(false); | |
+ $this->renderLayout(); | |
+ } | |
} | |
public function tagAction() | |
{ | |
- if ($this->checkFeedEnable('tag')) { | |
+ if ($this->isFeedEnable('catalog/tag')) { | |
$tagName = urldecode($this->getRequest()->getParam('tagName')); | |
$tagModel = Mage::getModel('tag/tag'); | |
$tagModel->loadByName($tagName); | |
if ($tagModel->getId() && $tagModel->getStatus()==$tagModel->getApprovedStatus()) { | |
Mage::register('tag_model', $tagModel); | |
+ $this->getResponse()->setHeader('Content-type', 'text/xml; charset=UTF-8'); | |
$this->loadLayout(false); | |
$this->renderLayout(); | |
return; | |
@@ -91,21 +77,23 @@ class Mage_Rss_CatalogController extends Mage_Core_Controller_Front_Action | |
public function notifystockAction() | |
{ | |
- $this->getResponse()->setHeader('Content-type', 'text/xml; charset=UTF-8'); | |
- $this->loadLayout(false); | |
- $this->renderLayout(); | |
+ if ($this->checkFeedEnable('catalog/notifystock')) { | |
+ $this->loadLayout(false); | |
+ $this->renderLayout(); | |
+ } | |
} | |
public function reviewAction() | |
{ | |
- $this->getResponse()->setHeader('Content-type', 'text/xml; charset=UTF-8'); | |
- $this->loadLayout(false); | |
- $this->renderLayout(); | |
+ if ($this->checkFeedEnable('catalog/review')) { | |
+ $this->loadLayout(false); | |
+ $this->renderLayout(); | |
+ } | |
} | |
public function categoryAction() | |
{ | |
- if ($this->checkFeedEnable('category')) { | |
+ if ($this->checkFeedEnable('catalog/category')) { | |
$this->loadLayout(false); | |
$this->renderLayout(); | |
} | |
@@ -119,11 +107,11 @@ class Mage_Rss_CatalogController extends Mage_Core_Controller_Front_Action | |
public function preDispatch() | |
{ | |
$action = strtolower($this->getRequest()->getActionName()); | |
- if ($action == 'notifystock') { | |
+ if ($action == 'notifystock' && $this->isFeedEnable('catalog/notifystock')) { | |
$this->_currentArea = 'adminhtml'; | |
Mage::helper('rss')->authAdmin('catalog/products'); | |
} | |
- if ($action == 'review') { | |
+ if ($action == 'review' && $this->isFeedEnable('catalog/review')) { | |
$this->_currentArea = 'adminhtml'; | |
Mage::helper('rss')->authAdmin('catalog/reviews_ratings'); | |
} | |
diff --git a/app/code/core/Mage/Rss/controllers/IndexController.php b/app/code/core/Mage/Rss/controllers/IndexController.php | |
index 48ae781..362ebe7 100644 | |
--- a/app/code/core/Mage/Rss/controllers/IndexController.php | |
+++ b/app/code/core/Mage/Rss/controllers/IndexController.php | |
@@ -30,7 +30,7 @@ | |
* @file IndexController.php | |
* @author Magento Core Team <[email protected]> | |
*/ | |
-class Mage_Rss_IndexController extends Mage_Core_Controller_Front_Action | |
+class Mage_Rss_IndexController extends Mage_Rss_Controller_Abstract | |
{ | |
/** | |
* Current wishlist | |
@@ -80,9 +80,7 @@ class Mage_Rss_IndexController extends Mage_Core_Controller_Front_Action | |
*/ | |
public function wishlistAction() | |
{ | |
- if (!Mage::getStoreConfig('rss/wishlist/active')) { | |
- $this->getResponse()->setHeader('HTTP/1.1','404 Not Found'); | |
- $this->getResponse()->setHeader('Status','404 File not found'); | |
+ if (!$this->isFeedEnable('wishlist/active')) { | |
$this->_forward('nofeed','index','rss'); | |
return; | |
} | |
@@ -156,15 +154,4 @@ class Mage_Rss_IndexController extends Mage_Core_Controller_Front_Action | |
return $this->_customer; | |
} | |
- | |
- /** | |
- * Retrieve helper instance | |
- * | |
- * @param string $name | |
- * @return Mage_Core_Helper_Abstract | |
- */ | |
- protected function _getHelper($name) | |
- { | |
- return Mage::helper($name); | |
- } | |
} | |
diff --git a/app/code/core/Mage/Rss/controllers/OrderController.php b/app/code/core/Mage/Rss/controllers/OrderController.php | |
index 52c3584..6b29146 100644 | |
--- a/app/code/core/Mage/Rss/controllers/OrderController.php | |
+++ b/app/code/core/Mage/Rss/controllers/OrderController.php | |
@@ -32,23 +32,25 @@ | |
* @author Magento Core Team <[email protected]> | |
*/ | |
-class Mage_Rss_OrderController extends Mage_Core_Controller_Front_Action | |
+class Mage_Rss_OrderController extends Mage_Rss_Controller_Abstract | |
{ | |
public function newAction() | |
{ | |
- $this->getResponse()->setHeader('Content-type', 'text/xml; charset=UTF-8'); | |
- $this->loadLayout(false); | |
- $this->renderLayout(); | |
+ if ($this->checkFeedEnable('order/new')) { | |
+ $this->loadLayout(false); | |
+ $this->renderLayout(); | |
+ } | |
} | |
public function customerAction() | |
{ | |
- if (Mage::app()->getStore()->isCurrentlySecure()) { | |
- $this->getResponse()->setHeader('Content-type', 'text/xml; charset=UTF-8'); | |
- Mage::helper('rss')->authFrontend(); | |
- } else { | |
- $this->_redirect('rss/order/customer', array('_secure'=>true)); | |
- return $this; | |
+ if ($this->checkFeedEnable('order/customer')) { | |
+ if (Mage::app()->getStore()->isCurrentlySecure()) { | |
+ Mage::helper('rss')->authFrontend(); | |
+ } else { | |
+ $this->_redirect('rss/order/customer', array('_secure'=>true)); | |
+ return $this; | |
+ } | |
} | |
} | |
@@ -57,13 +59,15 @@ class Mage_Rss_OrderController extends Mage_Core_Controller_Front_Action | |
*/ | |
public function statusAction() | |
{ | |
- $order = Mage::helper('rss/order')->getOrderByStatusUrlKey((string)$this->getRequest()->getParam('data')); | |
- if (!is_null($order)) { | |
- Mage::register('current_order', $order); | |
- $this->getResponse()->setHeader('Content-type', 'text/xml; charset=UTF-8'); | |
- $this->loadLayout(false); | |
- $this->renderLayout(); | |
- return; | |
+ if ($this->isFeedEnable('order/status_notified')) { | |
+ $order = Mage::helper('rss/order')->getOrderByStatusUrlKey((string)$this->getRequest()->getParam('data')); | |
+ if (!is_null($order)) { | |
+ Mage::register('current_order', $order); | |
+ $this->getResponse()->setHeader('Content-type', 'text/xml; charset=UTF-8'); | |
+ $this->loadLayout(false); | |
+ $this->renderLayout(); | |
+ return; | |
+ } | |
} | |
$this->_forward('nofeed', 'index', 'rss'); | |
} | |
@@ -76,7 +80,7 @@ class Mage_Rss_OrderController extends Mage_Core_Controller_Front_Action | |
public function preDispatch() | |
{ | |
$action = strtolower($this->getRequest()->getActionName()); | |
- if ($action == 'new') { | |
+ if ($action == 'new' && $this->isFeedEnable('order/new')) { | |
$this->_currentArea = 'adminhtml'; | |
Mage::helper('rss')->authAdmin('sales/order'); | |
} | |
diff --git a/app/code/core/Mage/Rss/data/rss_setup/data-install-1.6.0.0.php b/app/code/core/Mage/Rss/data/rss_setup/data-install-1.6.0.0.php | |
new file mode 100644 | |
index 0000000..c6b182c | |
--- /dev/null | |
+++ b/app/code/core/Mage/Rss/data/rss_setup/data-install-1.6.0.0.php | |
@@ -0,0 +1,34 @@ | |
+<?php | |
+/** | |
+ * Magento | |
+ * | |
+ * NOTICE OF LICENSE | |
+ * | |
+ * This source file is subject to the Open Software License (OSL 3.0) | |
+ * that is bundled with this package in the file LICENSE.txt. | |
+ * It is also available through the world-wide-web at this URL: | |
+ * http://opensource.org/licenses/osl-3.0.php | |
+ * If you did not receive a copy of the license and are unable to | |
+ * obtain it through the world-wide-web, please send an email | |
+ * to [email protected] so we can send you a copy immediately. | |
+ * | |
+ * DISCLAIMER | |
+ * | |
+ * Do not edit or add to this file if you wish to upgrade Magento to newer | |
+ * versions in the future. If you wish to customize Magento for your | |
+ * needs please refer to http://www.magento.com for more information. | |
+ * | |
+ * @category Mage | |
+ * @package Mage_Rss | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
+ */ | |
+ | |
+ | |
+/* @var $installer Mage_Core_Model_Resource_Setup */ | |
+ | |
+$installer = $this; | |
+ | |
+$this->deleteConfigData(Mage_Rss_Helper_Data::XML_PATH_RSS_ACTIVE); | |
+ | |
+$installer->endSetup(); | |
diff --git a/app/code/core/Mage/Rss/etc/config.xml b/app/code/core/Mage/Rss/etc/config.xml | |
index ab7a5b2..33d6ded 100644 | |
--- a/app/code/core/Mage/Rss/etc/config.xml | |
+++ b/app/code/core/Mage/Rss/etc/config.xml | |
@@ -47,10 +47,14 @@ | |
<class>Mage_Rss_Block</class> | |
</rss> | |
</blocks> | |
+ <resources> | |
+ <rss_setup> | |
+ <setup> | |
+ <module>Mage_Rss</module> | |
+ </setup> | |
+ </rss_setup> | |
+ </resources> | |
</global> | |
- <admin> | |
- | |
- </admin> | |
<adminhtml> | |
<translate> | |
<modules> | |
diff --git a/app/code/core/Mage/Rss/etc/system.xml b/app/code/core/Mage/Rss/etc/system.xml | |
index 566193b..dbe8785 100644 | |
--- a/app/code/core/Mage/Rss/etc/system.xml | |
+++ b/app/code/core/Mage/Rss/etc/system.xml | |
@@ -56,7 +56,6 @@ | |
</active> | |
</fields> | |
</config> | |
- | |
<wishlist translate="label"> | |
<label>Wishlist</label> | |
<frontend_type>text</frontend_type> | |
@@ -76,7 +75,6 @@ | |
</active> | |
</fields> | |
</wishlist> | |
- | |
<catalog translate="label"> | |
<label>Catalog</label> | |
<frontend_type>text</frontend_type> | |
@@ -130,10 +128,27 @@ | |
<show_in_website>1</show_in_website> | |
<show_in_store>1</show_in_store> | |
</category> | |
+ <notifystock translate="label"> | |
+ <label>Stock Notification</label> | |
+ <frontend_type>select</frontend_type> | |
+ <source_model>adminhtml/system_config_source_enabledisable</source_model> | |
+ <sort_order>15</sort_order> | |
+ <show_in_default>1</show_in_default> | |
+ <show_in_website>1</show_in_website> | |
+ <show_in_store>1</show_in_store> | |
+ </notifystock> | |
+ <review translate="label"> | |
+ <label>Review Notification</label> | |
+ <frontend_type>select</frontend_type> | |
+ <source_model>adminhtml/system_config_source_enabledisable</source_model> | |
+ <sort_order>16</sort_order> | |
+ <show_in_default>1</show_in_default> | |
+ <show_in_website>1</show_in_website> | |
+ <show_in_store>1</show_in_store> | |
+ </review> | |
</fields> | |
</catalog> | |
- | |
- <order> | |
+ <order translate="label"> | |
<label>Order</label> | |
<frontend_type>text</frontend_type> | |
<sort_order>4</sort_order> | |
@@ -150,9 +165,73 @@ | |
<show_in_website>1</show_in_website> | |
<show_in_store>1</show_in_store> | |
</status_notified> | |
+ <new translate="label"> | |
+ <label>New Order Notification</label> | |
+ <frontend_type>select</frontend_type> | |
+ <source_model>adminhtml/system_config_source_enabledisable</source_model> | |
+ <sort_order>20</sort_order> | |
+ <show_in_default>1</show_in_default> | |
+ <show_in_website>1</show_in_website> | |
+ <show_in_store>1</show_in_store> | |
+ </new> | |
+ <customer translate="label"> | |
+ <label>Customer Order Notification</label> | |
+ <frontend_type>select</frontend_type> | |
+ <source_model>adminhtml/system_config_source_enabledisable</source_model> | |
+ <sort_order>30</sort_order> | |
+ <show_in_default>1</show_in_default> | |
+ <show_in_website>1</show_in_website> | |
+ <show_in_store>1</show_in_store> | |
+ </customer> | |
</fields> | |
</order> | |
- | |
+ <admin_catalog translate="label"> | |
+ <label>Admin Catalog</label> | |
+ <frontend_type>text</frontend_type> | |
+ <sort_order>5</sort_order> | |
+ <show_in_default>1</show_in_default> | |
+ <show_in_website>1</show_in_website> | |
+ <show_in_store>1</show_in_store> | |
+ <fields> | |
+ <review translate="label"> | |
+ <label>Review Notification</label> | |
+ <frontend_type>select</frontend_type> | |
+ <source_model>adminhtml/system_config_source_enabledisable</source_model> | |
+ <sort_order>10</sort_order> | |
+ <show_in_default>1</show_in_default> | |
+ <show_in_website>1</show_in_website> | |
+ <show_in_store>1</show_in_store> | |
+ </review> | |
+ <notifystock translate="label"> | |
+ <label>Stock Notification</label> | |
+ <frontend_type>select</frontend_type> | |
+ <source_model>adminhtml/system_config_source_enabledisable</source_model> | |
+ <sort_order>20</sort_order> | |
+ <show_in_default>1</show_in_default> | |
+ <show_in_website>1</show_in_website> | |
+ <show_in_store>1</show_in_store> | |
+ </notifystock> | |
+ </fields> | |
+ </admin_catalog> | |
+ <admin_order translate="label"> | |
+ <label>Admin Order</label> | |
+ <frontend_type>text</frontend_type> | |
+ <sort_order>6</sort_order> | |
+ <show_in_default>1</show_in_default> | |
+ <show_in_website>1</show_in_website> | |
+ <show_in_store>1</show_in_store> | |
+ <fields> | |
+ <new translate="label"> | |
+ <label>New Order Notification</label> | |
+ <frontend_type>select</frontend_type> | |
+ <source_model>adminhtml/system_config_source_enabledisable</source_model> | |
+ <sort_order>10</sort_order> | |
+ <show_in_default>1</show_in_default> | |
+ <show_in_website>1</show_in_website> | |
+ <show_in_store>1</show_in_store> | |
+ </new> | |
+ </fields> | |
+ </admin_order> | |
</groups> | |
</rss> | |
</sections> | |
diff --git a/app/code/core/Mage/Sales/Helper/Guest.php b/app/code/core/Mage/Sales/Helper/Guest.php | |
index 5b32691..d2f15a0 100644 | |
--- a/app/code/core/Mage/Sales/Helper/Guest.php | |
+++ b/app/code/core/Mage/Sales/Helper/Guest.php | |
@@ -81,7 +81,7 @@ class Mage_Sales_Helper_Guest extends Mage_Core_Helper_Data | |
$billingAddress = $order->getBillingAddress(); | |
if ((strtolower($lastName) != strtolower($billingAddress->getLastname())) | |
|| ($type == 'email' | |
- && strtolower($email) != strtolower($billingAddress->getEmail())) | |
+ && strtolower($email) != strtolower($order->getCustomerEmail())) | |
|| ($type == 'zip' | |
&& (strtolower($zip) != strtolower($billingAddress->getPostcode()))) | |
) { | |
diff --git a/app/code/core/Mage/Sales/Model/Email/Template.php b/app/code/core/Mage/Sales/Model/Email/Template.php | |
index f546955..418e1ab 100644 | |
--- a/app/code/core/Mage/Sales/Model/Email/Template.php | |
+++ b/app/code/core/Mage/Sales/Model/Email/Template.php | |
@@ -33,7 +33,7 @@ class Mage_Sales_Model_Email_Template extends Mage_Core_Model_Email_Template | |
if (!$filename) { | |
return ''; | |
} | |
- extract($variables); | |
+ extract($variables, EXTR_SKIP); | |
ob_start(); | |
include $filename; | |
return ob_get_clean(); | |
diff --git a/app/code/core/Mage/Sales/Model/Order.php b/app/code/core/Mage/Sales/Model/Order.php | |
index d4c04d4..e5faa4d 100644 | |
--- a/app/code/core/Mage/Sales/Model/Order.php | |
+++ b/app/code/core/Mage/Sales/Model/Order.php | |
@@ -1255,7 +1255,11 @@ class Mage_Sales_Model_Order extends Mage_Sales_Model_Abstract | |
if (!$asObject) { | |
return $shippingMethod; | |
} else { | |
- list($carrierCode, $method) = explode('_', $shippingMethod, 2); | |
+ $segments = explode('_', $shippingMethod, 2); | |
+ if (!isset($segments[1])) { | |
+ $segments[1] = $segments[0]; | |
+ } | |
+ list($carrierCode, $method) = $segments; | |
return new Varien_Object(array( | |
'carrier_code' => $carrierCode, | |
'method' => $method | |
@@ -2021,7 +2025,12 @@ class Mage_Sales_Model_Order extends Mage_Sales_Model_Abstract | |
*/ | |
public function hasShipments() | |
{ | |
- return $this->getShipmentsCollection()->count(); | |
+ $result = false; | |
+ $shipmentsCollection = $this->getShipmentsCollection(); | |
+ if ($shipmentsCollection) { | |
+ $result = (bool)$shipmentsCollection->count(); | |
+ } | |
+ return $result; | |
} | |
/** | |
@@ -2031,7 +2040,12 @@ class Mage_Sales_Model_Order extends Mage_Sales_Model_Abstract | |
*/ | |
public function hasCreditmemos() | |
{ | |
- return $this->getCreditmemosCollection()->count(); | |
+ $result = false; | |
+ $creditmemosCollection = $this->getCreditmemosCollection(); | |
+ if ($creditmemosCollection) { | |
+ $result = (bool)$creditmemosCollection->count(); | |
+ } | |
+ return $result; | |
} | |
diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Subtotal.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Subtotal.php | |
index a4f76a9..06cba34 100644 | |
--- a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Subtotal.php | |
+++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Subtotal.php | |
@@ -40,9 +40,6 @@ class Mage_Sales_Model_Order_Invoice_Total_Subtotal extends Mage_Sales_Model_Ord | |
$subtotalInclTax= 0; | |
$baseSubtotalInclTax = 0; | |
- $totalWeeeDiscount = 0; | |
- $totalBaseWeeeDiscount = 0; | |
- | |
$order = $invoice->getOrder(); | |
foreach ($invoice->getAllItems() as $item) { | |
@@ -52,50 +49,21 @@ class Mage_Sales_Model_Order_Invoice_Total_Subtotal extends Mage_Sales_Model_Ord | |
$item->calcRowTotal(); | |
- $subtotal += $item->getRowTotal(); | |
- $baseSubtotal += $item->getBaseRowTotal(); | |
- $subtotalInclTax+= $item->getRowTotalInclTax(); | |
- $baseSubtotalInclTax += $item->getBaseRowTotalInclTax(); | |
- $totalWeeeDiscount += $item->getOrderItem()->getDiscountAppliedForWeeeTax(); | |
- $totalBaseWeeeDiscount += $item->getOrderItem()->getBaseDiscountAppliedForWeeeTax(); | |
+ $subtotal += $item->getRowTotal(); | |
+ $baseSubtotal += $item->getBaseRowTotal(); | |
+ $subtotalInclTax += $item->getRowTotalInclTax() + $item->getWeeeTaxAppliedRowAmount(); | |
+ $baseSubtotalInclTax += $item->getBaseRowTotalInclTax() + $item->getBaseWeeeTaxAppliedRowAmount(); | |
} | |
$allowedSubtotal = $order->getSubtotal() - $order->getSubtotalInvoiced(); | |
$baseAllowedSubtotal = $order->getBaseSubtotal() - $order->getBaseSubtotalInvoiced(); | |
- $allowedSubtotalInclTax = $allowedSubtotal + $order->getHiddenTaxAmount() + $totalWeeeDiscount | |
- + $order->getTaxAmount() - $order->getTaxInvoiced() - $order->getHiddenTaxInvoiced(); | |
- $baseAllowedSubtotalInclTax = $baseAllowedSubtotal + $order->getBaseHiddenTaxAmount() + $totalBaseWeeeDiscount | |
- + $order->getBaseTaxAmount() - $order->getBaseTaxInvoiced() - $order->getBaseHiddenTaxInvoiced(); | |
- | |
- /** | |
- * Check if shipping tax calculation is included to current invoice. | |
- */ | |
- $includeShippingTax = true; | |
- foreach ($invoice->getOrder()->getInvoiceCollection() as $previousInvoice) { | |
- if ($previousInvoice->getShippingAmount() && !$previousInvoice->isCanceled()) { | |
- $includeShippingTax = false; | |
- break; | |
- } | |
- } | |
- | |
- if ($includeShippingTax) { | |
- $allowedSubtotalInclTax -= $order->getShippingTaxAmount(); | |
- $baseAllowedSubtotalInclTax -= $order->getBaseShippingTaxAmount(); | |
- } else { | |
- $allowedSubtotalInclTax += $order->getShippingHiddenTaxAmount(); | |
- $baseAllowedSubtotalInclTax += $order->getBaseShippingHiddenTaxAmount(); | |
- } | |
if ($invoice->isLast()) { | |
$subtotal = $allowedSubtotal; | |
$baseSubtotal = $baseAllowedSubtotal; | |
- $subtotalInclTax = $allowedSubtotalInclTax; | |
- $baseSubtotalInclTax = $baseAllowedSubtotalInclTax; | |
} else { | |
$subtotal = min($allowedSubtotal, $subtotal); | |
$baseSubtotal = min($baseAllowedSubtotal, $baseSubtotal); | |
- $subtotalInclTax = min($allowedSubtotalInclTax, $subtotalInclTax); | |
- $baseSubtotalInclTax = min($baseAllowedSubtotalInclTax, $baseSubtotalInclTax); | |
} | |
$invoice->setSubtotal($subtotal); | |
diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Subtotal.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Subtotal.php | |
index 8d8163e..3551d55 100644 | |
--- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Subtotal.php | |
+++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Subtotal.php | |
@@ -111,7 +111,7 @@ class Mage_Sales_Model_Quote_Address_Total_Subtotal extends Mage_Sales_Model_Quo | |
$item->setPrice($finalPrice) | |
->setBaseOriginalPrice($finalPrice); | |
$item->calcRowTotal(); | |
- } else if (!$quoteItem->getParentItem()) { | |
+ } else if (!$quoteItem->getParentItem() && !$item->getHasError()) { | |
$finalPrice = $product->getFinalPrice($quoteItem->getQty()); | |
$item->setPrice($finalPrice) | |
->setBaseOriginalPrice($finalPrice); | |
diff --git a/app/code/core/Mage/Sales/Model/Quote/Item.php b/app/code/core/Mage/Sales/Model/Quote/Item.php | |
index 2d10ed5..1bb44c1 100644 | |
--- a/app/code/core/Mage/Sales/Model/Quote/Item.php | |
+++ b/app/code/core/Mage/Sales/Model/Quote/Item.php | |
@@ -507,7 +507,7 @@ class Mage_Sales_Model_Quote_Item extends Mage_Sales_Model_Quote_Item_Abstract | |
$itemOptionValue = $_itemOptionValue; | |
$optionValue = $_optionValue; | |
// looks like it does not break bundle selection qty | |
- foreach (array('qty', 'uenc', 'form_key') as $key) { | |
+ foreach (array('qty', 'uenc', 'form_key', 'item', 'original_qty') as $key) { | |
unset($itemOptionValue[$key], $optionValue[$key]); | |
} | |
} | |
diff --git a/app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php b/app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php | |
index a18a972..dddf5b1 100644 | |
--- a/app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php | |
+++ b/app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php | |
@@ -130,7 +130,10 @@ abstract class Mage_Sales_Model_Quote_Item_Abstract extends Mage_Core_Model_Abst | |
{ | |
if ($parentItem) { | |
$this->_parentItem = $parentItem; | |
- $parentItem->addChild($this); | |
+ // Prevent duplication of children in those are already set | |
+ if (!in_array($this, $parentItem->getChildren())) { | |
+ $parentItem->addChild($this); | |
+ } | |
} | |
return $this; | |
} | |
diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote.php b/app/code/core/Mage/Sales/Model/Resource/Quote.php | |
index d31602a..f89500b 100644 | |
--- a/app/code/core/Mage/Sales/Model/Resource/Quote.php | |
+++ b/app/code/core/Mage/Sales/Model/Resource/Quote.php | |
@@ -156,13 +156,13 @@ class Mage_Sales_Model_Resource_Quote extends Mage_Sales_Model_Resource_Abstract | |
/** | |
* Check is order increment id use in sales/order table | |
* | |
- * @param int $orderIncrementId | |
+ * @param string $orderIncrementId | |
* @return boolean | |
*/ | |
public function isOrderIncrementIdUsed($orderIncrementId) | |
{ | |
$adapter = $this->_getReadAdapter(); | |
- $bind = array(':increment_id' => (int)$orderIncrementId); | |
+ $bind = array(':increment_id' => $orderIncrementId); | |
$select = $adapter->select(); | |
$select->from($this->getTable('sales/order'), 'entity_id') | |
->where('increment_id = :increment_id'); | |
diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Payment.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Payment.php | |
index 237e023..a748ea1 100644 | |
--- a/app/code/core/Mage/Sales/Model/Resource/Quote/Payment.php | |
+++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Payment.php | |
@@ -53,11 +53,7 @@ class Mage_Sales_Model_Resource_Quote_Payment extends Mage_Sales_Model_Resource_ | |
} | |
/** | |
- * Unserialize Varien_Object field in an object | |
- * | |
- * @param Mage_Core_Model_Abstract $object | |
- * @param string $field | |
- * @param mixed $defaultValue | |
+ * @see Mage_Core_Model_Resource_Abstract::_unserializeField() | |
*/ | |
protected function _unserializeField(Varien_Object $object, $field, $defaultValue = null) | |
{ | |
diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers.php b/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers.php | |
index ae3a5b9..a7f8247 100644 | |
--- a/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers.php | |
+++ b/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers.php | |
@@ -96,6 +96,7 @@ class Mage_Sales_Model_Resource_Report_Bestsellers extends Mage_Sales_Model_Reso | |
'period' => $periodExpr, | |
'store_id' => 'source_table.store_id', | |
'product_id' => 'order_item.product_id', | |
+ 'product_type_id' => 'product.type_id', | |
'product_name' => new Zend_Db_Expr( | |
sprintf('MIN(%s)', | |
$adapter->getIfNullSql('product_name.value','product_default_name.value') | |
@@ -132,16 +133,9 @@ class Mage_Sales_Model_Resource_Report_Bestsellers extends Mage_Sales_Model_Reso | |
/** @var Mage_Catalog_Model_Resource_Product $product */ | |
$product = Mage::getResourceSingleton('catalog/product'); | |
- $productTypes = array( | |
- Mage_Catalog_Model_Product_Type::TYPE_GROUPED, | |
- Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE, | |
- Mage_Catalog_Model_Product_Type::TYPE_BUNDLE, | |
- ); | |
- | |
$joinExpr = array( | |
'product.entity_id = order_item.product_id', | |
- $adapter->quoteInto('product.entity_type_id = ?', $product->getTypeId()), | |
- $adapter->quoteInto('product.type_id NOT IN(?)', $productTypes) | |
+ $adapter->quoteInto('product.entity_type_id = ?', $product->getTypeId()) | |
); | |
$joinExpr = implode(' AND ', $joinExpr); | |
@@ -255,6 +249,7 @@ class Mage_Sales_Model_Resource_Report_Bestsellers extends Mage_Sales_Model_Reso | |
'period' => 'period', | |
'store_id' => new Zend_Db_Expr(Mage_Core_Model_App::ADMIN_STORE_ID), | |
'product_id' => 'product_id', | |
+ 'product_type_id' => 'product_type_id', | |
'product_name' => new Zend_Db_Expr('MIN(product_name)'), | |
'product_price' => new Zend_Db_Expr( | |
sprintf('%s', | |
diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers/Collection.php | |
index 8643bca..77a5ff3 100644 | |
--- a/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers/Collection.php | |
+++ b/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers/Collection.php | |
@@ -77,11 +77,12 @@ class Mage_Sales_Model_Resource_Report_Bestsellers_Collection | |
$this->_selectedColumns = $this->getAggregatedColumns(); | |
} else { | |
$this->_selectedColumns = array( | |
- 'period' => sprintf('MAX(%s)', $adapter->getDateFormatSql('period', '%Y-%m-%d')), | |
- 'qty_ordered' => 'SUM(qty_ordered)', | |
- 'product_id' => 'product_id', | |
- 'product_name' => 'MAX(product_name)', | |
- 'product_price' => 'MAX(product_price)', | |
+ 'period' => sprintf('MAX(%s)', $adapter->getDateFormatSql('period', '%Y-%m-%d')), | |
+ 'qty_ordered' => 'SUM(qty_ordered)', | |
+ 'product_id' => 'product_id', | |
+ 'product_name' => 'MAX(product_name)', | |
+ 'product_price' => 'MAX(product_price)', | |
+ 'product_type_id' => 'product_type_id' | |
); | |
if ('year' == $this->_period) { | |
$this->_selectedColumns['period'] = $adapter->getDateFormatSql('period', '%Y'); | |
@@ -113,6 +114,7 @@ class Mage_Sales_Model_Resource_Report_Bestsellers_Collection | |
->order('qty_ordered DESC') | |
->limit($this->_ratingLimit); | |
+ $this->_applyProductTypeFilter($sel); | |
$this->_applyStoresFilterToSelect($sel); | |
return $sel; | |
@@ -220,7 +222,6 @@ class Mage_Sales_Model_Resource_Report_Bestsellers_Collection | |
$this->_applyStoresFilter(); | |
if ($this->_period) { | |
- // | |
$selectUnions = array(); | |
// apply date boundaries (before calling $this->_applyDateRangeFilter()) | |
@@ -342,6 +343,7 @@ class Mage_Sales_Model_Resource_Report_Bestsellers_Collection | |
} | |
$this->_applyDateRangeFilter(); | |
+ $this->_applyProductTypeFilter($this->getSelect()); | |
// add unions to select | |
if ($selectUnions) { | |
@@ -368,4 +370,15 @@ class Mage_Sales_Model_Resource_Report_Bestsellers_Collection | |
return $this; | |
} | |
+ | |
+ /** | |
+ * Apply filter to exclude certain product types from the collection | |
+ * | |
+ * @return Mage_Sales_Model_Resource_Report_Collection_Abstract | |
+ */ | |
+ protected function _applyProductTypeFilter(Zend_Db_Select $select) | |
+ { | |
+ $select->where('product_type_id NOT IN (?)', Mage_Catalog_Model_Product_Type::getCompositeTypes()); | |
+ return $this; | |
+ } | |
} | |
diff --git a/app/code/core/Mage/Sales/etc/config.xml b/app/code/core/Mage/Sales/etc/config.xml | |
index d76eac1..9b6f226 100644 | |
--- a/app/code/core/Mage/Sales/etc/config.xml | |
+++ b/app/code/core/Mage/Sales/etc/config.xml | |
@@ -28,7 +28,7 @@ | |
<config> | |
<modules> | |
<Mage_Sales> | |
- <version>1.6.0.9</version> | |
+ <version>1.6.0.10</version> | |
</Mage_Sales> | |
</modules> | |
<global> | |
@@ -1227,6 +1227,7 @@ | |
</grand_total> | |
<msrp> | |
<class>sales/quote_address_total_msrp</class> | |
+ <before>weee,freeshipping</before> | |
</msrp> | |
</totals> | |
<nominal_totals> | |
diff --git a/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.9-1.6.0.10.php b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.9-1.6.0.10.php | |
new file mode 100644 | |
index 0000000..613aeaa | |
--- /dev/null | |
+++ b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.9-1.6.0.10.php | |
@@ -0,0 +1,51 @@ | |
+<?php | |
+/** | |
+ * Magento | |
+ * | |
+ * NOTICE OF LICENSE | |
+ * | |
+ * This source file is subject to the Open Software License (OSL 3.0) | |
+ * that is bundled with this package in the file LICENSE.txt. | |
+ * It is also available through the world-wide-web at this URL: | |
+ * http://opensource.org/licenses/osl-3.0.php | |
+ * If you did not receive a copy of the license and are unable to | |
+ * obtain it through the world-wide-web, please send an email | |
+ * to [email protected] so we can send you a copy immediately. | |
+ * | |
+ * DISCLAIMER | |
+ * | |
+ * Do not edit or add to this file if you wish to upgrade Magento to newer | |
+ * versions in the future. If you wish to customize Magento for your | |
+ * needs please refer to http://www.magento.com for more information. | |
+ * | |
+ * @category Mage | |
+ * @package Mage_Sales | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
+ */ | |
+ | |
+/* @var $installer Mage_Sales_Model_Entity_Setup */ | |
+$installer = $this; | |
+ | |
+$installer->startSetup(); | |
+ | |
+$bestsellersTables = array($installer->getTable('sales/bestsellers_aggregated_daily'), | |
+ $installer->getTable('sales/bestsellers_aggregated_monthly'), | |
+ $installer->getTable('sales/bestsellers_aggregated_yearly')); | |
+ | |
+foreach ($bestsellersTables as $table) { | |
+ $installer->getConnection()->addColumn( | |
+ $table, | |
+ 'product_type_id', | |
+ array( | |
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, | |
+ 'length' => 32, | |
+ 'default' => Mage_Catalog_Model_Product_Type::TYPE_SIMPLE, | |
+ 'nullable' => false, | |
+ 'after' => 'product_id', | |
+ 'comment' => 'Product Type Id' | |
+ ) | |
+ ); | |
+} | |
+ | |
+$installer->endSetup(); | |
diff --git a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product.php b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product.php | |
index 7228d20..3dc0f6f 100644 | |
--- a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product.php | |
+++ b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product.php | |
@@ -57,7 +57,7 @@ class Mage_SalesRule_Model_Rule_Condition_Product extends Mage_Rule_Model_Condit | |
public function validate(Varien_Object $object) | |
{ | |
/** @var Mage_Catalog_Model_Product $product */ | |
- $product = $object->getProduct(); | |
+ $product = ($object instanceof Mage_Catalog_Model_Product) ? $object : $object->getProduct(); | |
if (!($product instanceof Mage_Catalog_Model_Product)) { | |
$product = Mage::getModel('catalog/product')->load($object->getProductId()); | |
} | |
diff --git a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Combine.php b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Combine.php | |
index 5dadb58..49b7f58 100644 | |
--- a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Combine.php | |
+++ b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Combine.php | |
@@ -216,7 +216,22 @@ class Mage_SalesRule_Model_Rule_Condition_Product_Combine extends Mage_Rule_Mode | |
$valid = parent::validate($object); | |
if (!$valid && $product->getTypeId() == Mage_Catalog_Model_Product_Type_Configurable::TYPE_CODE) { | |
$children = $object->getChildren(); | |
- $valid = $children && $this->validate($children[0]); | |
+ if (is_array($children) and isset($children[0])) { | |
+ $child = $children[0]; | |
+ | |
+ /** @var Mage_Catalog_Model_Product $childProduct */ | |
+ $childProduct = Mage::getModel('catalog/product')->load($child->getProductId()); | |
+ $childProduct | |
+ ->setQuoteItemQty($object->getQty()) | |
+ ->setQuoteItemPrice($object->getPrice()) | |
+ ->setQuoteItemRowTotal($object->getBaseRowTotal()); | |
+ | |
+ if (!$childProduct->isVisibleInSiteVisibility()) { | |
+ $childProduct->setCategoryIds($product->getCategoryIds()); | |
+ } | |
+ | |
+ $valid = parent::validate($childProduct); | |
+ } | |
} | |
return $valid; | |
diff --git a/app/code/core/Mage/SalesRule/Model/Validator.php b/app/code/core/Mage/SalesRule/Model/Validator.php | |
index 6bf1b38..14c20bf 100644 | |
--- a/app/code/core/Mage/SalesRule/Model/Validator.php | |
+++ b/app/code/core/Mage/SalesRule/Model/Validator.php | |
@@ -245,26 +245,26 @@ class Mage_SalesRule_Model_Validator extends Mage_Core_Model_Abstract | |
$item->setFreeShipping(false); | |
foreach ($this->_getRules() as $rule) { | |
- /* @var $rule Mage_SalesRule_Model_Rule */ | |
- if (!$this->_canProcessRule($rule, $address)) { | |
- continue; | |
- } | |
- | |
- if (!$rule->getActions()->validate($item)) { | |
- continue; | |
- } | |
- switch ($rule->getSimpleFreeShipping()) { | |
- case Mage_SalesRule_Model_Rule::FREE_SHIPPING_ITEM: | |
- $item->setFreeShipping($rule->getDiscountQty() ? $rule->getDiscountQty() : true); | |
- break; | |
+ /* @var $rule Mage_SalesRule_Model_Rule */ | |
+ if ( | |
+ $rule->getSimpleFreeShipping() | |
+ && $this->_canProcessRule($rule, $address) | |
+ && $rule->getActions()->validate($item) | |
+ ) { | |
+ | |
+ switch ($rule->getSimpleFreeShipping()) { | |
+ case Mage_SalesRule_Model_Rule::FREE_SHIPPING_ITEM: | |
+ $item->setFreeShipping($rule->getDiscountQty() ? $rule->getDiscountQty() : true); | |
+ break; | |
- case Mage_SalesRule_Model_Rule::FREE_SHIPPING_ADDRESS: | |
- $address->setFreeShipping(true); | |
+ case Mage_SalesRule_Model_Rule::FREE_SHIPPING_ADDRESS: | |
+ $address->setFreeShipping(true); | |
+ break; | |
+ } | |
+ if ($rule->getStopRulesProcessing()) { | |
break; | |
- } | |
- if ($rule->getStopRulesProcessing()) { | |
- break; | |
+ } | |
} | |
} | |
return $this; | |
@@ -316,204 +316,198 @@ class Mage_SalesRule_Model_Validator extends Mage_Core_Model_Abstract | |
foreach ($this->_getRules() as $rule) { | |
/* @var $rule Mage_SalesRule_Model_Rule */ | |
- if (!$this->_canProcessRule($rule, $address)) { | |
- continue; | |
- } | |
+ if ($this->_canProcessRule($rule, $address) && $rule->getActions()->validate($item)) { | |
+ | |
+ $qty = $this->_getItemQty($item, $rule); | |
+ $rulePercent = min(100, $rule->getDiscountAmount()); | |
+ | |
+ $discountAmount = 0; | |
+ $baseDiscountAmount = 0; | |
+ //discount for original price | |
+ $originalDiscountAmount = 0; | |
+ $baseOriginalDiscountAmount = 0; | |
+ | |
+ switch ($rule->getSimpleAction()) { | |
+ case Mage_SalesRule_Model_Rule::TO_PERCENT_ACTION: | |
+ $rulePercent = max(0, 100 - $rule->getDiscountAmount()); | |
+ //no break; | |
+ case Mage_SalesRule_Model_Rule::BY_PERCENT_ACTION: | |
+ $step = $rule->getDiscountStep(); | |
+ if ($step) { | |
+ $qty = floor($qty / $step) * $step; | |
+ } | |
+ $_rulePct = $rulePercent / 100; | |
+ $discountAmount = ($qty * $itemPrice - $item->getDiscountAmount()) * $_rulePct; | |
+ $baseDiscountAmount = ($qty * $baseItemPrice - $item->getBaseDiscountAmount()) * $_rulePct; | |
+ //get discount for original price | |
+ $originalDiscountAmount = ($qty * $itemOriginalPrice - $item->getDiscountAmount()) * $_rulePct; | |
+ $baseOriginalDiscountAmount = | |
+ ($qty * $baseItemOriginalPrice - $item->getDiscountAmount()) * $_rulePct; | |
- if (!$rule->getActions()->validate($item)) { | |
- continue; | |
- } | |
+ if (!$rule->getDiscountQty() || $rule->getDiscountQty() > $qty) { | |
+ $discountPercent = min(100, $item->getDiscountPercent() + $rulePercent); | |
+ $item->setDiscountPercent($discountPercent); | |
+ } | |
+ break; | |
+ case Mage_SalesRule_Model_Rule::TO_FIXED_ACTION: | |
+ $quoteAmount = $quote->getStore()->convertPrice($rule->getDiscountAmount()); | |
+ $discountAmount = $qty * ($itemPrice - $quoteAmount); | |
+ $baseDiscountAmount = $qty * ($baseItemPrice - $rule->getDiscountAmount()); | |
+ //get discount for original price | |
+ $originalDiscountAmount = $qty * ($itemOriginalPrice - $quoteAmount); | |
+ $baseOriginalDiscountAmount = $qty * ($baseItemOriginalPrice - $rule->getDiscountAmount()); | |
+ break; | |
- $qty = $this->_getItemQty($item, $rule); | |
- $rulePercent = min(100, $rule->getDiscountAmount()); | |
+ case Mage_SalesRule_Model_Rule::BY_FIXED_ACTION: | |
+ $step = $rule->getDiscountStep(); | |
+ if ($step) { | |
+ $qty = floor($qty / $step) * $step; | |
+ } | |
+ $quoteAmount = $quote->getStore()->convertPrice($rule->getDiscountAmount()); | |
+ $discountAmount = $qty * $quoteAmount; | |
+ $baseDiscountAmount = $qty * $rule->getDiscountAmount(); | |
+ break; | |
- $discountAmount = 0; | |
- $baseDiscountAmount = 0; | |
- //discount for original price | |
- $originalDiscountAmount = 0; | |
- $baseOriginalDiscountAmount = 0; | |
+ case Mage_SalesRule_Model_Rule::CART_FIXED_ACTION: | |
+ if (empty($this->_rulesItemTotals[$rule->getId()])) { | |
+ Mage::throwException(Mage::helper('salesrule')->__('Item totals are not set for rule.')); | |
+ } | |
- switch ($rule->getSimpleAction()) { | |
- case Mage_SalesRule_Model_Rule::TO_PERCENT_ACTION: | |
- $rulePercent = max(0, 100-$rule->getDiscountAmount()); | |
- //no break; | |
- case Mage_SalesRule_Model_Rule::BY_PERCENT_ACTION: | |
- $step = $rule->getDiscountStep(); | |
- if ($step) { | |
- $qty = floor($qty/$step)*$step; | |
- } | |
- $_rulePct = $rulePercent/100; | |
- $discountAmount = ($qty * $itemPrice - $item->getDiscountAmount()) * $_rulePct; | |
- $baseDiscountAmount = ($qty * $baseItemPrice - $item->getBaseDiscountAmount()) * $_rulePct; | |
- //get discount for original price | |
- $originalDiscountAmount = ($qty * $itemOriginalPrice - $item->getDiscountAmount()) * $_rulePct; | |
- $baseOriginalDiscountAmount = | |
- ($qty * $baseItemOriginalPrice - $item->getDiscountAmount()) * $_rulePct; | |
- | |
- if (!$rule->getDiscountQty() || $rule->getDiscountQty()>$qty) { | |
- $discountPercent = min(100, $item->getDiscountPercent()+$rulePercent); | |
- $item->setDiscountPercent($discountPercent); | |
- } | |
- break; | |
- case Mage_SalesRule_Model_Rule::TO_FIXED_ACTION: | |
- $quoteAmount = $quote->getStore()->convertPrice($rule->getDiscountAmount()); | |
- $discountAmount = $qty * ($itemPrice-$quoteAmount); | |
- $baseDiscountAmount = $qty * ($baseItemPrice-$rule->getDiscountAmount()); | |
- //get discount for original price | |
- $originalDiscountAmount = $qty * ($itemOriginalPrice-$quoteAmount); | |
- $baseOriginalDiscountAmount = $qty * ($baseItemOriginalPrice-$rule->getDiscountAmount()); | |
- break; | |
+ /** | |
+ * prevent applying whole cart discount for every shipping order, but only for first order | |
+ */ | |
+ if ($quote->getIsMultiShipping()) { | |
+ $usedForAddressId = $this->getCartFixedRuleUsedForAddress($rule->getId()); | |
+ if ($usedForAddressId && $usedForAddressId != $address->getId()) { | |
+ break; | |
+ } else { | |
+ $this->setCartFixedRuleUsedForAddress($rule->getId(), $address->getId()); | |
+ } | |
+ } | |
+ $cartRules = $address->getCartFixedRules(); | |
+ if (!isset($cartRules[$rule->getId()])) { | |
+ $cartRules[$rule->getId()] = $rule->getDiscountAmount(); | |
+ } | |
- case Mage_SalesRule_Model_Rule::BY_FIXED_ACTION: | |
- $step = $rule->getDiscountStep(); | |
- if ($step) { | |
- $qty = floor($qty/$step)*$step; | |
- } | |
- $quoteAmount = $quote->getStore()->convertPrice($rule->getDiscountAmount()); | |
- $discountAmount = $qty * $quoteAmount; | |
- $baseDiscountAmount = $qty * $rule->getDiscountAmount(); | |
- break; | |
+ if ($cartRules[$rule->getId()] > 0) { | |
+ if ($this->_rulesItemTotals[$rule->getId()]['items_count'] <= 1) { | |
+ $quoteAmount = $quote->getStore()->convertPrice($cartRules[$rule->getId()]); | |
+ $baseDiscountAmount = min($baseItemPrice * $qty, $cartRules[$rule->getId()]); | |
+ } else { | |
+ $discountRate = $baseItemPrice * $qty / | |
+ $this->_rulesItemTotals[$rule->getId()]['base_items_price']; | |
+ $maximumItemDiscount = $rule->getDiscountAmount() * $discountRate; | |
+ $quoteAmount = $quote->getStore()->convertPrice($maximumItemDiscount); | |
- case Mage_SalesRule_Model_Rule::CART_FIXED_ACTION: | |
- if (empty($this->_rulesItemTotals[$rule->getId()])) { | |
- Mage::throwException(Mage::helper('salesrule')->__('Item totals are not set for rule.')); | |
- } | |
+ $baseDiscountAmount = min($baseItemPrice * $qty, $maximumItemDiscount); | |
+ $this->_rulesItemTotals[$rule->getId()]['items_count']--; | |
+ } | |
- /** | |
- * prevent applying whole cart discount for every shipping order, but only for first order | |
- */ | |
- if ($quote->getIsMultiShipping()) { | |
- $usedForAddressId = $this->getCartFixedRuleUsedForAddress($rule->getId()); | |
- if ($usedForAddressId && $usedForAddressId != $address->getId()) { | |
- break; | |
- } else { | |
- $this->setCartFixedRuleUsedForAddress($rule->getId(), $address->getId()); | |
- } | |
- } | |
- $cartRules = $address->getCartFixedRules(); | |
- if (!isset($cartRules[$rule->getId()])) { | |
- $cartRules[$rule->getId()] = $rule->getDiscountAmount(); | |
- } | |
+ $discountAmount = min($itemPrice * $qty, $quoteAmount); | |
+ $discountAmount = $quote->getStore()->roundPrice($discountAmount); | |
+ $baseDiscountAmount = $quote->getStore()->roundPrice($baseDiscountAmount); | |
- if ($cartRules[$rule->getId()] > 0) { | |
- if ($this->_rulesItemTotals[$rule->getId()]['items_count'] <= 1) { | |
- $quoteAmount = $quote->getStore()->convertPrice($cartRules[$rule->getId()]); | |
- $baseDiscountAmount = min($baseItemPrice * $qty, $cartRules[$rule->getId()]); | |
- } else { | |
- $discountRate = $baseItemPrice * $qty / | |
- $this->_rulesItemTotals[$rule->getId()]['base_items_price']; | |
- $maximumItemDiscount = $rule->getDiscountAmount() * $discountRate; | |
- $quoteAmount = $quote->getStore()->convertPrice($maximumItemDiscount); | |
+ //get discount for original price | |
+ $originalDiscountAmount = min($itemOriginalPrice * $qty, $quoteAmount); | |
+ $baseOriginalDiscountAmount = $quote->getStore()->roundPrice($baseItemOriginalPrice); | |
- $baseDiscountAmount = min($baseItemPrice * $qty, $maximumItemDiscount); | |
- $this->_rulesItemTotals[$rule->getId()]['items_count']--; | |
+ $cartRules[$rule->getId()] -= $baseDiscountAmount; | |
} | |
+ $address->setCartFixedRules($cartRules); | |
- $discountAmount = min($itemPrice * $qty, $quoteAmount); | |
- $discountAmount = $quote->getStore()->roundPrice($discountAmount); | |
- $baseDiscountAmount = $quote->getStore()->roundPrice($baseDiscountAmount); | |
+ break; | |
- //get discount for original price | |
- $originalDiscountAmount = min($itemOriginalPrice * $qty, $quoteAmount); | |
- $baseOriginalDiscountAmount = $quote->getStore()->roundPrice($baseItemOriginalPrice); | |
+ case Mage_SalesRule_Model_Rule::BUY_X_GET_Y_ACTION: | |
+ $x = $rule->getDiscountStep(); | |
+ $y = $rule->getDiscountAmount(); | |
+ if (!$x || $y > $x) { | |
+ break; | |
+ } | |
+ $buyAndDiscountQty = $x + $y; | |
- $cartRules[$rule->getId()] -= $baseDiscountAmount; | |
- } | |
- $address->setCartFixedRules($cartRules); | |
+ $fullRuleQtyPeriod = floor($qty / $buyAndDiscountQty); | |
+ $freeQty = $qty - $fullRuleQtyPeriod * $buyAndDiscountQty; | |
- break; | |
+ $discountQty = $fullRuleQtyPeriod * $y; | |
+ if ($freeQty > $x) { | |
+ $discountQty += $freeQty - $x; | |
+ } | |
- case Mage_SalesRule_Model_Rule::BUY_X_GET_Y_ACTION: | |
- $x = $rule->getDiscountStep(); | |
- $y = $rule->getDiscountAmount(); | |
- if (!$x || $y > $x) { | |
+ $discountAmount = $discountQty * $itemPrice; | |
+ $baseDiscountAmount = $discountQty * $baseItemPrice; | |
+ //get discount for original price | |
+ $originalDiscountAmount = $discountQty * $itemOriginalPrice; | |
+ $baseOriginalDiscountAmount = $discountQty * $baseItemOriginalPrice; | |
break; | |
- } | |
- $buyAndDiscountQty = $x + $y; | |
- | |
- $fullRuleQtyPeriod = floor($qty / $buyAndDiscountQty); | |
- $freeQty = $qty - $fullRuleQtyPeriod * $buyAndDiscountQty; | |
- | |
- $discountQty = $fullRuleQtyPeriod * $y; | |
- if ($freeQty > $x) { | |
- $discountQty += $freeQty - $x; | |
- } | |
- | |
- $discountAmount = $discountQty * $itemPrice; | |
- $baseDiscountAmount = $discountQty * $baseItemPrice; | |
- //get discount for original price | |
- $originalDiscountAmount = $discountQty * $itemOriginalPrice; | |
- $baseOriginalDiscountAmount = $discountQty * $baseItemOriginalPrice; | |
- break; | |
- } | |
+ } | |
- $result = new Varien_Object(array( | |
- 'discount_amount' => $discountAmount, | |
- 'base_discount_amount' => $baseDiscountAmount, | |
- )); | |
- Mage::dispatchEvent('salesrule_validator_process', array( | |
- 'rule' => $rule, | |
- 'item' => $item, | |
- 'address' => $address, | |
- 'quote' => $quote, | |
- 'qty' => $qty, | |
- 'result' => $result, | |
- )); | |
- | |
- $discountAmount = $result->getDiscountAmount(); | |
- $baseDiscountAmount = $result->getBaseDiscountAmount(); | |
- | |
- $percentKey = $item->getDiscountPercent(); | |
- /** | |
- * Process "delta" rounding | |
- */ | |
- if ($percentKey) { | |
- $delta = isset($this->_roundingDeltas[$percentKey]) ? $this->_roundingDeltas[$percentKey] : 0; | |
- $baseDelta = isset($this->_baseRoundingDeltas[$percentKey]) | |
- ? $this->_baseRoundingDeltas[$percentKey] | |
- : 0; | |
- $discountAmount += $delta; | |
- $baseDiscountAmount += $baseDelta; | |
- | |
- $this->_roundingDeltas[$percentKey] = $discountAmount - | |
- $quote->getStore()->roundPrice($discountAmount); | |
- $this->_baseRoundingDeltas[$percentKey] = $baseDiscountAmount - | |
- $quote->getStore()->roundPrice($baseDiscountAmount); | |
- $discountAmount = $quote->getStore()->roundPrice($discountAmount); | |
- $baseDiscountAmount = $quote->getStore()->roundPrice($baseDiscountAmount); | |
- } else { | |
- $discountAmount = $quote->getStore()->roundPrice($discountAmount); | |
- $baseDiscountAmount = $quote->getStore()->roundPrice($baseDiscountAmount); | |
- } | |
+ $result = new Varien_Object(array( | |
+ 'discount_amount' => $discountAmount, | |
+ 'base_discount_amount' => $baseDiscountAmount, | |
+ )); | |
+ Mage::dispatchEvent('salesrule_validator_process', array( | |
+ 'rule' => $rule, | |
+ 'item' => $item, | |
+ 'address' => $address, | |
+ 'quote' => $quote, | |
+ 'qty' => $qty, | |
+ 'result' => $result, | |
+ )); | |
+ | |
+ $discountAmount = $result->getDiscountAmount(); | |
+ $baseDiscountAmount = $result->getBaseDiscountAmount(); | |
+ | |
+ $percentKey = $item->getDiscountPercent(); | |
+ /** | |
+ * Process "delta" rounding | |
+ */ | |
+ if ($percentKey) { | |
+ $delta = isset($this->_roundingDeltas[$percentKey]) ? $this->_roundingDeltas[$percentKey] : 0; | |
+ $baseDelta = isset($this->_baseRoundingDeltas[$percentKey]) | |
+ ? $this->_baseRoundingDeltas[$percentKey] | |
+ : 0; | |
+ $discountAmount += $delta; | |
+ $baseDiscountAmount += $baseDelta; | |
+ | |
+ $this->_roundingDeltas[$percentKey] = $discountAmount - | |
+ $quote->getStore()->roundPrice($discountAmount); | |
+ $this->_baseRoundingDeltas[$percentKey] = $baseDiscountAmount - | |
+ $quote->getStore()->roundPrice($baseDiscountAmount); | |
+ $discountAmount = $quote->getStore()->roundPrice($discountAmount); | |
+ $baseDiscountAmount = $quote->getStore()->roundPrice($baseDiscountAmount); | |
+ } else { | |
+ $discountAmount = $quote->getStore()->roundPrice($discountAmount); | |
+ $baseDiscountAmount = $quote->getStore()->roundPrice($baseDiscountAmount); | |
+ } | |
- /** | |
- * We can't use row total here because row total not include tax | |
- * Discount can be applied on price included tax | |
- */ | |
+ /** | |
+ * We can't use row total here because row total not include tax | |
+ * Discount can be applied on price included tax | |
+ */ | |
- $itemDiscountAmount = $item->getDiscountAmount(); | |
- $itemBaseDiscountAmount = $item->getBaseDiscountAmount(); | |
+ $itemDiscountAmount = $item->getDiscountAmount(); | |
+ $itemBaseDiscountAmount = $item->getBaseDiscountAmount(); | |
- $discountAmount = min($itemDiscountAmount + $discountAmount, $itemPrice * $qty); | |
- $baseDiscountAmount = min($itemBaseDiscountAmount + $baseDiscountAmount, $baseItemPrice * $qty); | |
+ $discountAmount = min($itemDiscountAmount + $discountAmount, $itemPrice * $qty); | |
+ $baseDiscountAmount = min($itemBaseDiscountAmount + $baseDiscountAmount, $baseItemPrice * $qty); | |
- $item->setDiscountAmount($discountAmount); | |
- $item->setBaseDiscountAmount($baseDiscountAmount); | |
+ $item->setDiscountAmount($discountAmount); | |
+ $item->setBaseDiscountAmount($baseDiscountAmount); | |
- $item->setOriginalDiscountAmount($originalDiscountAmount); | |
- $item->setBaseOriginalDiscountAmount($baseOriginalDiscountAmount); | |
+ $item->setOriginalDiscountAmount($originalDiscountAmount); | |
+ $item->setBaseOriginalDiscountAmount($baseOriginalDiscountAmount); | |
- $appliedRuleIds[$rule->getRuleId()] = $rule->getRuleId(); | |
+ $appliedRuleIds[$rule->getRuleId()] = $rule->getRuleId(); | |
- $this->_maintainAddressCouponCode($address, $rule); | |
- $this->_addDiscountDescription($address, $rule); | |
+ $this->_maintainAddressCouponCode($address, $rule); | |
+ $this->_addDiscountDescription($address, $rule); | |
- if ($rule->getStopRulesProcessing()) { | |
- $this->_stopFurtherRules = true; | |
- break; | |
+ if ($rule->getStopRulesProcessing()) { | |
+ $this->_stopFurtherRules = true; | |
+ break; | |
+ } | |
} | |
} | |
- | |
$item->setAppliedRuleIds(join(',',$appliedRuleIds)); | |
$address->setAppliedRuleIds($this->mergeIds($address->getAppliedRuleIds(), $appliedRuleIds)); | |
$quote->setAppliedRuleIds($this->mergeIds($quote->getAppliedRuleIds(), $appliedRuleIds)); | |
diff --git a/app/code/core/Mage/SalesRule/etc/config.xml b/app/code/core/Mage/SalesRule/etc/config.xml | |
index 6a0e898..d5e7763 100644 | |
--- a/app/code/core/Mage/SalesRule/etc/config.xml | |
+++ b/app/code/core/Mage/SalesRule/etc/config.xml | |
@@ -134,8 +134,8 @@ | |
<totals> | |
<freeshipping> | |
<class>salesrule/quote_freeshipping</class> | |
- <after>subtotal</after> | |
- <before>tax_subtotal,shipping</before> | |
+ <after>subtotal,tax_subtotal</after> | |
+ <before>shipping</before> | |
</freeshipping> | |
<discount> | |
<class>salesrule/quote_discount</class> | |
diff --git a/app/code/core/Mage/Sitemap/Model/Sitemap.php b/app/code/core/Mage/Sitemap/Model/Sitemap.php | |
index 19db436..78e1bd7 100644 | |
--- a/app/code/core/Mage/Sitemap/Model/Sitemap.php | |
+++ b/app/code/core/Mage/Sitemap/Model/Sitemap.php | |
@@ -155,7 +155,8 @@ class Mage_Sitemap_Model_Sitemap extends Mage_Core_Model_Abstract | |
$categories = new Varien_Object(); | |
$categories->setItems($collection); | |
Mage::dispatchEvent('sitemap_categories_generating_before', array( | |
- 'collection' => $categories | |
+ 'collection' => $categories, | |
+ 'store_id' => $storeId | |
)); | |
foreach ($categories->getItems() as $item) { | |
$xml = sprintf( | |
@@ -178,7 +179,8 @@ class Mage_Sitemap_Model_Sitemap extends Mage_Core_Model_Abstract | |
$products = new Varien_Object(); | |
$products->setItems($collection); | |
Mage::dispatchEvent('sitemap_products_generating_before', array( | |
- 'collection' => $products | |
+ 'collection' => $products, | |
+ 'store_id' => $storeId | |
)); | |
foreach ($products->getItems() as $item) { | |
$xml = sprintf( | |
diff --git a/app/code/core/Mage/Tax/etc/config.xml b/app/code/core/Mage/Tax/etc/config.xml | |
index 2ac6df7..3c6b038 100644 | |
--- a/app/code/core/Mage/Tax/etc/config.xml | |
+++ b/app/code/core/Mage/Tax/etc/config.xml | |
@@ -162,8 +162,8 @@ | |
<totals> | |
<tax_subtotal> | |
<class>tax/sales_total_quote_subtotal</class> | |
- <after>freeshipping</after> | |
- <before>tax,discount</before> | |
+ <after>subtotal</after> | |
+ <before>tax,discount,msrp</before> | |
</tax_subtotal> | |
<tax_shipping> | |
<class>tax/sales_total_quote_shipping</class> | |
diff --git a/app/code/core/Mage/Uploader/Block/Abstract.php b/app/code/core/Mage/Uploader/Block/Abstract.php | |
index a11c23a..d0f4644 100644 | |
--- a/app/code/core/Mage/Uploader/Block/Abstract.php | |
+++ b/app/code/core/Mage/Uploader/Block/Abstract.php | |
@@ -20,7 +20,7 @@ | |
* | |
* @category Mage | |
* @package Mage_Uploader | |
- * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
*/ | |
diff --git a/app/code/core/Mage/Uploader/Block/Multiple.php b/app/code/core/Mage/Uploader/Block/Multiple.php | |
index abf47df..c57a2f1 100644 | |
--- a/app/code/core/Mage/Uploader/Block/Multiple.php | |
+++ b/app/code/core/Mage/Uploader/Block/Multiple.php | |
@@ -20,7 +20,7 @@ | |
* | |
* @category Mage | |
* @package Mage_Uploader | |
- * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
*/ | |
diff --git a/app/code/core/Mage/Uploader/Block/Single.php b/app/code/core/Mage/Uploader/Block/Single.php | |
index ed298a0..a7b5994 100644 | |
--- a/app/code/core/Mage/Uploader/Block/Single.php | |
+++ b/app/code/core/Mage/Uploader/Block/Single.php | |
@@ -20,7 +20,7 @@ | |
* | |
* @category Mage | |
* @package Mage_Uploader | |
- * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
*/ | |
diff --git a/app/code/core/Mage/Uploader/Helper/Data.php b/app/code/core/Mage/Uploader/Helper/Data.php | |
index 2650976..882b8e0 100644 | |
--- a/app/code/core/Mage/Uploader/Helper/Data.php | |
+++ b/app/code/core/Mage/Uploader/Helper/Data.php | |
@@ -20,10 +20,15 @@ | |
* | |
* @category Mage | |
* @package Mage_Uploader | |
- * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
*/ | |
+/** | |
+ * Uploader data helper | |
+ * | |
+ * Class Mage_Uploader_Helper_Data | |
+ */ | |
class Mage_Uploader_Helper_Data extends Mage_Core_Helper_Abstract | |
{ | |
diff --git a/app/code/core/Mage/Uploader/Helper/File.php b/app/code/core/Mage/Uploader/Helper/File.php | |
index b0f17cb..c498b91 100644 | |
--- a/app/code/core/Mage/Uploader/Helper/File.php | |
+++ b/app/code/core/Mage/Uploader/Helper/File.php | |
@@ -20,10 +20,18 @@ | |
* | |
* @category Mage | |
* @package Mage_Uploader | |
- * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
*/ | |
+/** | |
+ * File Helper | |
+ * | |
+ * @category Mage | |
+ * @package Mage_Uploader | |
+ * @author Magento Core Team <[email protected]> | |
+ */ | |
+ | |
class Mage_Uploader_Helper_File extends Mage_Core_Helper_Abstract | |
{ | |
/** | |
diff --git a/app/code/core/Mage/Uploader/Model/Config/Abstract.php b/app/code/core/Mage/Uploader/Model/Config/Abstract.php | |
index b11f11e..07b950c 100644 | |
--- a/app/code/core/Mage/Uploader/Model/Config/Abstract.php | |
+++ b/app/code/core/Mage/Uploader/Model/Config/Abstract.php | |
@@ -20,10 +20,17 @@ | |
* | |
* @category Mage | |
* @package Mage_Uploader | |
- * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
*/ | |
+/** | |
+ * Uploader Config Instance Abstract Model | |
+ * | |
+ * @category Mage | |
+ * @package Mage_Uploader | |
+ */ | |
+ | |
abstract class Mage_Uploader_Model_Config_Abstract extends Varien_Object | |
{ | |
/** | |
diff --git a/app/code/core/Mage/Uploader/Model/Config/Browsebutton.php b/app/code/core/Mage/Uploader/Model/Config/Browsebutton.php | |
index 442f254..393f915 100644 | |
--- a/app/code/core/Mage/Uploader/Model/Config/Browsebutton.php | |
+++ b/app/code/core/Mage/Uploader/Model/Config/Browsebutton.php | |
@@ -18,11 +18,19 @@ | |
* versions in the future. If you wish to customize Magento for your | |
* needs please refer to http://www.magento.com for more information. | |
* | |
- * @category Mage | |
- * @package Mage_Uploader | |
- * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
+ * @category Mage | |
+ * @package Mage_Uploader | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
+ */ | |
+/** | |
+ * Uploader Config Instance Abstract Model | |
+ * | |
+ * @category Mage | |
+ * @package Mage_Uploader | |
+ */ | |
+/** | |
* @method Mage_Uploader_Model_Config_Browsebutton setDomNodes(array $domNodesIds) | |
* Array of element browse buttons ids | |
* @method Mage_Uploader_Model_Config_Browsebutton setIsDirectory(bool $isDirectory) | |
@@ -33,6 +41,8 @@ | |
* @method Mage_Uploader_Model_Config_Browsebutton setAttributes(array $attributes) | |
* Pass object of keys and values to set custom attributes on input fields. | |
* @see http://www.w3.org/TR/html-markup/input.file.html#input.file-attributes | |
+ * | |
+ * Class Mage_Uploader_Model_Config_Browsebutton | |
*/ | |
class Mage_Uploader_Model_Config_Browsebutton extends Mage_Uploader_Model_Config_Abstract | |
diff --git a/app/code/core/Mage/Uploader/Model/Config/Misc.php b/app/code/core/Mage/Uploader/Model/Config/Misc.php | |
index 8231844..1b3c442 100644 | |
--- a/app/code/core/Mage/Uploader/Model/Config/Misc.php | |
+++ b/app/code/core/Mage/Uploader/Model/Config/Misc.php | |
@@ -18,11 +18,20 @@ | |
* versions in the future. If you wish to customize Magento for your | |
* needs please refer to http://www.magento.com for more information. | |
* | |
- * @category Mage | |
- * @package Mage_Uploader | |
+ * @category Mage | |
+ * @package Mage_Uploader | |
* @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
- * | |
+ */ | |
+ | |
+/** | |
+ * Misc Config Parameters | |
+ * | |
+ * @category Mage | |
+ * @package Mage_Uploader | |
+ */ | |
+ | |
+/** | |
* @method Mage_Uploader_Model_Config_Misc setMaxSizePlural (string $sizePlural) Set plural info about max upload size | |
* @method Mage_Uploader_Model_Config_Misc setMaxSizeInBytes (int $sizeInBytes) Set max upload size in bytes | |
* @method Mage_Uploader_Model_Config_Misc setReplaceBrowseWithRemove (bool $replaceBrowseWithRemove) | |
@@ -30,7 +39,6 @@ | |
* | |
* Class Mage_Uploader_Model_Config_Misc | |
*/ | |
- | |
class Mage_Uploader_Model_Config_Misc extends Mage_Uploader_Model_Config_Abstract | |
{ | |
/** | |
diff --git a/app/code/core/Mage/Uploader/Model/Config/Uploader.php b/app/code/core/Mage/Uploader/Model/Config/Uploader.php | |
index 9e35570..4bfd897 100644 | |
--- a/app/code/core/Mage/Uploader/Model/Config/Uploader.php | |
+++ b/app/code/core/Mage/Uploader/Model/Config/Uploader.php | |
@@ -18,13 +18,20 @@ | |
* versions in the future. If you wish to customize Magento for your | |
* needs please refer to http://www.magento.com for more information. | |
* | |
- * @category Mage | |
- * @package Mage_Uploader | |
+ * @category Mage | |
+ * @package Mage_Uploader | |
* @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
*/ | |
/** | |
+ * Uploader Config Instance Abstract Model | |
+ * | |
+ * @category Mage | |
+ * @package Mage_Uploader | |
+ */ | |
+ | |
+/** | |
* @method Mage_Uploader_Model_Config_Uploader setTarget(string $url) | |
* The target URL for the multipart POST request. | |
* @method Mage_Uploader_Model_Config_Uploader setSingleFile(bool $isSingleFile) | |
@@ -75,7 +82,6 @@ | |
* | |
* Class Mage_Uploader_Model_Config_Uploader | |
*/ | |
- | |
class Mage_Uploader_Model_Config_Uploader extends Mage_Uploader_Model_Config_Abstract | |
{ | |
/** | |
diff --git a/app/code/core/Mage/Uploader/etc/config.xml b/app/code/core/Mage/Uploader/etc/config.xml | |
index d3fcd40..84eb751 100644 | |
--- a/app/code/core/Mage/Uploader/etc/config.xml | |
+++ b/app/code/core/Mage/Uploader/etc/config.xml | |
@@ -5,10 +5,10 @@ | |
* | |
* NOTICE OF LICENSE | |
* | |
- * This source file is subject to the Open Software License (OSL 3.0) | |
- * that is bundled with this package in the file LICENSE.txt. | |
+ * This source file is subject to the Academic Free License (AFL 3.0) | |
+ * that is bundled with this package in the file LICENSE_AFL.txt. | |
* It is also available through the world-wide-web at this URL: | |
- * http://opensource.org/licenses/osl-3.0.php | |
+ * http://opensource.org/licenses/afl-3.0.php | |
* If you did not receive a copy of the license and are unable to | |
* obtain it through the world-wide-web, please send an email | |
* to [email protected] so we can send you a copy immediately. | |
@@ -22,7 +22,7 @@ | |
* @category Mage | |
* @package Mage_Uploader | |
* @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
--> | |
<config> | |
@@ -48,4 +48,26 @@ | |
</uploader> | |
</models> | |
</global> | |
+ <adminhtml> | |
+ <translate> | |
+ <modules> | |
+ <Mage_Uploader> | |
+ <files> | |
+ <default>Mage_Uploader.csv</default> | |
+ </files> | |
+ </Mage_Uploader> | |
+ </modules> | |
+ </translate> | |
+ </adminhtml> | |
+ <frontend> | |
+ <translate> | |
+ <modules> | |
+ <Mage_Uploader> | |
+ <files> | |
+ <default>Mage_Uploader.csv</default> | |
+ </files> | |
+ </Mage_Uploader> | |
+ </modules> | |
+ </translate> | |
+ </frontend> | |
</config> | |
diff --git a/app/code/core/Mage/Uploader/etc/jstranslator.xml b/app/code/core/Mage/Uploader/etc/jstranslator.xml | |
index 4d7d405..65be5df 100644 | |
--- a/app/code/core/Mage/Uploader/etc/jstranslator.xml | |
+++ b/app/code/core/Mage/Uploader/etc/jstranslator.xml | |
@@ -5,10 +5,10 @@ | |
* | |
* NOTICE OF LICENSE | |
* | |
- * This source file is subject to the Open Software License (OSL 3.0) | |
- * that is bundled with this package in the file LICENSE.txt. | |
+ * This source file is subject to the Academic Free License (AFL 3.0) | |
+ * that is bundled with this package in the file LICENSE_AFL.txt. | |
* It is also available through the world-wide-web at this URL: | |
- * http://opensource.org/licenses/osl-3.0.php | |
+ * http://opensource.org/licenses/afl-3.0.php | |
* If you did not receive a copy of the license and are unable to | |
* obtain it through the world-wide-web, please send an email | |
* to [email protected] so we can send you a copy immediately. | |
@@ -19,10 +19,10 @@ | |
* versions in the future. If you wish to customize Magento for your | |
* needs please refer to http://www.magento.com for more information. | |
* | |
- * @category Mage | |
- * @package Mage_Uploader | |
- * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
+ * @category Mage | |
+ * @package Mage_Uploader | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
--> | |
<jstranslator> | |
@@ -42,3 +42,4 @@ | |
<message>Uploading...</message> | |
</uploader-uploading-progress> | |
</jstranslator> | |
+ | |
diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php | |
index 6e1caa2..a5f20c1 100644 | |
--- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php | |
+++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php | |
@@ -539,6 +539,7 @@ class Mage_Usa_Model_Shipping_Carrier_Usps | |
'method' => array( | |
'0_FCLE' => Mage::helper('usa')->__('First-Class Mail Large Envelope'), | |
'0_FCL' => Mage::helper('usa')->__('First-Class Mail Letter'), | |
+ '0_FCSL' => Mage::helper('usa')->__('First-Class Mail Stamped Letter'), | |
'0_FCP' => Mage::helper('usa')->__('First-Class Mail Parcel'), | |
'0_FCPC' => Mage::helper('usa')->__('First-Class Mail Postcards'), | |
'1' => Mage::helper('usa')->__('Priority Mail'), | |
@@ -586,6 +587,7 @@ class Mage_Usa_Model_Shipping_Carrier_Usps | |
'62' => Mage::helper('usa')->__('Priority Mail Express Padded Flat Rate Envelope'), | |
'63' => Mage::helper('usa')->__('Priority Mail Express Padded Flat Rate Envelope Hold For Pickup'), | |
'64' => Mage::helper('usa')->__('Priority Mail Express Sunday/Holiday Delivery Padded Flat Rate Envelope'), | |
+ '72' => Mage::helper('usa')->__('First-Class Mail Metered Letter'), | |
'INT_1' => Mage::helper('usa')->__('Priority Mail Express International'), | |
'INT_2' => Mage::helper('usa')->__('Priority Mail International'), | |
'INT_4' => Mage::helper('usa')->__('Global Express Guaranteed (GXG)'), | |
@@ -616,6 +618,7 @@ class Mage_Usa_Model_Shipping_Carrier_Usps | |
'service_to_code' => array( | |
'0_FCLE' => 'First Class', | |
'0_FCL' => 'First Class', | |
+ '0_FCSL' => 'First Class', | |
'0_FCP' => 'First Class', | |
'0_FCPC' => 'First Class', | |
'1' => 'Priority', | |
@@ -663,6 +666,7 @@ class Mage_Usa_Model_Shipping_Carrier_Usps | |
'62' => 'Priority Express', | |
'63' => 'Priority Express', | |
'64' => 'Priority Express', | |
+ '72' => 'First Class', | |
'INT_1' => 'Priority Express', | |
'INT_2' => 'Priority', | |
'INT_4' => 'Priority Express', | |
@@ -694,6 +698,8 @@ class Mage_Usa_Model_Shipping_Carrier_Usps | |
'method_to_code' => array( | |
'First-Class Mail Large Envelope' => '0_FCLE', | |
'First-Class Mail Letter' => '0_FCL', | |
+ 'First-Class Mail Stamped Letter' => '0_FCSL', | |
+ 'First-Class Mail Metered Letter' => '72', | |
'First-Class Mail Parcel' => '0_FCP', | |
), | |
diff --git a/app/code/core/Mage/Usa/etc/config.xml b/app/code/core/Mage/Usa/etc/config.xml | |
index 519907d..13aaef5 100644 | |
--- a/app/code/core/Mage/Usa/etc/config.xml | |
+++ b/app/code/core/Mage/Usa/etc/config.xml | |
@@ -190,7 +190,7 @@ | |
<usps> | |
<active>0</active> | |
<sallowspecific>0</sallowspecific> | |
- <allowed_methods>0_FCLE,0_FCL,0_FCP,1,2,3,4,6,7,13,16,17,22,23,25,27,28,33,34,35,36,37,42,43,53,55,56,57,61,INT_1,INT_2,INT_4,INT_6,INT_7,INT_8,INT_9,INT_10,INT_11,INT_12,INT_13,INT_14,INT_15,INT_16,INT_20,INT_26</allowed_methods> | |
+ <allowed_methods>0_FCLE,0_FCL,0_FCSL,0_FCP,0_FCPC,1,2,3,4,6,7,13,15,16,17,22,23,25,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,53,57,58,59,61,62,63,64,72,INT_1,INT_2,INT_4,INT_5,INT_6,INT_7,INT_8,INT_9,INT_10,INT_11,INT_12,INT_13,INT_14,INT_15,INT_16,INT_17,INT_18,INT_19,INT_20,INT_21,INT_22,INT_23,INT_24,INT_25,INT_27</allowed_methods> | |
<container>VARIABLE</container> | |
<cutoff_cost/> | |
<free_method/> | |
@@ -217,6 +217,7 @@ | |
<active>0</active> | |
<title>DHL</title> | |
<sallowspecific>0</sallowspecific> | |
+ <content_type>D</content_type> | |
<nondoc_methods>1,3,4,8,P,Q,E,F,H,J,M,V,Y</nondoc_methods> | |
<doc_methods>2,5,6,7,9,B,C,D,U,K,L,G,W,I,N,O,R,S,T,X</doc_methods> | |
<free_method>G</free_method> | |
diff --git a/app/code/core/Mage/Weee/Model/Observer.php b/app/code/core/Mage/Weee/Model/Observer.php | |
index 5163f47..ac87c03 100644 | |
--- a/app/code/core/Mage/Weee/Model/Observer.php | |
+++ b/app/code/core/Mage/Weee/Model/Observer.php | |
@@ -296,7 +296,10 @@ class Mage_Weee_Model_Observer extends Mage_Core_Model_Abstract | |
$response = $observer->getEvent()->getResponseObject(); | |
$options = $response->getAdditionalOptions(); | |
- $_product = Mage::registry('current_product'); | |
+ $eventProduct = $observer->getEvent()->getProduct(); | |
+ | |
+ $_product = $eventProduct ? $eventProduct : Mage::registry('current_product'); | |
+ | |
if (!$_product) { | |
return $this; | |
} | |
diff --git a/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Item/Options.php b/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Item/Options.php | |
index 68778bf..747d1f9 100644 | |
--- a/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Item/Options.php | |
+++ b/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Item/Options.php | |
@@ -114,9 +114,12 @@ class Mage_Wishlist_Block_Customer_Wishlist_Item_Options extends Mage_Wishlist_B | |
} | |
$item = $this->getItem(); | |
- $data = $this->getOptionsRenderCfg($item->getProduct()->getTypeId()); | |
- if (empty($data['template'])) { | |
- $data = $this->getOptionsRenderCfg('default'); | |
+ | |
+ if ($item instanceof Mage_Wishlist_Model_Item) { | |
+ $data = $this->getOptionsRenderCfg($item->getProduct()->getTypeId()); | |
+ if (empty($data['template'])) { | |
+ $data = $this->getOptionsRenderCfg('default'); | |
+ } | |
} | |
return empty($data['template']) ? '' : $data['template']; | |
diff --git a/app/code/core/Mage/XmlConnect/Helper/Image.php b/app/code/core/Mage/XmlConnect/Helper/Image.php | |
index 8f1a59e..f5ce42e 100644 | |
--- a/app/code/core/Mage/XmlConnect/Helper/Image.php | |
+++ b/app/code/core/Mage/XmlConnect/Helper/Image.php | |
@@ -111,8 +111,12 @@ class Mage_XmlConnect_Helper_Image extends Mage_Core_Helper_Abstract | |
Mage::throwException(Mage::helper('xmlconnect')->__('File can\'t be uploaded.')); | |
} elseif ($e->getMessage() == 'Disallowed file type.') { | |
$filename = $_FILES[$field]['name']; | |
+ $io = new Varien_Io_File(); | |
Mage::throwException( | |
- Mage::helper('xmlconnect')->__('Error while uploading file "%s". Disallowed file type. Only "jpg", "jpeg", "gif", "png" are allowed.', $filename) | |
+ Mage::helper('xmlconnect')->__( | |
+ 'Error while uploading file "%s".' . | |
+ ' Disallowed file type. Only "jpg", "jpeg", "gif", "png" are allowed.', | |
+ $io->getFilteredPath($filename)) | |
); | |
} else { | |
Mage::logException($e); | |
@@ -158,16 +162,19 @@ class Mage_XmlConnect_Helper_Image extends Mage_Core_Helper_Abstract | |
*/ | |
if (!file_exists($originalSizeFileName)) { | |
$oldFileName = $this->getOldUploadDir() . DS . $fileName; | |
+ $io = new Varien_Io_File(); | |
if (file_exists($oldFileName)) { | |
if (!(copy($oldFileName, $originalSizeFileName) && (is_readable($customSizeFileName) | |
|| chmod($customSizeFileName, 0644)) | |
)) { | |
Mage::throwException( | |
- Mage::helper('xmlconnect')->__('Error while processing file "%s".', $fileName) | |
+ Mage::helper('xmlconnect')->__('Error while processing file "%s".', | |
+ $io->getFilteredPath($fileName)) | |
); | |
} | |
} else { | |
- Mage::throwException(Mage::helper('xmlconnect')->__('No such file "%s".', $fileName)); | |
+ Mage::throwException(Mage::helper('xmlconnect')->__('No such file "%s".', | |
+ $io->getFilteredPath($fileName))); | |
} | |
} | |
@@ -180,7 +187,9 @@ class Mage_XmlConnect_Helper_Image extends Mage_Core_Helper_Abstract | |
if (isset($_FILES[$fieldPath]) && is_array($_FILES[$fieldPath]) && isset($_FILES[$fieldPath]['name'])) { | |
$fileName = $_FILES[$fieldPath]['name']; | |
} | |
- Mage::throwException(Mage::helper('xmlconnect')->__('Error while uploading file "%s".', $fileName)); | |
+ $io = new Varien_Io_File(); | |
+ Mage::throwException(Mage::helper('xmlconnect')->__('Error while uploading file "%s".', | |
+ $io->getFilteredPath($fileName))); | |
} | |
return $customSizeFileName; | |
} | |
diff --git a/app/code/core/Mage/XmlConnect/Helper/Theme.php b/app/code/core/Mage/XmlConnect/Helper/Theme.php | |
index cbe0b4b..0a7f236 100644 | |
--- a/app/code/core/Mage/XmlConnect/Helper/Theme.php | |
+++ b/app/code/core/Mage/XmlConnect/Helper/Theme.php | |
@@ -332,7 +332,8 @@ EOT; | |
} | |
if (!$ioFile->cp($src, $dst)) { | |
- Mage::throwException(Mage::helper('xmlconnect')->__('Can\'t copy file "%s" to "%s".', $src, $dst)); | |
+ Mage::throwException(Mage::helper('xmlconnect')->__('Can\'t copy file "%s" to "%s".', | |
+ $ioFile->getFilteredPath($src), $ioFile->getFilteredPath($dst))); | |
} else { | |
$ioFile->chmod($dst, 0755); | |
} | |
diff --git a/app/code/core/Mage/XmlConnect/Model/Theme.php b/app/code/core/Mage/XmlConnect/Model/Theme.php | |
index 694da71..58e7048 100644 | |
--- a/app/code/core/Mage/XmlConnect/Model/Theme.php | |
+++ b/app/code/core/Mage/XmlConnect/Model/Theme.php | |
@@ -62,12 +62,14 @@ class Mage_XmlConnect_Model_Theme | |
*/ | |
public function __construct($file) | |
{ | |
+ $io = new Varien_Io_File(); | |
$this->_file = $file; | |
if (!file_exists($file)) { | |
- Mage::throwException(Mage::helper('xmlconnect')->__('File doesn\'t exist "%s".', $file)); | |
+ Mage::throwException(Mage::helper('xmlconnect')->__('File doesn\'t exist "%s".', | |
+ $io->getFilteredPath($file))); | |
} | |
if (!is_readable($file)) { | |
- Mage::throwException(Mage::helper('xmlconnect')->__('Can\'t read file "%s".', $file)); | |
+ Mage::throwException(Mage::helper('xmlconnect')->__('Can\'t read file "%s".', $io->getFilteredPath($file))); | |
} | |
try { | |
$text = file_get_contents($file); | |
@@ -190,7 +192,8 @@ class Mage_XmlConnect_Model_Theme | |
$ioFile = new Varien_Io_File(); | |
if (!$ioFile->cp($currentThemeFileName, $filePath)) { | |
Mage::throwException( | |
- Mage::helper('xmlconnect')->__('Can\'t copy file "%s" to "%s".', $currentThemeFileName, $filePath) | |
+ Mage::helper('xmlconnect')->__('Can\'t copy file "%s" to "%s".', | |
+ $ioFile->getFilteredPath($currentThemeFileName), $ioFile->getFilteredPath($filePath)) | |
); | |
} else { | |
$ioFile->chmod($filePath, 0755); | |
@@ -320,7 +323,9 @@ class Mage_XmlConnect_Model_Theme | |
if (is_writeable($this->_file)) { | |
file_put_contents($this->_file, $xml->asXML()); | |
} else { | |
- Mage::throwException(Mage::helper('xmlconnect')->__('Can\'t write to file "%s".', $this->_file)); | |
+ $io = new Varien_Io_File(); | |
+ Mage::throwException(Mage::helper('xmlconnect')->__('Can\'t write to file "%s".', | |
+ $io->getFilteredPath($this->_file))); | |
} | |
} | |
} | |
diff --git a/app/code/core/Zend/Validate/Hostname.php b/app/code/core/Zend/Validate/Hostname.php | |
new file mode 100644 | |
index 0000000..9021405 | |
--- /dev/null | |
+++ b/app/code/core/Zend/Validate/Hostname.php | |
@@ -0,0 +1,1684 @@ | |
+<?php | |
+/** | |
+ * Zend Framework | |
+ * | |
+ * LICENSE | |
+ * | |
+ * This source file is subject to the new BSD license that is bundled | |
+ * with this package in the file LICENSE.txt. | |
+ * It is also available through the world-wide-web at this URL: | |
+ * http://framework.zend.com/license/new-bsd | |
+ * If you did not receive a copy of the license and are unable to | |
+ * obtain it through the world-wide-web, please send an email | |
+ * to [email protected] so we can send you a copy immediately. | |
+ * | |
+ * @category Zend | |
+ * @package Zend_Validate | |
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) | |
+ * @license http://framework.zend.com/license/new-bsd New BSD License | |
+ * @version $Id$ | |
+ */ | |
+ | |
+/** | |
+ * @see Zend_Validate_Abstract | |
+ */ | |
+#require_once 'Zend/Validate/Abstract.php'; | |
+ | |
+/** | |
+ * @see Zend_Validate_Ip | |
+ */ | |
+#require_once 'Zend/Validate/Ip.php'; | |
+ | |
+/** | |
+ * Please note there are two standalone test scripts for testing IDN characters due to problems | |
+ * with file encoding. | |
+ * | |
+ * The first is tests/Zend/Validate/HostnameTestStandalone.php which is designed to be run on | |
+ * the command line. | |
+ * | |
+ * The second is tests/Zend/Validate/HostnameTestForm.php which is designed to be run via HTML | |
+ * to allow users to test entering UTF-8 characters in a form. | |
+ * | |
+ * @category Zend | |
+ * @package Zend_Validate | |
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) | |
+ * @license http://framework.zend.com/license/new-bsd New BSD License | |
+ */ | |
+class Zend_Validate_Hostname extends Zend_Validate_Abstract | |
+{ | |
+ const CANNOT_DECODE_PUNYCODE = 'hostnameCannotDecodePunycode'; | |
+ const INVALID = 'hostnameInvalid'; | |
+ const INVALID_DASH = 'hostnameDashCharacter'; | |
+ const INVALID_HOSTNAME = 'hostnameInvalidHostname'; | |
+ const INVALID_HOSTNAME_SCHEMA = 'hostnameInvalidHostnameSchema'; | |
+ const INVALID_LOCAL_NAME = 'hostnameInvalidLocalName'; | |
+ const INVALID_URI = 'hostnameInvalidUri'; | |
+ const IP_ADDRESS_NOT_ALLOWED = 'hostnameIpAddressNotAllowed'; | |
+ const LOCAL_NAME_NOT_ALLOWED = 'hostnameLocalNameNotAllowed'; | |
+ const UNDECIPHERABLE_TLD = 'hostnameUndecipherableTld'; | |
+ const UNKNOWN_TLD = 'hostnameUnknownTld'; | |
+ | |
+ /** | |
+ * @var array | |
+ */ | |
+ protected $_messageTemplates = array( | |
+ self::CANNOT_DECODE_PUNYCODE => "'%value%' appears to be a DNS hostname but the given punycode notation cannot be decoded", | |
+ self::INVALID => "Invalid type given. String expected", | |
+ self::INVALID_DASH => "'%value%' appears to be a DNS hostname but contains a dash in an invalid position", | |
+ self::INVALID_HOSTNAME => "'%value%' does not match the expected structure for a DNS hostname", | |
+ self::INVALID_HOSTNAME_SCHEMA => "'%value%' appears to be a DNS hostname but cannot match against hostname schema for TLD '%tld%'", | |
+ self::INVALID_LOCAL_NAME => "'%value%' does not appear to be a valid local network name", | |
+ self::INVALID_URI => "'%value%' does not appear to be a valid URI hostname", | |
+ self::IP_ADDRESS_NOT_ALLOWED => "'%value%' appears to be an IP address, but IP addresses are not allowed", | |
+ self::LOCAL_NAME_NOT_ALLOWED => "'%value%' appears to be a local network name but local network names are not allowed", | |
+ self::UNDECIPHERABLE_TLD => "'%value%' appears to be a DNS hostname but cannot extract TLD part", | |
+ self::UNKNOWN_TLD => "'%value%' appears to be a DNS hostname but cannot match TLD against known list", | |
+ ); | |
+ | |
+ /** | |
+ * @var array | |
+ */ | |
+ protected $_messageVariables = array( | |
+ 'tld' => '_tld' | |
+ ); | |
+ | |
+ /** | |
+ * Allows Internet domain names (e.g., example.com) | |
+ */ | |
+ const ALLOW_DNS = 1; | |
+ | |
+ /** | |
+ * Allows IP addresses | |
+ */ | |
+ const ALLOW_IP = 2; | |
+ | |
+ /** | |
+ * Allows local network names (e.g., localhost, www.localdomain) | |
+ */ | |
+ const ALLOW_LOCAL = 4; | |
+ | |
+ /** | |
+ * Allows all types of hostnames | |
+ */ | |
+ const ALLOW_URI = 8; | |
+ | |
+ /** | |
+ * Allows all types of hostnames | |
+ */ | |
+ const ALLOW_ALL = 15; | |
+ | |
+ /** | |
+ * Array of valid top-level-domains | |
+ * | |
+ * Version 2014112800, Last Updated Fri Nov 28 07:07:01 2014 UTC | |
+ * | |
+ * @see http://data.iana.org/TLD/tlds-alpha-by-domain.txt List of all TLDs by domain | |
+ * @see http://www.iana.org/domains/root/db/ Official list of supported TLDs | |
+ * @var array | |
+ */ | |
+ protected $_validTlds = array( | |
+ 'abogado', | |
+ 'ac', | |
+ 'academy', | |
+ 'accountants', | |
+ 'active', | |
+ 'actor', | |
+ 'ad', | |
+ 'ae', | |
+ 'aero', | |
+ 'af', | |
+ 'ag', | |
+ 'agency', | |
+ 'ai', | |
+ 'airforce', | |
+ 'al', | |
+ 'allfinanz', | |
+ 'alsace', | |
+ 'am', | |
+ 'an', | |
+ 'android', | |
+ 'ao', | |
+ 'aq', | |
+ 'ar', | |
+ 'archi', | |
+ 'army', | |
+ 'arpa', | |
+ 'as', | |
+ 'asia', | |
+ 'associates', | |
+ 'at', | |
+ 'attorney', | |
+ 'au', | |
+ 'auction', | |
+ 'audio', | |
+ 'autos', | |
+ 'aw', | |
+ 'ax', | |
+ 'axa', | |
+ 'az', | |
+ 'ba', | |
+ 'band', | |
+ 'bar', | |
+ 'bargains', | |
+ 'bayern', | |
+ 'bb', | |
+ 'bd', | |
+ 'be', | |
+ 'beer', | |
+ 'berlin', | |
+ 'best', | |
+ 'bf', | |
+ 'bg', | |
+ 'bh', | |
+ 'bi', | |
+ 'bid', | |
+ 'bike', | |
+ 'bio', | |
+ 'biz', | |
+ 'bj', | |
+ 'black', | |
+ 'blackfriday', | |
+ 'bloomberg', | |
+ 'blue', | |
+ 'bm', | |
+ 'bmw', | |
+ 'bn', | |
+ 'bnpparibas', | |
+ 'bo', | |
+ 'boo', | |
+ 'boutique', | |
+ 'br', | |
+ 'brussels', | |
+ 'bs', | |
+ 'bt', | |
+ 'budapest', | |
+ 'build', | |
+ 'builders', | |
+ 'business', | |
+ 'buzz', | |
+ 'bv', | |
+ 'bw', | |
+ 'by', | |
+ 'bz', | |
+ 'bzh', | |
+ 'ca', | |
+ 'cab', | |
+ 'cal', | |
+ 'camera', | |
+ 'camp', | |
+ 'cancerresearch', | |
+ 'capetown', | |
+ 'capital', | |
+ 'caravan', | |
+ 'cards', | |
+ 'care', | |
+ 'career', | |
+ 'careers', | |
+ 'casa', | |
+ 'cash', | |
+ 'cat', | |
+ 'catering', | |
+ 'cc', | |
+ 'cd', | |
+ 'center', | |
+ 'ceo', | |
+ 'cern', | |
+ 'cf', | |
+ 'cg', | |
+ 'ch', | |
+ 'channel', | |
+ 'cheap', | |
+ 'christmas', | |
+ 'chrome', | |
+ 'church', | |
+ 'ci', | |
+ 'citic', | |
+ 'city', | |
+ 'ck', | |
+ 'cl', | |
+ 'claims', | |
+ 'cleaning', | |
+ 'click', | |
+ 'clinic', | |
+ 'clothing', | |
+ 'club', | |
+ 'cm', | |
+ 'cn', | |
+ 'co', | |
+ 'coach', | |
+ 'codes', | |
+ 'coffee', | |
+ 'college', | |
+ 'cologne', | |
+ 'com', | |
+ 'community', | |
+ 'company', | |
+ 'computer', | |
+ 'condos', | |
+ 'construction', | |
+ 'consulting', | |
+ 'contractors', | |
+ 'cooking', | |
+ 'cool', | |
+ 'coop', | |
+ 'country', | |
+ 'cr', | |
+ 'credit', | |
+ 'creditcard', | |
+ 'cricket', | |
+ 'crs', | |
+ 'cruises', | |
+ 'cu', | |
+ 'cuisinella', | |
+ 'cv', | |
+ 'cw', | |
+ 'cx', | |
+ 'cy', | |
+ 'cymru', | |
+ 'cz', | |
+ 'dad', | |
+ 'dance', | |
+ 'dating', | |
+ 'day', | |
+ 'de', | |
+ 'deals', | |
+ 'degree', | |
+ 'delivery', | |
+ 'democrat', | |
+ 'dental', | |
+ 'dentist', | |
+ 'desi', | |
+ 'diamonds', | |
+ 'diet', | |
+ 'digital', | |
+ 'direct', | |
+ 'directory', | |
+ 'discount', | |
+ 'dj', | |
+ 'dk', | |
+ 'dm', | |
+ 'dnp', | |
+ 'do', | |
+ 'domains', | |
+ 'durban', | |
+ 'dvag', | |
+ 'dz', | |
+ 'eat', | |
+ 'ec', | |
+ 'edu', | |
+ 'education', | |
+ 'ee', | |
+ 'eg', | |
+ 'email', | |
+ 'emerck', | |
+ 'energy', | |
+ 'engineer', | |
+ 'engineering', | |
+ 'enterprises', | |
+ 'equipment', | |
+ 'er', | |
+ 'es', | |
+ 'esq', | |
+ 'estate', | |
+ 'et', | |
+ 'eu', | |
+ 'eus', | |
+ 'events', | |
+ 'everbank', | |
+ 'exchange', | |
+ 'expert', | |
+ 'exposed', | |
+ 'fail', | |
+ 'farm', | |
+ 'feedback', | |
+ 'fi', | |
+ 'finance', | |
+ 'financial', | |
+ 'firmdale', | |
+ 'fish', | |
+ 'fishing', | |
+ 'fitness', | |
+ 'fj', | |
+ 'fk', | |
+ 'flights', | |
+ 'florist', | |
+ 'flsmidth', | |
+ 'fly', | |
+ 'fm', | |
+ 'fo', | |
+ 'foo', | |
+ 'forsale', | |
+ 'foundation', | |
+ 'fr', | |
+ 'frl', | |
+ 'frogans', | |
+ 'fund', | |
+ 'furniture', | |
+ 'futbol', | |
+ 'ga', | |
+ 'gal', | |
+ 'gallery', | |
+ 'gb', | |
+ 'gbiz', | |
+ 'gd', | |
+ 'ge', | |
+ 'gent', | |
+ 'gf', | |
+ 'gg', | |
+ 'gh', | |
+ 'gi', | |
+ 'gift', | |
+ 'gifts', | |
+ 'gives', | |
+ 'gl', | |
+ 'glass', | |
+ 'gle', | |
+ 'global', | |
+ 'globo', | |
+ 'gm', | |
+ 'gmail', | |
+ 'gmo', | |
+ 'gmx', | |
+ 'gn', | |
+ 'google', | |
+ 'gop', | |
+ 'gov', | |
+ 'gp', | |
+ 'gq', | |
+ 'gr', | |
+ 'graphics', | |
+ 'gratis', | |
+ 'green', | |
+ 'gripe', | |
+ 'gs', | |
+ 'gt', | |
+ 'gu', | |
+ 'guide', | |
+ 'guitars', | |
+ 'guru', | |
+ 'gw', | |
+ 'gy', | |
+ 'hamburg', | |
+ 'haus', | |
+ 'healthcare', | |
+ 'help', | |
+ 'here', | |
+ 'hiphop', | |
+ 'hiv', | |
+ 'hk', | |
+ 'hm', | |
+ 'hn', | |
+ 'holdings', | |
+ 'holiday', | |
+ 'homes', | |
+ 'horse', | |
+ 'host', | |
+ 'hosting', | |
+ 'house', | |
+ 'how', | |
+ 'hr', | |
+ 'ht', | |
+ 'hu', | |
+ 'ibm', | |
+ 'id', | |
+ 'ie', | |
+ 'il', | |
+ 'im', | |
+ 'immo', | |
+ 'immobilien', | |
+ 'in', | |
+ 'industries', | |
+ 'info', | |
+ 'ing', | |
+ 'ink', | |
+ 'institute', | |
+ 'insure', | |
+ 'int', | |
+ 'international', | |
+ 'investments', | |
+ 'io', | |
+ 'iq', | |
+ 'ir', | |
+ 'is', | |
+ 'it', | |
+ 'je', | |
+ 'jetzt', | |
+ 'jm', | |
+ 'jo', | |
+ 'jobs', | |
+ 'joburg', | |
+ 'jp', | |
+ 'juegos', | |
+ 'kaufen', | |
+ 'ke', | |
+ 'kg', | |
+ 'kh', | |
+ 'ki', | |
+ 'kim', | |
+ 'kitchen', | |
+ 'kiwi', | |
+ 'km', | |
+ 'kn', | |
+ 'koeln', | |
+ 'kp', | |
+ 'kr', | |
+ 'krd', | |
+ 'kred', | |
+ 'kw', | |
+ 'ky', | |
+ 'kz', | |
+ 'la', | |
+ 'lacaixa', | |
+ 'land', | |
+ 'lawyer', | |
+ 'lb', | |
+ 'lc', | |
+ 'lds', | |
+ 'lease', | |
+ 'legal', | |
+ 'lgbt', | |
+ 'li', | |
+ 'life', | |
+ 'lighting', | |
+ 'limited', | |
+ 'limo', | |
+ 'link', | |
+ 'lk', | |
+ 'loans', | |
+ 'london', | |
+ 'lotto', | |
+ 'lr', | |
+ 'ls', | |
+ 'lt', | |
+ 'ltda', | |
+ 'lu', | |
+ 'luxe', | |
+ 'luxury', | |
+ 'lv', | |
+ 'ly', | |
+ 'ma', | |
+ 'madrid', | |
+ 'maison', | |
+ 'management', | |
+ 'mango', | |
+ 'market', | |
+ 'marketing', | |
+ 'mc', | |
+ 'md', | |
+ 'me', | |
+ 'media', | |
+ 'meet', | |
+ 'melbourne', | |
+ 'meme', | |
+ 'memorial', | |
+ 'menu', | |
+ 'mg', | |
+ 'mh', | |
+ 'miami', | |
+ 'mil', | |
+ 'mini', | |
+ 'mk', | |
+ 'ml', | |
+ 'mm', | |
+ 'mn', | |
+ 'mo', | |
+ 'mobi', | |
+ 'moda', | |
+ 'moe', | |
+ 'monash', | |
+ 'money', | |
+ 'mormon', | |
+ 'mortgage', | |
+ 'moscow', | |
+ 'motorcycles', | |
+ 'mov', | |
+ 'mp', | |
+ 'mq', | |
+ 'mr', | |
+ 'ms', | |
+ 'mt', | |
+ 'mu', | |
+ 'museum', | |
+ 'mv', | |
+ 'mw', | |
+ 'mx', | |
+ 'my', | |
+ 'mz', | |
+ 'na', | |
+ 'nagoya', | |
+ 'name', | |
+ 'navy', | |
+ 'nc', | |
+ 'ne', | |
+ 'net', | |
+ 'network', | |
+ 'neustar', | |
+ 'new', | |
+ 'nexus', | |
+ 'nf', | |
+ 'ng', | |
+ 'ngo', | |
+ 'nhk', | |
+ 'ni', | |
+ 'ninja', | |
+ 'nl', | |
+ 'no', | |
+ 'np', | |
+ 'nr', | |
+ 'nra', | |
+ 'nrw', | |
+ 'nu', | |
+ 'nyc', | |
+ 'nz', | |
+ 'okinawa', | |
+ 'om', | |
+ 'ong', | |
+ 'onl', | |
+ 'ooo', | |
+ 'org', | |
+ 'organic', | |
+ 'otsuka', | |
+ 'ovh', | |
+ 'pa', | |
+ 'paris', | |
+ 'partners', | |
+ 'parts', | |
+ 'party', | |
+ 'pe', | |
+ 'pf', | |
+ 'pg', | |
+ 'ph', | |
+ 'pharmacy', | |
+ 'photo', | |
+ 'photography', | |
+ 'photos', | |
+ 'physio', | |
+ 'pics', | |
+ 'pictures', | |
+ 'pink', | |
+ 'pizza', | |
+ 'pk', | |
+ 'pl', | |
+ 'place', | |
+ 'plumbing', | |
+ 'pm', | |
+ 'pn', | |
+ 'pohl', | |
+ 'poker', | |
+ 'post', | |
+ 'pr', | |
+ 'praxi', | |
+ 'press', | |
+ 'pro', | |
+ 'prod', | |
+ 'productions', | |
+ 'prof', | |
+ 'properties', | |
+ 'property', | |
+ 'ps', | |
+ 'pt', | |
+ 'pub', | |
+ 'pw', | |
+ 'py', | |
+ 'qa', | |
+ 'qpon', | |
+ 'quebec', | |
+ 're', | |
+ 'realtor', | |
+ 'recipes', | |
+ 'red', | |
+ 'rehab', | |
+ 'reise', | |
+ 'reisen', | |
+ 'reit', | |
+ 'ren', | |
+ 'rentals', | |
+ 'repair', | |
+ 'report', | |
+ 'republican', | |
+ 'rest', | |
+ 'restaurant', | |
+ 'reviews', | |
+ 'rich', | |
+ 'rio', | |
+ 'rip', | |
+ 'ro', | |
+ 'rocks', | |
+ 'rodeo', | |
+ 'rs', | |
+ 'rsvp', | |
+ 'ru', | |
+ 'ruhr', | |
+ 'rw', | |
+ 'ryukyu', | |
+ 'sa', | |
+ 'saarland', | |
+ 'sarl', | |
+ 'sb', | |
+ 'sc', | |
+ 'sca', | |
+ 'scb', | |
+ 'schmidt', | |
+ 'schule', | |
+ 'science', | |
+ 'scot', | |
+ 'sd', | |
+ 'se', | |
+ 'services', | |
+ 'sexy', | |
+ 'sg', | |
+ 'sh', | |
+ 'shiksha', | |
+ 'shoes', | |
+ 'si', | |
+ 'singles', | |
+ 'sj', | |
+ 'sk', | |
+ 'sl', | |
+ 'sm', | |
+ 'sn', | |
+ 'so', | |
+ 'social', | |
+ 'software', | |
+ 'sohu', | |
+ 'solar', | |
+ 'solutions', | |
+ 'soy', | |
+ 'space', | |
+ 'spiegel', | |
+ 'sr', | |
+ 'st', | |
+ 'su', | |
+ 'supplies', | |
+ 'supply', | |
+ 'support', | |
+ 'surf', | |
+ 'surgery', | |
+ 'suzuki', | |
+ 'sv', | |
+ 'sx', | |
+ 'sy', | |
+ 'sydney', | |
+ 'systems', | |
+ 'sz', | |
+ 'taipei', | |
+ 'tatar', | |
+ 'tattoo', | |
+ 'tax', | |
+ 'tc', | |
+ 'td', | |
+ 'technology', | |
+ 'tel', | |
+ 'tf', | |
+ 'tg', | |
+ 'th', | |
+ 'tienda', | |
+ 'tips', | |
+ 'tirol', | |
+ 'tj', | |
+ 'tk', | |
+ 'tl', | |
+ 'tm', | |
+ 'tn', | |
+ 'to', | |
+ 'today', | |
+ 'tokyo', | |
+ 'tools', | |
+ 'top', | |
+ 'town', | |
+ 'toys', | |
+ 'tp', | |
+ 'tr', | |
+ 'trade', | |
+ 'training', | |
+ 'travel', | |
+ 'tt', | |
+ 'tui', | |
+ 'tv', | |
+ 'tw', | |
+ 'tz', | |
+ 'ua', | |
+ 'ug', | |
+ 'uk', | |
+ 'university', | |
+ 'uno', | |
+ 'uol', | |
+ 'us', | |
+ 'uy', | |
+ 'uz', | |
+ 'va', | |
+ 'vacations', | |
+ 'vc', | |
+ 've', | |
+ 'vegas', | |
+ 'ventures', | |
+ 'versicherung', | |
+ 'vet', | |
+ 'vg', | |
+ 'vi', | |
+ 'viajes', | |
+ 'villas', | |
+ 'vision', | |
+ 'vlaanderen', | |
+ 'vn', | |
+ 'vodka', | |
+ 'vote', | |
+ 'voting', | |
+ 'voto', | |
+ 'voyage', | |
+ 'vu', | |
+ 'wales', | |
+ 'wang', | |
+ 'watch', | |
+ 'webcam', | |
+ 'website', | |
+ 'wed', | |
+ 'wedding', | |
+ 'wf', | |
+ 'whoswho', | |
+ 'wien', | |
+ 'wiki', | |
+ 'williamhill', | |
+ 'wme', | |
+ 'work', | |
+ 'works', | |
+ 'world', | |
+ 'ws', | |
+ 'wtc', | |
+ 'wtf', | |
+ 'xn--1qqw23a', | |
+ 'xn--3bst00m', | |
+ 'xn--3ds443g', | |
+ 'xn--3e0b707e', | |
+ 'xn--45brj9c', | |
+ 'xn--45q11c', | |
+ 'xn--4gbrim', | |
+ 'xn--55qw42g', | |
+ 'xn--55qx5d', | |
+ 'xn--6frz82g', | |
+ 'xn--6qq986b3xl', | |
+ 'xn--80adxhks', | |
+ 'xn--80ao21a', | |
+ 'xn--80asehdb', | |
+ 'xn--80aswg', | |
+ 'xn--90a3ac', | |
+ 'xn--c1avg', | |
+ 'xn--cg4bki', | |
+ 'xn--clchc0ea0b2g2a9gcd', | |
+ 'xn--czr694b', | |
+ 'xn--czru2d', | |
+ 'xn--d1acj3b', | |
+ 'xn--d1alf', | |
+ 'xn--fiq228c5hs', | |
+ 'xn--fiq64b', | |
+ 'xn--fiqs8s', | |
+ 'xn--fiqz9s', | |
+ 'xn--flw351e', | |
+ 'xn--fpcrj9c3d', | |
+ 'xn--fzc2c9e2c', | |
+ 'xn--gecrj9c', | |
+ 'xn--h2brj9c', | |
+ 'xn--i1b6b1a6a2e', | |
+ 'xn--io0a7i', | |
+ 'xn--j1amh', | |
+ 'xn--j6w193g', | |
+ 'xn--kprw13d', | |
+ 'xn--kpry57d', | |
+ 'xn--kput3i', | |
+ 'xn--l1acc', | |
+ 'xn--lgbbat1ad8j', | |
+ 'xn--mgb9awbf', | |
+ 'xn--mgba3a4f16a', | |
+ 'xn--mgbaam7a8h', | |
+ 'xn--mgbab2bd', | |
+ 'xn--mgbayh7gpa', | |
+ 'xn--mgbbh1a71e', | |
+ 'xn--mgbc0a9azcg', | |
+ 'xn--mgberp4a5d4ar', | |
+ 'xn--mgbx4cd0ab', | |
+ 'xn--ngbc5azd', | |
+ 'xn--node', | |
+ 'xn--nqv7f', | |
+ 'xn--nqv7fs00ema', | |
+ 'xn--o3cw4h', | |
+ 'xn--ogbpf8fl', | |
+ 'xn--p1acf', | |
+ 'xn--p1ai', | |
+ 'xn--pgbs0dh', | |
+ 'xn--q9jyb4c', | |
+ 'xn--qcka1pmc', | |
+ 'xn--rhqv96g', | |
+ 'xn--s9brj9c', | |
+ 'xn--ses554g', | |
+ 'xn--unup4y', | |
+ 'xn--vermgensberater-ctb', | |
+ 'xn--vermgensberatung-pwb', | |
+ 'xn--vhquv', | |
+ 'xn--wgbh1c', | |
+ 'xn--wgbl6a', | |
+ 'xn--xhq521b', | |
+ 'xn--xkc2al3hye2a', | |
+ 'xn--xkc2dl3a5ee0h', | |
+ 'xn--yfro4i67o', | |
+ 'xn--ygbi2ammx', | |
+ 'xn--zfr164b', | |
+ 'xxx', | |
+ 'xyz', | |
+ 'yachts', | |
+ 'yandex', | |
+ 'ye', | |
+ 'yoga', | |
+ 'yokohama', | |
+ 'youtube', | |
+ 'yt', | |
+ 'za', | |
+ 'zip', | |
+ 'zm', | |
+ 'zone', | |
+ 'zw', | |
+ '测试', | |
+ 'परीक्षा', | |
+ '佛山', | |
+ '集团', | |
+ '在线', | |
+ '한국', | |
+ 'ভারত', | |
+ '八卦', | |
+ 'موقع', | |
+ 'বাংলা', | |
+ '公益', | |
+ '公司', | |
+ '移动', | |
+ '我爱你', | |
+ 'москва', | |
+ 'испытание', | |
+ 'қаз', | |
+ 'онлайн', | |
+ 'сайт', | |
+ 'срб', | |
+ 'бел', | |
+ '테스트', | |
+ 'орг', | |
+ '삼성', | |
+ 'சிங்கப்பூர்', | |
+ '商标', | |
+ '商城', | |
+ 'дети', | |
+ 'мкд', | |
+ 'טעסט', | |
+ '中文网', | |
+ '中信', | |
+ '中国', | |
+ '中國', | |
+ '谷歌', | |
+ 'భారత్', | |
+ 'ලංකා', | |
+ '測試', | |
+ 'ભારત', | |
+ 'भारत', | |
+ 'آزمایشی', | |
+ 'பரிட்சை', | |
+ 'संगठन', | |
+ '网络', | |
+ 'укр', | |
+ '香港', | |
+ 'δοκιμή', | |
+ 'إختبار', | |
+ '台湾', | |
+ '台灣', | |
+ '手机', | |
+ 'мон', | |
+ 'الجزائر', | |
+ 'عمان', | |
+ 'ایران', | |
+ 'امارات', | |
+ 'بازار', | |
+ 'پاکستان', | |
+ 'الاردن', | |
+ 'بھارت', | |
+ 'المغرب', | |
+ 'السعودية', | |
+ 'سودان', | |
+ 'عراق', | |
+ 'مليسيا', | |
+ 'شبكة', | |
+ 'გე', | |
+ '机构', | |
+ '组织机构', | |
+ 'ไทย', | |
+ 'سورية', | |
+ 'рус', | |
+ 'рф', | |
+ 'تونس', | |
+ 'みんな', | |
+ 'グーグル', | |
+ '世界', | |
+ 'ਭਾਰਤ', | |
+ '网址', | |
+ '游戏', | |
+ 'vermögensberater', | |
+ 'vermögensberatung', | |
+ '企业', | |
+ 'مصر', | |
+ 'قطر', | |
+ '广东', | |
+ 'இலங்கை', | |
+ 'இந்தியா', | |
+ 'հայ', | |
+ '新加坡', | |
+ 'فلسطين', | |
+ 'テスト', | |
+ '政务', | |
+ ); | |
+ | |
+ /** | |
+ * @var string | |
+ */ | |
+ protected $_tld; | |
+ | |
+ /** | |
+ * Array for valid Idns | |
+ * @see http://www.iana.org/domains/idn-tables/ Official list of supported IDN Chars | |
+ * (.AC) Ascension Island http://www.nic.ac/pdf/AC-IDN-Policy.pdf | |
+ * (.AR) Argentinia http://www.nic.ar/faqidn.html | |
+ * (.AS) American Samoa http://www.nic.as/idn/chars.cfm | |
+ * (.AT) Austria http://www.nic.at/en/service/technical_information/idn/charset_converter/ | |
+ * (.BIZ) International http://www.iana.org/domains/idn-tables/ | |
+ * (.BR) Brazil http://registro.br/faq/faq6.html | |
+ * (.BV) Bouvett Island http://www.norid.no/domeneregistrering/idn/idn_nyetegn.en.html | |
+ * (.CA) Canada http://www.iana.org/domains/idn-tables/tables/ca_fr_1.0.html | |
+ * (.CAT) Catalan http://www.iana.org/domains/idn-tables/tables/cat_ca_1.0.html | |
+ * (.CH) Switzerland https://nic.switch.ch/reg/ocView.action?res=EF6GW2JBPVTG67DLNIQXU234MN6SC33JNQQGI7L6#anhang1 | |
+ * (.CL) Chile http://www.iana.org/domains/idn-tables/tables/cl_latn_1.0.html | |
+ * (.COM) International http://www.verisign.com/information-services/naming-services/internationalized-domain-names/index.html | |
+ * (.DE) Germany http://www.denic.de/en/domains/idns/liste.html | |
+ * (.DK) Danmark http://www.dk-hostmaster.dk/index.php?id=151 | |
+ * (.ES) Spain https://www.nic.es/media/2008-05/1210147705287.pdf | |
+ * (.FI) Finland http://www.ficora.fi/en/index/palvelut/fiverkkotunnukset/aakkostenkaytto.html | |
+ * (.GR) Greece https://grweb.ics.forth.gr/CharacterTable1_en.jsp | |
+ * (.HU) Hungary http://www.domain.hu/domain/English/szabalyzat/szabalyzat.html | |
+ * (.INFO) International http://www.nic.info/info/idn | |
+ * (.IO) British Indian Ocean Territory http://www.nic.io/IO-IDN-Policy.pdf | |
+ * (.IR) Iran http://www.nic.ir/Allowable_Characters_dot-iran | |
+ * (.IS) Iceland http://www.isnic.is/domain/rules.php | |
+ * (.KR) Korea http://www.iana.org/domains/idn-tables/tables/kr_ko-kr_1.0.html | |
+ * (.LI) Liechtenstein https://nic.switch.ch/reg/ocView.action?res=EF6GW2JBPVTG67DLNIQXU234MN6SC33JNQQGI7L6#anhang1 | |
+ * (.LT) Lithuania http://www.domreg.lt/static/doc/public/idn_symbols-en.pdf | |
+ * (.MD) Moldova http://www.register.md/ | |
+ * (.MUSEUM) International http://www.iana.org/domains/idn-tables/tables/museum_latn_1.0.html | |
+ * (.NET) International http://www.verisign.com/information-services/naming-services/internationalized-domain-names/index.html | |
+ * (.NO) Norway http://www.norid.no/domeneregistrering/idn/idn_nyetegn.en.html | |
+ * (.NU) Niue http://www.worldnames.net/ | |
+ * (.ORG) International http://www.pir.org/index.php?db=content/FAQs&tbl=FAQs_Registrant&id=2 | |
+ * (.PE) Peru https://www.nic.pe/nuevas_politicas_faq_2.php | |
+ * (.PL) Poland http://www.dns.pl/IDN/allowed_character_sets.pdf | |
+ * (.PR) Puerto Rico http://www.nic.pr/idn_rules.asp | |
+ * (.PT) Portugal https://online.dns.pt/dns_2008/do?com=DS;8216320233;111;+PAGE(4000058)+K-CAT-CODIGO(C.125)+RCNT(100); | |
+ * (.RU) Russia http://www.iana.org/domains/idn-tables/tables/ru_ru-ru_1.0.html | |
+ * (.RS) Serbia http://www.iana.org/domains/idn-tables/tables/rs_sr-rs_1.0.pdf | |
+ * (.SA) Saudi Arabia http://www.iana.org/domains/idn-tables/tables/sa_ar_1.0.html | |
+ * (.SE) Sweden http://www.iis.se/english/IDN_campaignsite.shtml?lang=en | |
+ * (.SH) Saint Helena http://www.nic.sh/SH-IDN-Policy.pdf | |
+ * (.SJ) Svalbard and Jan Mayen http://www.norid.no/domeneregistrering/idn/idn_nyetegn.en.html | |
+ * (.TH) Thailand http://www.iana.org/domains/idn-tables/tables/th_th-th_1.0.html | |
+ * (.TM) Turkmenistan http://www.nic.tm/TM-IDN-Policy.pdf | |
+ * (.TR) Turkey https://www.nic.tr/index.php | |
+ * (.UA) Ukraine http://www.iana.org/domains/idn-tables/tables/ua_cyrl_1.2.html | |
+ * (.VE) Venice http://www.iana.org/domains/idn-tables/tables/ve_es_1.0.html | |
+ * (.VN) Vietnam http://www.vnnic.vn/english/5-6-300-2-2-04-20071115.htm#1.%20Introduction | |
+ * | |
+ * @var array | |
+ */ | |
+ protected $_validIdns = array( | |
+ 'AC' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿāăąćĉċčďđēėęěĝġģĥħīįĵķĺļľŀłńņňŋőœŕŗřśŝşšţťŧūŭůűųŵŷźżž]{1,63}$/iu'), | |
+ 'AR' => array(1 => '/^[\x{002d}0-9a-zà-ãç-êìíñ-õü]{1,63}$/iu'), | |
+ 'AS' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıĵķĸĺļľłńņňŋōŏőœŕŗřśŝşšţťŧũūŭůűųŵŷźż]{1,63}$/iu'), | |
+ 'AT' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿœšž]{1,63}$/iu'), | |
+ 'BIZ' => 'Zend/Validate/Hostname/Biz.php', | |
+ 'BR' => array(1 => '/^[\x{002d}0-9a-zà-ãçéíó-õúü]{1,63}$/iu'), | |
+ 'BV' => array(1 => '/^[\x{002d}0-9a-zàáä-éêñ-ôöøüčđńŋšŧž]{1,63}$/iu'), | |
+ 'CA' => array(1 => '/^[\x{002d}0-9a-zàâæçéèêëîïôœùûüÿ\x{00E0}\x{00E2}\x{00E7}\x{00E8}\x{00E9}\x{00EA}\x{00EB}\x{00EE}\x{00EF}\x{00F4}\x{00F9}\x{00FB}\x{00FC}\x{00E6}\x{0153}\x{00FF}]{1,63}$/iu'), | |
+ 'CAT' => array(1 => '/^[\x{002d}0-9a-z·àç-éíïòóúü]{1,63}$/iu'), | |
+ 'CH' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿœ]{1,63}$/iu'), | |
+ 'CL' => array(1 => '/^[\x{002d}0-9a-záéíñóúü]{1,63}$/iu'), | |
+ 'CN' => 'Zend/Validate/Hostname/Cn.php', | |
+ 'COM' => 'Zend/Validate/Hostname/Com.php', | |
+ 'DE' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿăąāćĉčċďđĕěėęēğĝġģĥħĭĩįīıĵķĺľļłńňņŋŏőōœĸŕřŗśŝšşťßţŧŭůűũųūŵŷźžż]{1,63}$/iu'), | |
+ 'DK' => array(1 => '/^[\x{002d}0-9a-zäéöüæøå]{1,63}$/iu'), | |
+ 'ES' => array(1 => '/^[\x{002d}0-9a-zàáçèéíïñòóúü·]{1,63}$/iu'), | |
+ 'EU' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿ]{1,63}$/iu', | |
+ 2 => '/^[\x{002d}0-9a-zāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıĵķĺļľŀłńņňʼnŋōŏőœŕŗřśŝšťŧũūŭůűųŵŷźżž]{1,63}$/iu', | |
+ 3 => '/^[\x{002d}0-9a-zșț]{1,63}$/iu', | |
+ 4 => '/^[\x{002d}0-9a-zΐάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ]{1,63}$/iu', | |
+ 5 => '/^[\x{002d}0-9a-zабвгдежзийклмнопрстуфхцчшщъыьэюя]{1,63}$/iu', | |
+ 6 => '/^[\x{002d}0-9a-zἀ-ἇἐ-ἕἠ-ἧἰ-ἷὀ-ὅὐ-ὗὠ-ὧὰ-ὼώᾀ-ᾇᾐ-ᾗᾠ-ᾧᾰ-ᾴᾶᾷῂῃῄῆῇῐ-ῒΐῖῗῠ-ῧῲῳῴῶῷ]{1,63}$/iu'), | |
+ 'FI' => array(1 => '/^[\x{002d}0-9a-zäåö]{1,63}$/iu'), | |
+ 'GR' => array(1 => '/^[\x{002d}0-9a-zΆΈΉΊΌΎ-ΡΣ-ώἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼῂῃῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲῳῴῶ-ῼ]{1,63}$/iu'), | |
+ 'HK' => 'Zend/Validate/Hostname/Cn.php', | |
+ 'HU' => array(1 => '/^[\x{002d}0-9a-záéíóöúüőű]{1,63}$/iu'), | |
+ 'IL' => array(1 => '/^[\x{002d}0-9\x{05D0}-\x{05EA}]{1,63}$/iu', | |
+ 2 => '/^[\x{002d}0-9a-z]{1,63}$/i'), | |
+ 'INFO'=> array(1 => '/^[\x{002d}0-9a-zäåæéöøü]{1,63}$/iu', | |
+ 2 => '/^[\x{002d}0-9a-záéíóöúüőű]{1,63}$/iu', | |
+ 3 => '/^[\x{002d}0-9a-záæéíðóöúýþ]{1,63}$/iu', | |
+ 4 => '/^[\x{AC00}-\x{D7A3}]{1,17}$/iu', | |
+ 5 => '/^[\x{002d}0-9a-zāčēģīķļņōŗšūž]{1,63}$/iu', | |
+ 6 => '/^[\x{002d}0-9a-ząčėęįšūųž]{1,63}$/iu', | |
+ 7 => '/^[\x{002d}0-9a-zóąćęłńśźż]{1,63}$/iu', | |
+ 8 => '/^[\x{002d}0-9a-záéíñóúü]{1,63}$/iu'), | |
+ 'IO' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿăąāćĉčċďđĕěėęēğĝġģĥħĭĩįīıĵķĺľļłńňņŋŏőōœĸŕřŗśŝšşťţŧŭůűũųūŵŷźžż]{1,63}$/iu'), | |
+ 'IS' => array(1 => '/^[\x{002d}0-9a-záéýúíóþæöð]{1,63}$/iu'), | |
+ 'IT' => array(1 => '/^[\x{002d}0-9a-zàâäèéêëìîïòôöùûüæœçÿß-]{1,63}$/iu'), | |
+ 'JP' => 'Zend/Validate/Hostname/Jp.php', | |
+ 'KR' => array(1 => '/^[\x{AC00}-\x{D7A3}]{1,17}$/iu'), | |
+ 'LI' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿœ]{1,63}$/iu'), | |
+ 'LT' => array(1 => '/^[\x{002d}0-9ąčęėįšųūž]{1,63}$/iu'), | |
+ 'MD' => array(1 => '/^[\x{002d}0-9ăâîşţ]{1,63}$/iu'), | |
+ 'MUSEUM' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿāăąćċčďđēėęěğġģħīįıķĺļľłńņňŋōőœŕŗřśşšţťŧūůűųŵŷźżžǎǐǒǔ\x{01E5}\x{01E7}\x{01E9}\x{01EF}ə\x{0292}ẁẃẅỳ]{1,63}$/iu'), | |
+ 'NET' => 'Zend/Validate/Hostname/Com.php', | |
+ 'NO' => array(1 => '/^[\x{002d}0-9a-zàáä-éêñ-ôöøüčđńŋšŧž]{1,63}$/iu'), | |
+ 'NU' => 'Zend/Validate/Hostname/Com.php', | |
+ 'ORG' => array(1 => '/^[\x{002d}0-9a-záéíñóúü]{1,63}$/iu', | |
+ 2 => '/^[\x{002d}0-9a-zóąćęłńśźż]{1,63}$/iu', | |
+ 3 => '/^[\x{002d}0-9a-záäåæéëíðóöøúüýþ]{1,63}$/iu', | |
+ 4 => '/^[\x{002d}0-9a-záéíóöúüőű]{1,63}$/iu', | |
+ 5 => '/^[\x{002d}0-9a-ząčėęįšūųž]{1,63}$/iu', | |
+ 6 => '/^[\x{AC00}-\x{D7A3}]{1,17}$/iu', | |
+ 7 => '/^[\x{002d}0-9a-zāčēģīķļņōŗšūž]{1,63}$/iu'), | |
+ 'PE' => array(1 => '/^[\x{002d}0-9a-zñáéíóúü]{1,63}$/iu'), | |
+ 'PL' => array(1 => '/^[\x{002d}0-9a-zāčēģīķļņōŗšūž]{1,63}$/iu', | |
+ 2 => '/^[\x{002d}а-ик-ш\x{0450}ѓѕјљњќџ]{1,63}$/iu', | |
+ 3 => '/^[\x{002d}0-9a-zâîăşţ]{1,63}$/iu', | |
+ 4 => '/^[\x{002d}0-9а-яё\x{04C2}]{1,63}$/iu', | |
+ 5 => '/^[\x{002d}0-9a-zàáâèéêìíîòóôùúûċġħż]{1,63}$/iu', | |
+ 6 => '/^[\x{002d}0-9a-zàäåæéêòóôöøü]{1,63}$/iu', | |
+ 7 => '/^[\x{002d}0-9a-zóąćęłńśźż]{1,63}$/iu', | |
+ 8 => '/^[\x{002d}0-9a-zàáâãçéêíòóôõúü]{1,63}$/iu', | |
+ 9 => '/^[\x{002d}0-9a-zâîăşţ]{1,63}$/iu', | |
+ 10=> '/^[\x{002d}0-9a-záäéíóôúýčďĺľňŕšťž]{1,63}$/iu', | |
+ 11=> '/^[\x{002d}0-9a-zçë]{1,63}$/iu', | |
+ 12=> '/^[\x{002d}0-9а-ик-шђјљњћџ]{1,63}$/iu', | |
+ 13=> '/^[\x{002d}0-9a-zćčđšž]{1,63}$/iu', | |
+ 14=> '/^[\x{002d}0-9a-zâçöûüğış]{1,63}$/iu', | |
+ 15=> '/^[\x{002d}0-9a-záéíñóúü]{1,63}$/iu', | |
+ 16=> '/^[\x{002d}0-9a-zäõöüšž]{1,63}$/iu', | |
+ 17=> '/^[\x{002d}0-9a-zĉĝĥĵŝŭ]{1,63}$/iu', | |
+ 18=> '/^[\x{002d}0-9a-zâäéëîô]{1,63}$/iu', | |
+ 19=> '/^[\x{002d}0-9a-zàáâäåæçèéêëìíîïðñòôöøùúûüýćčłńřśš]{1,63}$/iu', | |
+ 20=> '/^[\x{002d}0-9a-zäåæõöøüšž]{1,63}$/iu', | |
+ 21=> '/^[\x{002d}0-9a-zàáçèéìíòóùú]{1,63}$/iu', | |
+ 22=> '/^[\x{002d}0-9a-zàáéíóöúüőű]{1,63}$/iu', | |
+ 23=> '/^[\x{002d}0-9ΐά-ώ]{1,63}$/iu', | |
+ 24=> '/^[\x{002d}0-9a-zàáâåæçèéêëðóôöøüþœ]{1,63}$/iu', | |
+ 25=> '/^[\x{002d}0-9a-záäéíóöúüýčďěňřšťůž]{1,63}$/iu', | |
+ 26=> '/^[\x{002d}0-9a-z·àçèéíïòóúü]{1,63}$/iu', | |
+ 27=> '/^[\x{002d}0-9а-ъьюя\x{0450}\x{045D}]{1,63}$/iu', | |
+ 28=> '/^[\x{002d}0-9а-яёіў]{1,63}$/iu', | |
+ 29=> '/^[\x{002d}0-9a-ząčėęįšūųž]{1,63}$/iu', | |
+ 30=> '/^[\x{002d}0-9a-záäåæéëíðóöøúüýþ]{1,63}$/iu', | |
+ 31=> '/^[\x{002d}0-9a-zàâæçèéêëîïñôùûüÿœ]{1,63}$/iu', | |
+ 32=> '/^[\x{002d}0-9а-щъыьэюяёєіїґ]{1,63}$/iu', | |
+ 33=> '/^[\x{002d}0-9א-ת]{1,63}$/iu'), | |
+ 'PR' => array(1 => '/^[\x{002d}0-9a-záéíóúñäëïüöâêîôûàèùæçœãõ]{1,63}$/iu'), | |
+ 'PT' => array(1 => '/^[\x{002d}0-9a-záàâãçéêíóôõú]{1,63}$/iu'), | |
+ 'RS' => array(1 => '/^[\x{002D}\x{0030}-\x{0039}\x{0061}-\x{007A}\x{0107}\x{010D}\x{0111}\x{0161}\x{017E}]{1,63}$/iu)'), | |
+ 'RU' => array(1 => '/^[\x{002d}0-9а-яё]{1,63}$/iu'), | |
+ 'SA' => array(1 => '/^[\x{002d}.0-9\x{0621}-\x{063A}\x{0641}-\x{064A}\x{0660}-\x{0669}]{1,63}$/iu'), | |
+ 'SE' => array(1 => '/^[\x{002d}0-9a-zäåéöü]{1,63}$/iu'), | |
+ 'SH' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿăąāćĉčċďđĕěėęēğĝġģĥħĭĩįīıĵķĺľļłńňņŋŏőōœĸŕřŗśŝšşťţŧŭůűũųūŵŷźžż]{1,63}$/iu'), | |
+ 'SI' => array( | |
+ 1 => '/^[\x{002d}0-9a-zà-öø-ÿ]{1,63}$/iu', | |
+ 2 => '/^[\x{002d}0-9a-zāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıĵķĺļľŀłńņňʼnŋōŏőœŕŗřśŝšťŧũūŭůűųŵŷźżž]{1,63}$/iu', | |
+ 3 => '/^[\x{002d}0-9a-zșț]{1,63}$/iu'), | |
+ 'SJ' => array(1 => '/^[\x{002d}0-9a-zàáä-éêñ-ôöøüčđńŋšŧž]{1,63}$/iu'), | |
+ 'TH' => array(1 => '/^[\x{002d}0-9a-z\x{0E01}-\x{0E3A}\x{0E40}-\x{0E4D}\x{0E50}-\x{0E59}]{1,63}$/iu'), | |
+ 'TM' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿāăąćĉċčďđēėęěĝġģĥħīįĵķĺļľŀłńņňŋőœŕŗřśŝşšţťŧūŭůűųŵŷźżž]{1,63}$/iu'), | |
+ 'TW' => 'Zend/Validate/Hostname/Cn.php', | |
+ 'TR' => array(1 => '/^[\x{002d}0-9a-zğıüşöç]{1,63}$/iu'), | |
+ 'UA' => array(1 => '/^[\x{002d}0-9a-zабвгдежзийклмнопрстуфхцчшщъыьэюяѐёђѓєѕіїјљњћќѝўџґӂʼ]{1,63}$/iu'), | |
+ 'VE' => array(1 => '/^[\x{002d}0-9a-záéíóúüñ]{1,63}$/iu'), | |
+ 'VN' => array(1 => '/^[ÀÁÂÃÈÉÊÌÍÒÓÔÕÙÚÝàáâãèéêìíòóôõùúýĂăĐđĨĩŨũƠơƯư\x{1EA0}-\x{1EF9}]{1,63}$/iu'), | |
+ 'мон' => array(1 => '/^[\x{002d}0-9\x{0430}-\x{044F}]{1,63}$/iu'), | |
+ 'срб' => array(1 => '/^[\x{002d}0-9а-ик-шђјљњћџ]{1,63}$/iu'), | |
+ 'сайт' => array(1 => '/^[\x{002d}0-9а-яёіїѝйўґг]{1,63}$/iu'), | |
+ 'онлайн' => array(1 => '/^[\x{002d}0-9а-яёіїѝйўґг]{1,63}$/iu'), | |
+ '中国' => 'Zend/Validate/Hostname/Cn.php', | |
+ '中國' => 'Zend/Validate/Hostname/Cn.php', | |
+ 'ලංකා' => array(1 => '/^[\x{0d80}-\x{0dff}]{1,63}$/iu'), | |
+ '香港' => 'Zend/Validate/Hostname/Cn.php', | |
+ '台湾' => 'Zend/Validate/Hostname/Cn.php', | |
+ '台灣' => 'Zend/Validate/Hostname/Cn.php', | |
+ 'امارات' => array(1 => '/^[\x{0621}-\x{0624}\x{0626}-\x{063A}\x{0641}\x{0642}\x{0644}-\x{0648}\x{067E}\x{0686}\x{0698}\x{06A9}\x{06AF}\x{06CC}\x{06F0}-\x{06F9}]{1,30}$/iu'), | |
+ 'الاردن' => array(1 => '/^[\x{0621}-\x{0624}\x{0626}-\x{063A}\x{0641}\x{0642}\x{0644}-\x{0648}\x{067E}\x{0686}\x{0698}\x{06A9}\x{06AF}\x{06CC}\x{06F0}-\x{06F9}]{1,30}$/iu'), | |
+ 'السعودية' => array(1 => '/^[\x{0621}-\x{0624}\x{0626}-\x{063A}\x{0641}\x{0642}\x{0644}-\x{0648}\x{067E}\x{0686}\x{0698}\x{06A9}\x{06AF}\x{06CC}\x{06F0}-\x{06F9}]{1,30}$/iu'), | |
+ 'ไทย' => array(1 => '/^[\x{002d}0-9a-z\x{0E01}-\x{0E3A}\x{0E40}-\x{0E4D}\x{0E50}-\x{0E59}]{1,63}$/iu'), | |
+ 'рф' => array(1 => '/^[\x{002d}0-9а-яё]{1,63}$/iu'), | |
+ 'تونس' => array(1 => '/^[\x{0621}-\x{0624}\x{0626}-\x{063A}\x{0641}\x{0642}\x{0644}-\x{0648}\x{067E}\x{0686}\x{0698}\x{06A9}\x{06AF}\x{06CC}\x{06F0}-\x{06F9}]{1,30}$/iu'), | |
+ 'مصر' => array(1 => '/^[\x{0621}-\x{0624}\x{0626}-\x{063A}\x{0641}\x{0642}\x{0644}-\x{0648}\x{067E}\x{0686}\x{0698}\x{06A9}\x{06AF}\x{06CC}\x{06F0}-\x{06F9}]{1,30}$/iu'), | |
+ 'இலங்கை' => array(1 => '/^[\x{0b80}-\x{0bff}]{1,63}$/iu'), | |
+ 'فلسطين' => array(1 => '/^[\x{0621}-\x{0624}\x{0626}-\x{063A}\x{0641}\x{0642}\x{0644}-\x{0648}\x{067E}\x{0686}\x{0698}\x{06A9}\x{06AF}\x{06CC}\x{06F0}-\x{06F9}]{1,30}$/iu'), | |
+ 'شبكة' => array(1 => '/^[\x{0621}-\x{0624}\x{0626}-\x{063A}\x{0641}\x{0642}\x{0644}-\x{0648}\x{067E}\x{0686}\x{0698}\x{06A9}\x{06AF}\x{06CC}\x{06F0}-\x{06F9}]{1,30}$/iu'), | |
+ ); | |
+ | |
+ protected $_idnLength = array( | |
+ 'BIZ' => array(5 => 17, 11 => 15, 12 => 20), | |
+ 'CN' => array(1 => 20), | |
+ 'COM' => array(3 => 17, 5 => 20), | |
+ 'HK' => array(1 => 15), | |
+ 'INFO'=> array(4 => 17), | |
+ 'KR' => array(1 => 17), | |
+ 'NET' => array(3 => 17, 5 => 20), | |
+ 'ORG' => array(6 => 17), | |
+ 'TW' => array(1 => 20), | |
+ 'ایران' => array(1 => 30), | |
+ '中国' => array(1 => 20), | |
+ '公司' => array(1 => 20), | |
+ '网络' => array(1 => 20), | |
+ ); | |
+ | |
+ protected $_options = array( | |
+ 'allow' => self::ALLOW_DNS, | |
+ 'idn' => true, | |
+ 'tld' => true, | |
+ 'ip' => null | |
+ ); | |
+ | |
+ /** | |
+ * Sets validator options | |
+ * | |
+ * @see http://www.iana.org/cctld/specifications-policies-cctlds-01apr02.htm Technical Specifications for ccTLDs | |
+ * @param array $options Validator options | |
+ */ | |
+ public function __construct($options = array()) | |
+ { | |
+ if ($options instanceof Zend_Config) { | |
+ $options = $options->toArray(); | |
+ } else if (!is_array($options)) { | |
+ $options = func_get_args(); | |
+ $temp['allow'] = array_shift($options); | |
+ if (!empty($options)) { | |
+ $temp['idn'] = array_shift($options); | |
+ } | |
+ | |
+ if (!empty($options)) { | |
+ $temp['tld'] = array_shift($options); | |
+ } | |
+ | |
+ if (!empty($options)) { | |
+ $temp['ip'] = array_shift($options); | |
+ } | |
+ | |
+ $options = $temp; | |
+ } | |
+ | |
+ $options += $this->_options; | |
+ $this->setOptions($options); | |
+ } | |
+ | |
+ /** | |
+ * Returns all set options | |
+ * | |
+ * @return array | |
+ */ | |
+ public function getOptions() | |
+ { | |
+ return $this->_options; | |
+ } | |
+ | |
+ /** | |
+ * Sets the options for this validator | |
+ * | |
+ * @param array $options | |
+ * @return Zend_Validate_Hostname | |
+ */ | |
+ public function setOptions($options) | |
+ { | |
+ if (array_key_exists('allow', $options)) { | |
+ $this->setAllow($options['allow']); | |
+ } | |
+ | |
+ if (array_key_exists('idn', $options)) { | |
+ $this->setValidateIdn($options['idn']); | |
+ } | |
+ | |
+ if (array_key_exists('tld', $options)) { | |
+ $this->setValidateTld($options['tld']); | |
+ } | |
+ | |
+ if (array_key_exists('ip', $options)) { | |
+ $this->setIpValidator($options['ip']); | |
+ } | |
+ | |
+ return $this; | |
+ } | |
+ | |
+ /** | |
+ * Returns the set ip validator | |
+ * | |
+ * @return Zend_Validate_Ip | |
+ */ | |
+ public function getIpValidator() | |
+ { | |
+ return $this->_options['ip']; | |
+ } | |
+ | |
+ /** | |
+ * @param Zend_Validate_Ip $ipValidator OPTIONAL | |
+ * @return Zend_Validate_Hostname | |
+ */ | |
+ public function setIpValidator(Zend_Validate_Ip $ipValidator = null) | |
+ { | |
+ if ($ipValidator === null) { | |
+ $ipValidator = new Zend_Validate_Ip(); | |
+ } | |
+ | |
+ $this->_options['ip'] = $ipValidator; | |
+ return $this; | |
+ } | |
+ | |
+ /** | |
+ * Returns the allow option | |
+ * | |
+ * @return integer | |
+ */ | |
+ public function getAllow() | |
+ { | |
+ return $this->_options['allow']; | |
+ } | |
+ | |
+ /** | |
+ * Sets the allow option | |
+ * | |
+ * @param integer $allow | |
+ * @return Zend_Validate_Hostname Provides a fluent interface | |
+ */ | |
+ public function setAllow($allow) | |
+ { | |
+ $this->_options['allow'] = $allow; | |
+ return $this; | |
+ } | |
+ | |
+ /** | |
+ * Returns the set idn option | |
+ * | |
+ * @return boolean | |
+ */ | |
+ public function getValidateIdn() | |
+ { | |
+ return $this->_options['idn']; | |
+ } | |
+ | |
+ /** | |
+ * Set whether IDN domains are validated | |
+ * | |
+ * This only applies when DNS hostnames are validated | |
+ * | |
+ * @param boolean $allowed Set allowed to true to validate IDNs, and false to not validate them | |
+ * @return $this | |
+ */ | |
+ public function setValidateIdn ($allowed) | |
+ { | |
+ $this->_options['idn'] = (bool) $allowed; | |
+ return $this; | |
+ } | |
+ | |
+ /** | |
+ * Returns the set tld option | |
+ * | |
+ * @return boolean | |
+ */ | |
+ public function getValidateTld() | |
+ { | |
+ return $this->_options['tld']; | |
+ } | |
+ | |
+ /** | |
+ * Set whether the TLD element of a hostname is validated | |
+ * | |
+ * This only applies when DNS hostnames are validated | |
+ * | |
+ * @param boolean $allowed Set allowed to true to validate TLDs, and false to not validate them | |
+ * @return $this | |
+ */ | |
+ public function setValidateTld ($allowed) | |
+ { | |
+ $this->_options['tld'] = (bool) $allowed; | |
+ return $this; | |
+ } | |
+ | |
+ /** | |
+ * Defined by Zend_Validate_Interface | |
+ * | |
+ * Returns true if and only if the $value is a valid hostname with respect to the current allow option | |
+ * | |
+ * @param string $value | |
+ * @throws Zend_Validate_Exception if a fatal error occurs for validation process | |
+ * @return boolean | |
+ */ | |
+ public function isValid($value) | |
+ { | |
+ if (!is_string($value)) { | |
+ $this->_error(self::INVALID); | |
+ return false; | |
+ } | |
+ | |
+ $this->_setValue($value); | |
+ // Check input against IP address schema | |
+ if (preg_match('/^[0-9a-f:.]*$/i', $value) && | |
+ $this->_options['ip']->setTranslator($this->getTranslator())->isValid($value)) { | |
+ if (!($this->_options['allow'] & self::ALLOW_IP)) { | |
+ $this->_error(self::IP_ADDRESS_NOT_ALLOWED); | |
+ return false; | |
+ } else { | |
+ return true; | |
+ } | |
+ } | |
+ | |
+ // RFC3986 3.2.2 states: | |
+ // | |
+ // The rightmost domain label of a fully qualified domain name | |
+ // in DNS may be followed by a single "." and should be if it is | |
+ // necessary to distinguish between the complete domain name and | |
+ // some local domain. | |
+ // | |
+ // (see ZF-6363) | |
+ | |
+ // Local hostnames are allowed to be partitial (ending '.') | |
+ if ($this->_options['allow'] & self::ALLOW_LOCAL) { | |
+ if (substr($value, -1) === '.') { | |
+ $value = substr($value, 0, -1); | |
+ if (substr($value, -1) === '.') { | |
+ // Empty hostnames (ending '..') are not allowed | |
+ $this->_error(self::INVALID_LOCAL_NAME); | |
+ return false; | |
+ } | |
+ } | |
+ } | |
+ | |
+ $domainParts = explode('.', $value); | |
+ | |
+ // Prevent partitial IP V4 adresses (ending '.') | |
+ if ((count($domainParts) == 4) && preg_match('/^[0-9.a-e:.]*$/i', $value) && | |
+ $this->_options['ip']->setTranslator($this->getTranslator())->isValid($value)) { | |
+ $this->_error(self::INVALID_LOCAL_NAME); | |
+ } | |
+ | |
+ // Check input against DNS hostname schema | |
+ if ((count($domainParts) > 1) && (strlen($value) >= 4) && (strlen($value) <= 254)) { | |
+ $status = false; | |
+ | |
+ $origenc = PHP_VERSION_ID < 50600 | |
+ ? iconv_get_encoding('internal_encoding') | |
+ : ini_get('default_charset'); | |
+ if (PHP_VERSION_ID < 50600) { | |
+ iconv_set_encoding('internal_encoding', 'UTF-8'); | |
+ } else { | |
+ ini_set('default_charset', 'UTF-8'); | |
+ } | |
+ do { | |
+ // First check TLD | |
+ $matches = array(); | |
+ if (preg_match('/([^.]{2,63})$/iu', end($domainParts), $matches) | |
+ || (array_key_exists(end($domainParts), $this->_validIdns))) { | |
+ reset($domainParts); | |
+ | |
+ // Hostname characters are: *(label dot)(label dot label); max 254 chars | |
+ // label: id-prefix [*ldh{61} id-prefix]; max 63 chars | |
+ // id-prefix: alpha / digit | |
+ // ldh: alpha / digit / dash | |
+ | |
+ // Match TLD against known list | |
+ $this->_tld = $matches[1]; | |
+ if ($this->_options['tld']) { | |
+ if (!in_array(strtolower($this->_tld), $this->_validTlds) | |
+ && !in_array($this->_tld, $this->_validTlds) | |
+ && !$this->checkDnsRecords($this->_value) | |
+ ) { | |
+ $this->_error(self::UNKNOWN_TLD); | |
+ $status = false; | |
+ break; | |
+ } | |
+ // We have already validated that the TLD is fine. We don't want it to go through the below | |
+ // checks as new UTF-8 TLDs will incorrectly fail if there is no IDN regex for it. | |
+ array_pop($domainParts); | |
+ } | |
+ | |
+ /** | |
+ * Match against IDN hostnames | |
+ * Note: Keep label regex short to avoid issues with long patterns when matching IDN hostnames | |
+ * @see Zend_Validate_Hostname_Interface | |
+ */ | |
+ $regexChars = array(0 => '/^[a-z0-9\x2d]{1,63}$/i'); | |
+ if ($this->_options['idn'] && isset($this->_validIdns[strtoupper($this->_tld)])) { | |
+ if (is_string($this->_validIdns[strtoupper($this->_tld)])) { | |
+ $regexChars += include($this->_validIdns[strtoupper($this->_tld)]); | |
+ } else { | |
+ $regexChars += $this->_validIdns[strtoupper($this->_tld)]; | |
+ } | |
+ } | |
+ | |
+ // Check each hostname part | |
+ $check = 0; | |
+ foreach ($domainParts as $domainPart) { | |
+ // If some domain part is empty (i.e. zend..com), it's invalid | |
+ if (empty($domainPart) && $domainPart !== '0') { | |
+ $this->_error(self::INVALID_HOSTNAME); | |
+ return false; | |
+ } | |
+ | |
+ // Decode Punycode domainnames to IDN | |
+ if (strpos($domainPart, 'xn--') === 0) { | |
+ $domainPart = $this->decodePunycode(substr($domainPart, 4)); | |
+ if ($domainPart === false) { | |
+ return false; | |
+ } | |
+ } | |
+ | |
+ // Check dash (-) does not start, end or appear in 3rd and 4th positions | |
+ if ((strpos($domainPart, '-') === 0) | |
+ || ((strlen($domainPart) > 2) && (strpos($domainPart, '-', 2) == 2) && (strpos($domainPart, '-', 3) == 3)) | |
+ || (strpos($domainPart, '-') === (strlen($domainPart) - 1))) { | |
+ $this->_error(self::INVALID_DASH); | |
+ $status = false; | |
+ break 2; | |
+ } | |
+ | |
+ // Check each domain part | |
+ $checked = false; | |
+ foreach($regexChars as $regexKey => $regexChar) { | |
+ $status = preg_match($regexChar, $domainPart); | |
+ if ($status > 0) { | |
+ $length = 63; | |
+ if (array_key_exists(strtoupper($this->_tld), $this->_idnLength) | |
+ && (array_key_exists($regexKey, $this->_idnLength[strtoupper($this->_tld)]))) { | |
+ $length = $this->_idnLength[strtoupper($this->_tld)]; | |
+ } | |
+ | |
+ if (iconv_strlen($domainPart, 'UTF-8') > $length) { | |
+ $this->_error(self::INVALID_HOSTNAME); | |
+ } else { | |
+ $checked = true; | |
+ break; | |
+ } | |
+ } | |
+ } | |
+ | |
+ if ($checked) { | |
+ ++$check; | |
+ } | |
+ } | |
+ | |
+ // If one of the labels doesn't match, the hostname is invalid | |
+ if ($check !== count($domainParts)) { | |
+ $this->_error(self::INVALID_HOSTNAME_SCHEMA); | |
+ $status = false; | |
+ } | |
+ } else { | |
+ // Hostname not long enough | |
+ $this->_error(self::UNDECIPHERABLE_TLD); | |
+ $status = false; | |
+ } | |
+ } while (false); | |
+ | |
+ if (PHP_VERSION_ID < 50600) { | |
+ iconv_set_encoding('internal_encoding', $origenc); | |
+ } else { | |
+ ini_set('default_charset', $origenc); | |
+ } | |
+ // If the input passes as an Internet domain name, and domain names are allowed, then the hostname | |
+ // passes validation | |
+ if ($status && ($this->_options['allow'] & self::ALLOW_DNS)) { | |
+ return true; | |
+ } | |
+ } else if ($this->_options['allow'] & self::ALLOW_DNS) { | |
+ $this->_error(self::INVALID_HOSTNAME); | |
+ } | |
+ | |
+ // Check for URI Syntax (RFC3986) | |
+ if ($this->_options['allow'] & self::ALLOW_URI) { | |
+ if (preg_match("/^([a-zA-Z0-9-._~!$&\'()*+,;=]|%[[:xdigit:]]{2}){1,254}$/i", $value)) { | |
+ return true; | |
+ } else { | |
+ $this->_error(self::INVALID_URI); | |
+ } | |
+ } | |
+ | |
+ // Check input against local network name schema; last chance to pass validation | |
+ $regexLocal = '/^(([a-zA-Z0-9\x2d]{1,63}\x2e)*[a-zA-Z0-9\x2d]{1,63}[\x2e]{0,1}){1,254}$/'; | |
+ $status = @preg_match($regexLocal, $value); | |
+ | |
+ // If the input passes as a local network name, and local network names are allowed, then the | |
+ // hostname passes validation | |
+ $allowLocal = $this->_options['allow'] & self::ALLOW_LOCAL; | |
+ if ($status && $allowLocal) { | |
+ return true; | |
+ } | |
+ | |
+ // If the input does not pass as a local network name, add a message | |
+ if (!$status) { | |
+ $this->_error(self::INVALID_LOCAL_NAME); | |
+ } | |
+ | |
+ // If local network names are not allowed, add a message | |
+ if ($status && !$allowLocal) { | |
+ $this->_error(self::LOCAL_NAME_NOT_ALLOWED); | |
+ } | |
+ | |
+ return false; | |
+ } | |
+ | |
+ /** | |
+ * Decodes a punycode encoded string to it's original utf8 string | |
+ * In case of a decoding failure the original string is returned | |
+ * | |
+ * @param string $encoded Punycode encoded string to decode | |
+ * @return string | |
+ */ | |
+ protected function decodePunycode($encoded) | |
+ { | |
+ if (!preg_match('/^[a-z0-9-]+$/i', $encoded)) { | |
+ // no punycode encoded string | |
+ $this->_error(self::CANNOT_DECODE_PUNYCODE); | |
+ return false; | |
+ } | |
+ | |
+ $decoded = array(); | |
+ $separator = strrpos($encoded, '-'); | |
+ if ($separator > 0) { | |
+ for ($x = 0; $x < $separator; ++$x) { | |
+ // prepare decoding matrix | |
+ $decoded[] = ord($encoded[$x]); | |
+ } | |
+ } | |
+ | |
+ $lengthd = count($decoded); | |
+ $lengthe = strlen($encoded); | |
+ | |
+ // decoding | |
+ $init = true; | |
+ $base = 72; | |
+ $index = 0; | |
+ $char = 0x80; | |
+ | |
+ for ($indexe = ($separator) ? ($separator + 1) : 0; $indexe < $lengthe; ++$lengthd) { | |
+ for ($old_index = $index, $pos = 1, $key = 36; 1 ; $key += 36) { | |
+ $hex = ord($encoded[$indexe++]); | |
+ $digit = ($hex - 48 < 10) ? $hex - 22 | |
+ : (($hex - 65 < 26) ? $hex - 65 | |
+ : (($hex - 97 < 26) ? $hex - 97 | |
+ : 36)); | |
+ | |
+ $index += $digit * $pos; | |
+ $tag = ($key <= $base) ? 1 : (($key >= $base + 26) ? 26 : ($key - $base)); | |
+ if ($digit < $tag) { | |
+ break; | |
+ } | |
+ | |
+ $pos = (int) ($pos * (36 - $tag)); | |
+ } | |
+ | |
+ $delta = intval($init ? (($index - $old_index) / 700) : (($index - $old_index) / 2)); | |
+ $delta += intval($delta / ($lengthd + 1)); | |
+ for ($key = 0; $delta > 910 / 2; $key += 36) { | |
+ $delta = intval($delta / 35); | |
+ } | |
+ | |
+ $base = intval($key + 36 * $delta / ($delta + 38)); | |
+ $init = false; | |
+ $char += (int) ($index / ($lengthd + 1)); | |
+ $index %= ($lengthd + 1); | |
+ if ($lengthd > 0) { | |
+ for ($i = $lengthd; $i > $index; $i--) { | |
+ $decoded[$i] = $decoded[($i - 1)]; | |
+ } | |
+ } | |
+ | |
+ $decoded[$index++] = $char; | |
+ } | |
+ | |
+ // convert decoded ucs4 to utf8 string | |
+ foreach ($decoded as $key => $value) { | |
+ if ($value < 128) { | |
+ $decoded[$key] = chr($value); | |
+ } elseif ($value < (1 << 11)) { | |
+ $decoded[$key] = chr(192 + ($value >> 6)); | |
+ $decoded[$key] .= chr(128 + ($value & 63)); | |
+ } elseif ($value < (1 << 16)) { | |
+ $decoded[$key] = chr(224 + ($value >> 12)); | |
+ $decoded[$key] .= chr(128 + (($value >> 6) & 63)); | |
+ $decoded[$key] .= chr(128 + ($value & 63)); | |
+ } elseif ($value < (1 << 21)) { | |
+ $decoded[$key] = chr(240 + ($value >> 18)); | |
+ $decoded[$key] .= chr(128 + (($value >> 12) & 63)); | |
+ $decoded[$key] .= chr(128 + (($value >> 6) & 63)); | |
+ $decoded[$key] .= chr(128 + ($value & 63)); | |
+ } else { | |
+ $this->_error(self::CANNOT_DECODE_PUNYCODE); | |
+ return false; | |
+ } | |
+ } | |
+ | |
+ return implode($decoded); | |
+ } | |
+ | |
+ /** | |
+ * Returns true if any DNS records corresponding to a given Internet host are found. | |
+ * Returns false if no DNS records were found or if an error occurred. | |
+ * Checks A-Record. | |
+ * | |
+ * @param string $hostName | |
+ * | |
+ * @return bool | |
+ */ | |
+ protected function checkDnsRecords($hostName) | |
+ { | |
+ if (function_exists('idn_to_ascii')) { | |
+ $result = checkdnsrr(idn_to_ascii($hostName), 'A'); | |
+ } else { | |
+ $idn = new Net_IDNA2(); | |
+ $result = checkdnsrr($idn->encode($hostName), 'A'); | |
+ } | |
+ | |
+ return $result; | |
+ } | |
+} | |
diff --git a/app/design/adminhtml/default/default/layout/admin.xml b/app/design/adminhtml/default/default/layout/admin.xml | |
index 7e5ee38..dbddd26 100644 | |
--- a/app/design/adminhtml/default/default/layout/admin.xml | |
+++ b/app/design/adminhtml/default/default/layout/admin.xml | |
@@ -71,6 +71,9 @@ | |
</reference> | |
</adminhtml_permissions_role_editrole> | |
<adminhtml_system_config_edit> | |
+ <reference name="content"> | |
+ <block type="adminhtml/notification_curl" name="notification_curl" as="notification_curl" template="notification/curl.phtml"/> | |
+ </reference> | |
<reference name="left"> | |
<block type="adminhtml/system_config_switcher" name="adminhtml.system.config.switcher" before="-"/> | |
</reference> | |
diff --git a/app/design/adminhtml/default/default/template/backup/dialogs.phtml b/app/design/adminhtml/default/default/template/backup/dialogs.phtml | |
index b76d198..adde025 100644 | |
--- a/app/design/adminhtml/default/default/template/backup/dialogs.phtml | |
+++ b/app/design/adminhtml/default/default/template/backup/dialogs.phtml | |
@@ -120,7 +120,7 @@ | |
<table class="form-list" cellspacing="0"> | |
<tr> | |
<td style="padding-right: 8px;"><label for="password" class="nobr"><?php echo $this->__('User Password')?> <span class="required">*</span></label></td> | |
- <td><input type="password" name="password" id="password" class="required-entry"></td> | |
+ <td><input type="password" name="password" id="password" class="required-entry" autocomplete="off"></td> | |
</tr> | |
<tr> | |
<td> </td> | |
@@ -151,7 +151,7 @@ | |
</tr> | |
<tr> | |
<td class="label"><label for="ftp_pass"><?php echo $this->__('FTP Password')?> <span class="required">*</span></label></td> | |
- <td class="value"><input type="password" name="ftp_pass" id="ftp_pass"></td> | |
+ <td class="value"><input type="password" name="ftp_pass" id="ftp_pass" autocomplete="off"></td> | |
</tr> | |
<tr> | |
<td class="label"><label for="ftp_path"><?php echo $this->__('Magento root directory')?></label></td> | |
diff --git a/app/design/adminhtml/default/default/template/catalog/category/tree.phtml b/app/design/adminhtml/default/default/template/catalog/category/tree.phtml | |
index ee09713..fdf45b3 100644 | |
--- a/app/design/adminhtml/default/default/template/catalog/category/tree.phtml | |
+++ b/app/design/adminhtml/default/default/template/catalog/category/tree.phtml | |
@@ -220,12 +220,12 @@ function reRenderTree(event, switcher) | |
// load from cache | |
// load from ajax | |
- new Ajax.Request(url + (url.match(new RegExp('\\?')) ? '&isAjax=true' : '?isAjax=true' ), { | |
- parameters : {store: newStoreId, form_key: FORM_KEY}, | |
+ new Ajax.Request(url, { | |
+ parameters : {store: newStoreId, form_key: FORM_KEY, isAjax: 1}, | |
method : 'post', | |
onComplete : function(transport) { | |
- var response = eval('(' + transport.responseText + ')'); | |
- if (!response['parameters']) { | |
+ var response = transport.responseJSON || transport.responseText.evalJSON(true) || {}; | |
+ if (!response.parameters) { | |
return false; | |
} | |
@@ -242,7 +242,7 @@ function reRenderTree(event, switcher) | |
function _renderNewTree(config, storeParam) | |
{ | |
if (!config) { | |
- var config = defaultLoadTreeParams; | |
+ config = defaultLoadTreeParams; | |
} | |
if (tree) { | |
tree.purgeListeners(); | |
@@ -442,7 +442,7 @@ function categoryMove(obj) | |
if(o.responseText==='SUCCESS'){ | |
categoryForm.refreshPath(); | |
} else { | |
- alert(o.responseText); | |
+ alert(o.responseText.stripTags().toString()); | |
location.reload(); | |
} | |
} | |
diff --git a/app/design/adminhtml/default/default/template/catalog/product/edit/price/group.phtml b/app/design/adminhtml/default/default/template/catalog/product/edit/price/group.phtml | |
index d82e499..cb7af60 100644 | |
--- a/app/design/adminhtml/default/default/template/catalog/product/edit/price/group.phtml | |
+++ b/app/design/adminhtml/default/default/template/catalog/product/edit/price/group.phtml | |
@@ -75,7 +75,8 @@ var groupPriceRowTemplate = '<tr>' | |
+ '<option value="<?php echo $_groupId; ?>"><?php echo $this->jsQuoteEscape($this->escapeHtml($_groupName)); ?></option>' | |
<?php endforeach; ?> | |
+ '</select></td>' | |
- + '<td><input class="<?php echo $_htmlClass; ?> required-entry <?php echo $_priceValueValidation; ?>" type="text" name="<?php echo $_htmlName; ?>[{{index}}][price]" value="{{price}}" id="group_price_row_{{index}}_price" /></td>' | |
+ + '<td><input class="<?php echo $_htmlClass; ?> required-entry <?php echo $_priceValueValidation; ?>" type="text" name="<?php echo $_htmlName; ?>[{{index}}][price]" value="{{price}}" id="group_price_row_{{index}}_price" />' | |
+ + '<input type="hidden" name="<?php echo $_htmlName; ?>[{{index}}][is_percent]" value="<?php if ($this->getIsPercent()) : ?>1<?php else: ?>0<?php endif;?>" id="group_price_row_{{index}}_is_percent" /></td>' | |
+ '<td class="last"><input type="hidden" name="<?php echo $_htmlName; ?>[{{index}}][delete]" class="delete" value="" id="group_price_row_{{index}}_delete" />' | |
+ '<button title="<?php echo $this->jsQuoteEscape(Mage::helper('catalog')->__('Delete Group Price')); ?>" type="button" class="scalable delete icon-btn delete-product-option" id="group_price_row_{{index}}_delete_button" onclick="return groupPriceControl.deleteItem(event);">' | |
+ '<span><?php echo $this->jsQuoteEscape(Mage::helper('catalog')->__('Delete')); ?></span></button></td>' | |
diff --git a/app/design/adminhtml/default/default/template/connect/extension/custom/package.phtml b/app/design/adminhtml/default/default/template/connect/extension/custom/package.phtml | |
index 63c220a..e14b786 100644 | |
--- a/app/design/adminhtml/default/default/template/connect/extension/custom/package.phtml | |
+++ b/app/design/adminhtml/default/default/template/connect/extension/custom/package.phtml | |
@@ -44,10 +44,10 @@ function showHideFiles(button, selector, filesClass) | |
function loadPackage() | |
{ | |
- var package = prompt('Please enter package name'); | |
- if (!package) return false; | |
+ var packageName = prompt('Please enter package name'); | |
+ if (!packageName) return false; | |
var url = '<?php echo $this->getUrl('*/*/load') ?>'; | |
- location.href = url+(url.indexOf('?')==-1 ? '?':'&')+'id='+package; | |
+ location.href = encodeURI(url + ((url.indexOf('?') == -1) ? '?':'&') + 'id=' + packageName); | |
} | |
function saveAsPackage() | |
diff --git a/app/design/adminhtml/default/default/template/login.phtml b/app/design/adminhtml/default/default/template/login.phtml | |
index e709852..9633284 100644 | |
--- a/app/design/adminhtml/default/default/template/login.phtml | |
+++ b/app/design/adminhtml/default/default/template/login.phtml | |
@@ -59,7 +59,7 @@ | |
<div class="input-box input-right"><label for="login"><?php echo Mage::helper('adminhtml')->__('Password:') ?></label><br /> | |
<!-- This is a dummy hidden field to trick firefox from auto filling the password --> | |
<input type="text" class="input-text no-display" name="dummy" id="dummy" /> | |
- <input type="password" id="login" name="login[password]" class="required-entry input-text" value="" /></div> | |
+ <input type="password" id="login" name="login[password]" class="required-entry input-text" value="" autocomplete="off" /></div> | |
<?php echo $this->getChildHtml('form.additional.info'); ?> | |
<div class="clear"></div> | |
<div class="form-buttons"> | |
diff --git a/app/design/adminhtml/default/default/template/notification/curl.phtml b/app/design/adminhtml/default/default/template/notification/curl.phtml | |
new file mode 100644 | |
index 0000000..5c7fd64 | |
--- /dev/null | |
+++ b/app/design/adminhtml/default/default/template/notification/curl.phtml | |
@@ -0,0 +1,36 @@ | |
+<?php | |
+/** | |
+ * Magento | |
+ * | |
+ * NOTICE OF LICENSE | |
+ * | |
+ * This source file is subject to the Academic Free License (AFL 3.0) | |
+ * that is bundled with this package in the file LICENSE_AFL.txt. | |
+ * It is also available through the world-wide-web at this URL: | |
+ * http://opensource.org/licenses/afl-3.0.php | |
+ * If you did not receive a copy of the license and are unable to | |
+ * obtain it through the world-wide-web, please send an email | |
+ * to [email protected] so we can send you a copy immediately. | |
+ * | |
+ * DISCLAIMER | |
+ * | |
+ * Do not edit or add to this file if you wish to upgrade Magento to newer | |
+ * versions in the future. If you wish to customize Magento for your | |
+ * needs please refer to http://www.magento.com for more information. | |
+ * | |
+ * @category design | |
+ * @package default_default | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
+ */ | |
+/** | |
+ * @see Mage_Adminhtml_Block_Notification_Curl | |
+ */ | |
+?> | |
+<div> | |
+ <ul class="messages"> | |
+ <li class="notice-msg"> | |
+ <?php echo $this->getMessage(); ?> | |
+ </li> | |
+ </ul> | |
+</div> | |
diff --git a/app/design/adminhtml/default/default/template/oauth/authorize/form/login-simple.phtml b/app/design/adminhtml/default/default/template/oauth/authorize/form/login-simple.phtml | |
index 605d9b2..e212fc0 100644 | |
--- a/app/design/adminhtml/default/default/template/oauth/authorize/form/login-simple.phtml | |
+++ b/app/design/adminhtml/default/default/template/oauth/authorize/form/login-simple.phtml | |
@@ -59,7 +59,7 @@ | |
<em class="required">*</em> <?php echo $this->__('Password') ?> | |
</label> | |
<input type="password" id="login" name="login[password]" class="required-entry input-text" | |
- value=""/></div> | |
+ value="" autocomplete="off"/></div> | |
<div class="clear"></div> | |
<div class="form-buttons"> | |
<button type="submit" class="form-button" | |
diff --git a/app/design/adminhtml/default/default/template/oauth/authorize/form/login.phtml b/app/design/adminhtml/default/default/template/oauth/authorize/form/login.phtml | |
index 952806c..1232346 100644 | |
--- a/app/design/adminhtml/default/default/template/oauth/authorize/form/login.phtml | |
+++ b/app/design/adminhtml/default/default/template/oauth/authorize/form/login.phtml | |
@@ -46,7 +46,7 @@ | |
<div class="input-box input-left"><label for="username"><?php echo $this->__('User Name:') ?></label><br/> | |
<input type="text" id="username" name="login[username]" value="" class="required-entry input-text" /></div> | |
<div class="input-box input-right"><label for="login"><?php echo $this->__('Password:') ?></label><br /> | |
- <input type="password" id="login" name="login[password]" class="required-entry input-text" value="" /></div> | |
+ <input type="password" id="login" name="login[password]" class="required-entry input-text" value="" autocomplete="off"/></div> | |
<div class="clear"></div> | |
<div class="form-buttons"> | |
<button type="submit" class="form-button" title="<?php echo $this->quoteEscape($this->__('Login')) ?>" ><?php echo $this->__('Login') ?></button> | |
diff --git a/app/design/adminhtml/default/default/template/promo/salesrulejs.phtml b/app/design/adminhtml/default/default/template/promo/salesrulejs.phtml | |
index 66fbfc2..eb1d2c1 100644 | |
--- a/app/design/adminhtml/default/default/template/promo/salesrulejs.phtml | |
+++ b/app/design/adminhtml/default/default/template/promo/salesrulejs.phtml | |
@@ -91,10 +91,8 @@ function generateCouponCodes(idPrefix, generateUrl, grid) { | |
parameters :params, | |
method :'post', | |
onComplete : function (transport, param){ | |
- var response = false; | |
- if (transport && transport.responseText) { | |
- response = eval('(' + transport.responseText + ')'); | |
- } | |
+ var response = transport.responseJSON || transport.responseText.evalJSON(true) || {}; | |
+ | |
if (couponCodesGrid) { | |
couponCodesGrid.reload(); | |
} | |
@@ -102,7 +100,7 @@ function generateCouponCodes(idPrefix, generateUrl, grid) { | |
$('messages').update(response.messages); | |
} | |
if (response && response.error) { | |
- alert(response.error); | |
+ alert(response.error.stripTags().toString()); | |
} | |
} | |
}); | |
diff --git a/app/design/adminhtml/default/default/template/resetforgottenpassword.phtml b/app/design/adminhtml/default/default/template/resetforgottenpassword.phtml | |
index db55943..f4f3b51 100644 | |
--- a/app/design/adminhtml/default/default/template/resetforgottenpassword.phtml | |
+++ b/app/design/adminhtml/default/default/template/resetforgottenpassword.phtml | |
@@ -53,12 +53,12 @@ | |
<div class="input-box f-left"> | |
<label for="password"><em class="required">*</em> <?php echo $this->__('New Password'); ?></label> | |
<br /> | |
- <input type="password" class="input-text required-entry validate-admin-password" name="password" id="password" /> | |
+ <input type="password" class="input-text required-entry validate-admin-password" name="password" id="password" autocomplete="off"/> | |
</div> | |
<div class="input-box f-right"> | |
<label for="confirmation"><em class="required">*</em> <?php echo $this->__('Confirm New Password'); ?></label> | |
<br /> | |
- <input type="password" class="input-text required-entry validate-cpassword" name="confirmation" id="confirmation" /> | |
+ <input type="password" class="input-text required-entry validate-cpassword" name="confirmation" id="confirmation" autocomplete="off"/> | |
</div> | |
<div class="clear"></div> | |
<div class="form-buttons"> | |
diff --git a/app/design/adminhtml/default/default/template/system/config/system/storage/media/synchronize.phtml b/app/design/adminhtml/default/default/template/system/config/system/storage/media/synchronize.phtml | |
index e1536f2..52a71c7 100644 | |
--- a/app/design/adminhtml/default/default/template/system/config/system/storage/media/synchronize.phtml | |
+++ b/app/design/adminhtml/default/default/template/system/config/system/storage/media/synchronize.phtml | |
@@ -120,7 +120,7 @@ | |
$('system_media_storage_configuration_media_database').observe('change', checkButtonState); | |
function checkStatus() { | |
- u = new Ajax.PeriodicalUpdater('', '<?php echo $this->getAjaxStatusUpdateUrl() ?>', { | |
+ var u = new Ajax.PeriodicalUpdater('', '<?php echo $this->getAjaxStatusUpdateUrl() ?>', { | |
method: 'get', | |
frequency: 5, | |
loaderArea: false, | |
@@ -129,7 +129,7 @@ | |
var response; | |
try { | |
- response = eval('(' + transport.responseText + ')'); | |
+ response = transport.responseJSON || transport.responseText.evalJSON(true) || {}; | |
if (response.state == '<?php echo Mage_Core_Model_File_Storage_Flag::STATE_RUNNING ?>' | |
&& response.message | |
) { | |
diff --git a/app/design/frontend/base/default/layout/catalog.xml b/app/design/frontend/base/default/layout/catalog.xml | |
index 043bf2e..a8c0922 100644 | |
--- a/app/design/frontend/base/default/layout/catalog.xml | |
+++ b/app/design/frontend/base/default/layout/catalog.xml | |
@@ -156,6 +156,7 @@ Compare products page | |
<reference name="head"> | |
<action method="addJs"><script>scriptaculous/scriptaculous.js</script></action> | |
<action method="addJs"><script>varien/product.js</script></action> | |
+ <action method="addJs"><script>varien/product_options.js</script></action> | |
</reference> | |
<reference name="content"> | |
<block type="catalog/product_compare_list" name="catalog.compare.list" template="catalog/product/compare/list.phtml"/> | |
@@ -180,6 +181,7 @@ Product view | |
</reference> | |
<reference name="head"> | |
<action method="addJs"><script>varien/product.js</script></action> | |
+ <action method="addJs"><script>varien/product_options.js</script></action> | |
<action method="addJs"><script>varien/configurable.js</script></action> | |
<action method="addItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name><params/><!--<if/><condition>can_load_calendar_js</condition>--></action> | |
@@ -320,6 +322,7 @@ Product send to friend | |
</reference> | |
<reference name="head"> | |
<action method="addJs"><script>varien/product.js</script></action> | |
+ <action method="addJs"><script>varien/product_options.js</script></action> | |
</reference> | |
<reference name="content"> | |
<block type="catalog/product_send" name="product.send" template="catalog/product/send.phtml"> | |
diff --git a/app/design/frontend/base/default/layout/review.xml b/app/design/frontend/base/default/layout/review.xml | |
index 03b8879..ccf6809 100644 | |
--- a/app/design/frontend/base/default/layout/review.xml | |
+++ b/app/design/frontend/base/default/layout/review.xml | |
@@ -72,6 +72,7 @@ Product reviews page | |
</reference> | |
<reference name="head"> | |
<action method="addJs"><script>varien/product.js</script></action> | |
+ <action method="addJs"><script>varien/product_options.js</script></action> | |
<action method="addJs"><script>varien/configurable.js</script></action> | |
</reference> | |
<reference name="content"> | |
diff --git a/app/design/frontend/base/default/layout/sendfriend.xml b/app/design/frontend/base/default/layout/sendfriend.xml | |
index 199e942..73692ed 100644 | |
--- a/app/design/frontend/base/default/layout/sendfriend.xml | |
+++ b/app/design/frontend/base/default/layout/sendfriend.xml | |
@@ -33,6 +33,7 @@ | |
</reference> | |
<reference name="head"> | |
<action method="addJs"><script>varien/product.js</script></action> | |
+ <action method="addJs"><script>varien/product_options.js</script></action> | |
</reference> | |
<reference name="content"> | |
<block type="sendfriend/send" name="sendfriend.send" template="sendfriend/send.phtml" /> | |
diff --git a/app/design/frontend/base/default/template/checkout/onepage/payment.phtml b/app/design/frontend/base/default/template/checkout/onepage/payment.phtml | |
index bf87114..769bcdd 100644 | |
--- a/app/design/frontend/base/default/template/checkout/onepage/payment.phtml | |
+++ b/app/design/frontend/base/default/template/checkout/onepage/payment.phtml | |
@@ -28,6 +28,7 @@ | |
//<![CDATA[ | |
var quoteBaseGrandTotal = <?php echo (float)$this->getQuoteBaseGrandTotal(); ?>; | |
var checkQuoteBaseGrandTotal = quoteBaseGrandTotal; | |
+ var quoteGrandTotalClean = quoteBaseGrandTotal; | |
var payment = new Payment('co-payment-form', '<?php echo $this->getUrl('checkout/onepage/savePayment') ?>'); | |
var lastPrice; | |
//]]> | |
diff --git a/app/design/frontend/base/default/template/customer/form/edit.phtml b/app/design/frontend/base/default/template/customer/form/edit.phtml | |
index bea42b6..0c2bdb3 100644 | |
--- a/app/design/frontend/base/default/template/customer/form/edit.phtml | |
+++ b/app/design/frontend/base/default/template/customer/form/edit.phtml | |
@@ -54,6 +54,14 @@ | |
<?php if ($_gender->isEnabled()): ?> | |
<li><?php echo $_gender->setGender($this->getCustomer()->getGender())->toHtml() ?></li> | |
<?php endif ?> | |
+ <li> | |
+ <label for="current_password" class="required"><em>*</em><?php echo Mage::helper('core')->quoteEscape($this->__('Current Password')) ?></label> | |
+ <div class="input-box"> | |
+ <!-- This is a dummy hidden field to trick firefox from auto filling the password --> | |
+ <input type="text" class="input-text no-display" name="dummy" id="dummy" /> | |
+ <input type="password" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Current Password')) ?>" class="input-text required-entry" name="current_password" id="current_password" /> | |
+ </div> | |
+ </li> | |
<li class="control"> | |
<input type="checkbox" name="change_password" id="change_password" value="1" onclick="setPasswordForm(this.checked)" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Change Password')) ?>"<?php if($this->getCustomer()->getChangePassword()==1): ?> checked="checked"<?php endif; ?> class="checkbox" /><label for="change_password"><?php echo $this->__('Change Password') ?></label> | |
</li> | |
@@ -62,25 +70,17 @@ | |
<div class="fieldset" style="display:none;"> | |
<h2 class="legend"><?php echo $this->__('Change Password') ?></h2> | |
<ul class="form-list"> | |
- <li> | |
- <label for="current_password" class="required"><em>*</em><?php echo $this->__('Current Password') ?></label> | |
- <div class="input-box"> | |
- <!-- This is a dummy hidden field to trick firefox from auto filling the password --> | |
- <input type="text" class="input-text no-display" name="dummy" id="dummy" /> | |
- <input type="password" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Current Password')) ?>" class="input-text" name="current_password" id="current_password" /> | |
- </div> | |
- </li> | |
<li class="fields"> | |
<div class="field"> | |
<label for="password" class="required"><em>*</em><?php echo $this->__('New Password') ?></label> | |
<div class="input-box"> | |
- <input type="password" title="<?php echo Mage::helper('core')->quoteEscape($this->__('New Password')) ?>" class="input-text validate-password" name="password" id="password" /> | |
+ <input type="password" title="<?php echo Mage::helper('core')->quoteEscape($this->__('New Password')) ?>" class="input-text required-entry validate-password" name="password" id="password" /> | |
</div> | |
</div> | |
<div class="field"> | |
<label for="confirmation" class="required"><em>*</em><?php echo $this->__('Confirm New Password') ?></label> | |
<div class="input-box"> | |
- <input type="password" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Confirm New Password')) ?>" class="input-text validate-cpassword" name="confirmation" id="confirmation" /> | |
+ <input type="password" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Confirm New Password')) ?>" class="input-text required-entry validate-cpassword" name="confirmation" id="confirmation" /> | |
</div> | |
</div> | |
</li> | |
@@ -96,18 +96,7 @@ | |
//<![CDATA[ | |
var dataForm = new VarienForm('form-validate', true); | |
function setPasswordForm(arg){ | |
- if(arg){ | |
- $('current_password').up(3).show(); | |
- $('current_password').addClassName('required-entry'); | |
- $('password').addClassName('required-entry'); | |
- $('confirmation').addClassName('required-entry'); | |
- | |
- }else{ | |
- $('current_password').up(3).hide(); | |
- $('current_password').removeClassName('required-entry'); | |
- $('password').removeClassName('required-entry'); | |
- $('confirmation').removeClassName('required-entry'); | |
- } | |
+ $('password').up('.fieldset')[arg ? 'show': 'hide'](); | |
} | |
<?php if($this->getCustomer()->getChangePassword()): ?> | |
diff --git a/app/design/frontend/base/default/template/paypal/express/review.phtml b/app/design/frontend/base/default/template/paypal/express/review.phtml | |
index 36aa282..9f5ad53 100644 | |
--- a/app/design/frontend/base/default/template/paypal/express/review.phtml | |
+++ b/app/design/frontend/base/default/template/paypal/express/review.phtml | |
@@ -133,11 +133,7 @@ | |
new Ajax.Request(this.form.action, { | |
parameters: {isAjax: 1, method: 'POST'}, | |
onSuccess: function(transport) { | |
- try{ | |
- response = eval('(' + transport.responseText + ')'); | |
- } catch (e) { | |
- response = {}; | |
- } | |
+ var response = transport.responseJSON || transport.responseText.evalJSON(true) || {}; | |
if (response.redirect) { | |
setLocation(response.redirect); | |
return; | |
@@ -147,12 +143,12 @@ | |
return; | |
} else { | |
var msg = response.error_messages; | |
- if (typeof(msg)=='object') { | |
- msg = msg.join("\n"); | |
+ if (Object.isArray(msg)) { | |
+ msg = msg.join("\n").stripTags().toString(); | |
} | |
if (msg) { | |
$('review-please-wait').hide(); | |
- alert(msg); | |
+ alert(msg.stripTags().toString()); | |
return; | |
} | |
} | |
diff --git a/app/design/frontend/base/default/template/paypal/hss/js.phtml b/app/design/frontend/base/default/template/paypal/hss/js.phtml | |
index 721d3a3..88db4ad 100644 | |
--- a/app/design/frontend/base/default/template/paypal/hss/js.phtml | |
+++ b/app/design/frontend/base/default/template/paypal/hss/js.phtml | |
@@ -45,13 +45,8 @@ Review.prototype.save = function() { | |
method:'post', | |
parameters:params, | |
onComplete: function(transport) { | |
- if (transport && transport.responseText) { | |
- try{ | |
- response = eval('(' + transport.responseText + ')'); | |
- } | |
- catch (e) { | |
- response = {}; | |
- } | |
+ if (transport) { | |
+ var response = transport.responseJSON || transport.responseText.evalJSON(true) || {}; | |
if (response.error_messages) { | |
checkout.setLoadWaiting(false); | |
} | |
diff --git a/app/design/frontend/base/default/template/sales/guest/form.phtml b/app/design/frontend/base/default/template/sales/guest/form.phtml | |
index 4f6e5fa..2c22341 100644 | |
--- a/app/design/frontend/base/default/template/sales/guest/form.phtml | |
+++ b/app/design/frontend/base/default/template/sales/guest/form.phtml | |
@@ -61,8 +61,8 @@ | |
</div> | |
<div class="input-box"> | |
<select name="oar_type" id="quick_search_type_id" class="select guest-select" title="" onchange="showIdentifyBlock(this.value);"> | |
- <option value="email">Email Address</option> | |
- <option value="zip">ZIP Code</option> | |
+ <option value="email"><?php echo Mage::helper('sales')->__('Email Address') ?></option> | |
+ <option value="zip"><?php echo Mage::helper('sales')->__('ZIP Code') ?></option> | |
</select> | |
</div> | |
</li> | |
diff --git a/app/design/frontend/base/default/template/sales/widget/guest/form.phtml b/app/design/frontend/base/default/template/sales/widget/guest/form.phtml | |
index 143f2c4..de8f66f 100644 | |
--- a/app/design/frontend/base/default/template/sales/widget/guest/form.phtml | |
+++ b/app/design/frontend/base/default/template/sales/widget/guest/form.phtml | |
@@ -40,8 +40,8 @@ | |
<label class="required"><?php echo Mage::helper('sales')->__('Find Order By:') ?></label> | |
<div class="input-box"> | |
<select name="oar_type" id="quick_search_type_id" class="select" title="" onchange="showIdentifyBlock(this.value);"> | |
- <option value="email">Email Address</option> | |
- <option value="zip">ZIP Code</option> | |
+ <option value="email"><?php echo Mage::helper('sales')->__('Email Address') ?></option> | |
+ <option value="zip"><?php echo Mage::helper('sales')->__('ZIP Code') ?></option> | |
</select> | |
</div> | |
</li> | |
diff --git a/app/design/frontend/default/blank/etc/theme.xml b/app/design/frontend/default/blank/etc/theme.xml | |
index 55a3359..f48e956 100644 | |
--- a/app/design/frontend/default/blank/etc/theme.xml | |
+++ b/app/design/frontend/default/blank/etc/theme.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_blank | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
--> | |
diff --git a/app/design/frontend/default/blank/etc/widget.xml b/app/design/frontend/default/blank/etc/widget.xml | |
index 70d479d..adc8f59 100755 | |
--- a/app/design/frontend/default/blank/etc/widget.xml | |
+++ b/app/design/frontend/default/blank/etc/widget.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_blank | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
--> | |
diff --git a/app/design/frontend/default/iphone/etc/theme.xml b/app/design/frontend/default/iphone/etc/theme.xml | |
index 2df85f8..8435cdb 100644 | |
--- a/app/design/frontend/default/iphone/etc/theme.xml | |
+++ b/app/design/frontend/default/iphone/etc/theme.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
--> | |
diff --git a/app/design/frontend/default/iphone/etc/widget.xml b/app/design/frontend/default/iphone/etc/widget.xml | |
index e34346d..990a61d 100755 | |
--- a/app/design/frontend/default/iphone/etc/widget.xml | |
+++ b/app/design/frontend/default/iphone/etc/widget.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
--> | |
diff --git a/app/design/frontend/default/iphone/layout/bundle.xml b/app/design/frontend/default/iphone/layout/bundle.xml | |
index 5c5f24a..07fd8bc 100644 | |
--- a/app/design/frontend/default/iphone/layout/bundle.xml | |
+++ b/app/design/frontend/default/iphone/layout/bundle.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/app/design/frontend/default/iphone/layout/catalog.xml b/app/design/frontend/default/iphone/layout/catalog.xml | |
index be61b61..326a9d5 100755 | |
--- a/app/design/frontend/default/iphone/layout/catalog.xml | |
+++ b/app/design/frontend/default/iphone/layout/catalog.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
@@ -134,6 +134,7 @@ Compare products page | |
<reference name="head"> | |
<action method="addJs"><script>scriptaculous/scriptaculous.js</script></action> | |
<action method="addJs"><script>varien/product.js</script></action> | |
+ <action method="addJs"><script>varien/product_options.js</script></action> | |
</reference> | |
<reference name="content"> | |
<block type="catalog/product_compare_list" name="catalog.compare.list" template="catalog/product/compare/list.phtml"/> | |
@@ -158,6 +159,7 @@ Product view | |
</reference> | |
<reference name="head"> | |
<action method="addJs"><script>varien/product.js</script></action> | |
+ <action method="addJs"><script>varien/product_options.js</script></action> | |
<action method="addJs"><script>varien/configurable.js</script></action> | |
<action method="addItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name><params/><!--<if/><condition>can_load_calendar_js</condition>--></action> | |
@@ -295,6 +297,7 @@ Product send to friend | |
</reference> | |
<reference name="head"> | |
<action method="addJs"><script>varien/product.js</script></action> | |
+ <action method="addJs"><script>varien/product_options.js</script></action> | |
</reference> | |
<reference name="content"> | |
<block type="catalog/product_send" name="product.send" template="catalog/product/send.phtml"> | |
diff --git a/app/design/frontend/default/iphone/layout/catalogsearch.xml b/app/design/frontend/default/iphone/layout/catalogsearch.xml | |
index 1b2b522..1f3b9a5 100644 | |
--- a/app/design/frontend/default/iphone/layout/catalogsearch.xml | |
+++ b/app/design/frontend/default/iphone/layout/catalogsearch.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/app/design/frontend/default/iphone/layout/checkout.xml b/app/design/frontend/default/iphone/layout/checkout.xml | |
index b59a850..90956a6 100755 | |
--- a/app/design/frontend/default/iphone/layout/checkout.xml | |
+++ b/app/design/frontend/default/iphone/layout/checkout.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/app/design/frontend/default/iphone/layout/cms.xml b/app/design/frontend/default/iphone/layout/cms.xml | |
index 3ccb69f..22eef36 100755 | |
--- a/app/design/frontend/default/iphone/layout/cms.xml | |
+++ b/app/design/frontend/default/iphone/layout/cms.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
--> | |
diff --git a/app/design/frontend/default/iphone/layout/contacts.xml b/app/design/frontend/default/iphone/layout/contacts.xml | |
index 893f4e3..ccd37c6 100644 | |
--- a/app/design/frontend/default/iphone/layout/contacts.xml | |
+++ b/app/design/frontend/default/iphone/layout/contacts.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
--> | |
diff --git a/app/design/frontend/default/iphone/layout/customer.xml b/app/design/frontend/default/iphone/layout/customer.xml | |
index 2da07a4..cde0cc0 100755 | |
--- a/app/design/frontend/default/iphone/layout/customer.xml | |
+++ b/app/design/frontend/default/iphone/layout/customer.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/app/design/frontend/default/iphone/layout/newsletter.xml b/app/design/frontend/default/iphone/layout/newsletter.xml | |
index 2cfe981..6ea40e7 100644 | |
--- a/app/design/frontend/default/iphone/layout/newsletter.xml | |
+++ b/app/design/frontend/default/iphone/layout/newsletter.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/app/design/frontend/default/iphone/layout/page.xml b/app/design/frontend/default/iphone/layout/page.xml | |
index 6cc0df0..1e78346 100755 | |
--- a/app/design/frontend/default/iphone/layout/page.xml | |
+++ b/app/design/frontend/default/iphone/layout/page.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
--> | |
diff --git a/app/design/frontend/default/iphone/layout/review.xml b/app/design/frontend/default/iphone/layout/review.xml | |
index 3493829..1af6552 100755 | |
--- a/app/design/frontend/default/iphone/layout/review.xml | |
+++ b/app/design/frontend/default/iphone/layout/review.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
@@ -73,6 +73,7 @@ Product reviews page | |
</reference> | |
<reference name="head"> | |
<action method="addJs"><script>varien/product.js</script></action> | |
+ <action method="addJs"><script>varien/product_options.js</script></action> | |
<action method="addJs"><script>varien/configurable.js</script></action> | |
</reference> | |
<reference name="content"> | |
diff --git a/app/design/frontend/default/iphone/layout/rss.xml b/app/design/frontend/default/iphone/layout/rss.xml | |
index 39bb6ce..1a6367d 100644 | |
--- a/app/design/frontend/default/iphone/layout/rss.xml | |
+++ b/app/design/frontend/default/iphone/layout/rss.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
--> | |
diff --git a/app/design/frontend/default/iphone/layout/sales.xml b/app/design/frontend/default/iphone/layout/sales.xml | |
index 2347962..51d5672 100644 | |
--- a/app/design/frontend/default/iphone/layout/sales.xml | |
+++ b/app/design/frontend/default/iphone/layout/sales.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/app/design/frontend/default/iphone/layout/sales/billing_agreement.xml b/app/design/frontend/default/iphone/layout/sales/billing_agreement.xml | |
index 2c7b170..9788df0 100644 | |
--- a/app/design/frontend/default/iphone/layout/sales/billing_agreement.xml | |
+++ b/app/design/frontend/default/iphone/layout/sales/billing_agreement.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/app/design/frontend/default/iphone/layout/sales/recurring_profile.xml b/app/design/frontend/default/iphone/layout/sales/recurring_profile.xml | |
index c0439d6..359e00a 100644 | |
--- a/app/design/frontend/default/iphone/layout/sales/recurring_profile.xml | |
+++ b/app/design/frontend/default/iphone/layout/sales/recurring_profile.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/app/design/frontend/default/iphone/layout/sendfriend.xml b/app/design/frontend/default/iphone/layout/sendfriend.xml | |
index bdfb8b3..16e55e4 100644 | |
--- a/app/design/frontend/default/iphone/layout/sendfriend.xml | |
+++ b/app/design/frontend/default/iphone/layout/sendfriend.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
--> | |
@@ -33,6 +33,7 @@ | |
</reference> | |
<reference name="head"> | |
<action method="addJs"><script>varien/product.js</script></action> | |
+ <action method="addJs"><script>varien/product_options.js</script></action> | |
</reference> | |
<reference name="content"> | |
<block type="sendfriend/send" name="sendfriend.send" template="sendfriend/send.phtml" /> | |
diff --git a/app/design/frontend/default/iphone/layout/tag.xml b/app/design/frontend/default/iphone/layout/tag.xml | |
index f72fcc8..c690f7c 100755 | |
--- a/app/design/frontend/default/iphone/layout/tag.xml | |
+++ b/app/design/frontend/default/iphone/layout/tag.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/app/design/frontend/default/iphone/layout/wishlist.xml b/app/design/frontend/default/iphone/layout/wishlist.xml | |
index f95270b..970c630 100644 | |
--- a/app/design/frontend/default/iphone/layout/wishlist.xml | |
+++ b/app/design/frontend/default/iphone/layout/wishlist.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/app/design/frontend/default/iphone/template/bundle/catalog/product/view/type/bundle.phtml b/app/design/frontend/default/iphone/template/bundle/catalog/product/view/type/bundle.phtml | |
index 8008255..04df5a0 100644 | |
--- a/app/design/frontend/default/iphone/template/bundle/catalog/product/view/type/bundle.phtml | |
+++ b/app/design/frontend/default/iphone/template/bundle/catalog/product/view/type/bundle.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/app/design/frontend/default/iphone/template/bundle/sales/order/items/renderer.phtml b/app/design/frontend/default/iphone/template/bundle/sales/order/items/renderer.phtml | |
index a9c1580..1f713b9 100644 | |
--- a/app/design/frontend/default/iphone/template/bundle/sales/order/items/renderer.phtml | |
+++ b/app/design/frontend/default/iphone/template/bundle/sales/order/items/renderer.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/catalog/category/view.phtml b/app/design/frontend/default/iphone/template/catalog/category/view.phtml | |
index 9019ab8..63b8b46 100644 | |
--- a/app/design/frontend/default/iphone/template/catalog/category/view.phtml | |
+++ b/app/design/frontend/default/iphone/template/catalog/category/view.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/catalog/layer/view.phtml b/app/design/frontend/default/iphone/template/catalog/layer/view.phtml | |
index 820af4f..e74e2bc 100644 | |
--- a/app/design/frontend/default/iphone/template/catalog/layer/view.phtml | |
+++ b/app/design/frontend/default/iphone/template/catalog/layer/view.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/catalog/navigation/top.phtml b/app/design/frontend/default/iphone/template/catalog/navigation/top.phtml | |
index f67b1b5..cdd26d7 100644 | |
--- a/app/design/frontend/default/iphone/template/catalog/navigation/top.phtml | |
+++ b/app/design/frontend/default/iphone/template/catalog/navigation/top.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/catalog/product/gallery.phtml b/app/design/frontend/default/iphone/template/catalog/product/gallery.phtml | |
index 083f775..69bfbf4 100644 | |
--- a/app/design/frontend/default/iphone/template/catalog/product/gallery.phtml | |
+++ b/app/design/frontend/default/iphone/template/catalog/product/gallery.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/catalog/product/list.phtml b/app/design/frontend/default/iphone/template/catalog/product/list.phtml | |
index c2d3838..adb475c 100644 | |
--- a/app/design/frontend/default/iphone/template/catalog/product/list.phtml | |
+++ b/app/design/frontend/default/iphone/template/catalog/product/list.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/catalog/product/list/toolbar.phtml b/app/design/frontend/default/iphone/template/catalog/product/list/toolbar.phtml | |
index fc16b04..2795607 100755 | |
--- a/app/design/frontend/default/iphone/template/catalog/product/list/toolbar.phtml | |
+++ b/app/design/frontend/default/iphone/template/catalog/product/list/toolbar.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/catalog/product/list/upsell.phtml b/app/design/frontend/default/iphone/template/catalog/product/list/upsell.phtml | |
index f0802f0..aa0d923 100644 | |
--- a/app/design/frontend/default/iphone/template/catalog/product/list/upsell.phtml | |
+++ b/app/design/frontend/default/iphone/template/catalog/product/list/upsell.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/catalog/product/price.phtml b/app/design/frontend/default/iphone/template/catalog/product/price.phtml | |
index 59bfd09..dab502a 100644 | |
--- a/app/design/frontend/default/iphone/template/catalog/product/price.phtml | |
+++ b/app/design/frontend/default/iphone/template/catalog/product/price.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/catalog/product/price_msrp.phtml b/app/design/frontend/default/iphone/template/catalog/product/price_msrp.phtml | |
index 62d8ff0..9071dab 100644 | |
--- a/app/design/frontend/default/iphone/template/catalog/product/price_msrp.phtml | |
+++ b/app/design/frontend/default/iphone/template/catalog/product/price_msrp.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/catalog/product/price_msrp_noform.phtml b/app/design/frontend/default/iphone/template/catalog/product/price_msrp_noform.phtml | |
index 62d8ff0..9071dab 100644 | |
--- a/app/design/frontend/default/iphone/template/catalog/product/price_msrp_noform.phtml | |
+++ b/app/design/frontend/default/iphone/template/catalog/product/price_msrp_noform.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/catalog/product/view.phtml b/app/design/frontend/default/iphone/template/catalog/product/view.phtml | |
index 90424d9..00c9b75 100644 | |
--- a/app/design/frontend/default/iphone/template/catalog/product/view.phtml | |
+++ b/app/design/frontend/default/iphone/template/catalog/product/view.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/app/design/frontend/default/iphone/template/catalog/product/view/addto.phtml b/app/design/frontend/default/iphone/template/catalog/product/view/addto.phtml | |
index 209508f..86dbd3b 100644 | |
--- a/app/design/frontend/default/iphone/template/catalog/product/view/addto.phtml | |
+++ b/app/design/frontend/default/iphone/template/catalog/product/view/addto.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/catalog/product/view/media.phtml b/app/design/frontend/default/iphone/template/catalog/product/view/media.phtml | |
index d6e85d4..3444810 100644 | |
--- a/app/design/frontend/default/iphone/template/catalog/product/view/media.phtml | |
+++ b/app/design/frontend/default/iphone/template/catalog/product/view/media.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/app/design/frontend/default/iphone/template/catalog/product/view/options/wrapper.phtml b/app/design/frontend/default/iphone/template/catalog/product/view/options/wrapper.phtml | |
index 57bba4a..1f122d6 100644 | |
--- a/app/design/frontend/default/iphone/template/catalog/product/view/options/wrapper.phtml | |
+++ b/app/design/frontend/default/iphone/template/catalog/product/view/options/wrapper.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/catalogsearch/form.mini.phtml b/app/design/frontend/default/iphone/template/catalogsearch/form.mini.phtml | |
index 1b8d60e..8f69906 100755 | |
--- a/app/design/frontend/default/iphone/template/catalogsearch/form.mini.phtml | |
+++ b/app/design/frontend/default/iphone/template/catalogsearch/form.mini.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
/* @var $this Mage_Core_Block_Template */ | |
diff --git a/app/design/frontend/default/iphone/template/catalogsearch/result.phtml b/app/design/frontend/default/iphone/template/catalogsearch/result.phtml | |
index a80d23f..3a14655 100644 | |
--- a/app/design/frontend/default/iphone/template/catalogsearch/result.phtml | |
+++ b/app/design/frontend/default/iphone/template/catalogsearch/result.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/checkout/cart.phtml b/app/design/frontend/default/iphone/template/checkout/cart.phtml | |
index 0e3e867..5ecc63a 100755 | |
--- a/app/design/frontend/default/iphone/template/checkout/cart.phtml | |
+++ b/app/design/frontend/default/iphone/template/checkout/cart.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/checkout/cart/item/default.phtml b/app/design/frontend/default/iphone/template/checkout/cart/item/default.phtml | |
index de8480b..f272973 100755 | |
--- a/app/design/frontend/default/iphone/template/checkout/cart/item/default.phtml | |
+++ b/app/design/frontend/default/iphone/template/checkout/cart/item/default.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/checkout/onepage/review/info.phtml b/app/design/frontend/default/iphone/template/checkout/onepage/review/info.phtml | |
index 4504bbe..345a6d2 100644 | |
--- a/app/design/frontend/default/iphone/template/checkout/onepage/review/info.phtml | |
+++ b/app/design/frontend/default/iphone/template/checkout/onepage/review/info.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/checkout/onepage/review/item.phtml b/app/design/frontend/default/iphone/template/checkout/onepage/review/item.phtml | |
index a0c9e97..bf10c83 100644 | |
--- a/app/design/frontend/default/iphone/template/checkout/onepage/review/item.phtml | |
+++ b/app/design/frontend/default/iphone/template/checkout/onepage/review/item.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/checkout/onepage/review/totals.phtml b/app/design/frontend/default/iphone/template/checkout/onepage/review/totals.phtml | |
index 05a4e82..0884b50 100644 | |
--- a/app/design/frontend/default/iphone/template/checkout/onepage/review/totals.phtml | |
+++ b/app/design/frontend/default/iphone/template/checkout/onepage/review/totals.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/app/design/frontend/default/iphone/template/checkout/success.phtml b/app/design/frontend/default/iphone/template/checkout/success.phtml | |
index ef982dc..fb8c301 100644 | |
--- a/app/design/frontend/default/iphone/template/checkout/success.phtml | |
+++ b/app/design/frontend/default/iphone/template/checkout/success.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/customer/account/dashboard/address.phtml b/app/design/frontend/default/iphone/template/customer/account/dashboard/address.phtml | |
index b9202f2..4774047 100644 | |
--- a/app/design/frontend/default/iphone/template/customer/account/dashboard/address.phtml | |
+++ b/app/design/frontend/default/iphone/template/customer/account/dashboard/address.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/customer/account/navigation.phtml b/app/design/frontend/default/iphone/template/customer/account/navigation.phtml | |
index ea1fe21..c5bffef 100644 | |
--- a/app/design/frontend/default/iphone/template/customer/account/navigation.phtml | |
+++ b/app/design/frontend/default/iphone/template/customer/account/navigation.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/customer/address/book.phtml b/app/design/frontend/default/iphone/template/customer/address/book.phtml | |
index 5f36ad6..c08ca6b 100644 | |
--- a/app/design/frontend/default/iphone/template/customer/address/book.phtml | |
+++ b/app/design/frontend/default/iphone/template/customer/address/book.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/customer/form/login.phtml b/app/design/frontend/default/iphone/template/customer/form/login.phtml | |
index 2079b37..5a91b95 100755 | |
--- a/app/design/frontend/default/iphone/template/customer/form/login.phtml | |
+++ b/app/design/frontend/default/iphone/template/customer/form/login.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/downloadable/checkout/cart/item/default.phtml b/app/design/frontend/default/iphone/template/downloadable/checkout/cart/item/default.phtml | |
index e7ecb8f..3c4d711 100644 | |
--- a/app/design/frontend/default/iphone/template/downloadable/checkout/cart/item/default.phtml | |
+++ b/app/design/frontend/default/iphone/template/downloadable/checkout/cart/item/default.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/downloadable/checkout/onepage/review/item.phtml b/app/design/frontend/default/iphone/template/downloadable/checkout/onepage/review/item.phtml | |
index 5908c32..f672a96 100644 | |
--- a/app/design/frontend/default/iphone/template/downloadable/checkout/onepage/review/item.phtml | |
+++ b/app/design/frontend/default/iphone/template/downloadable/checkout/onepage/review/item.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/downloadable/customer/products/list.phtml b/app/design/frontend/default/iphone/template/downloadable/customer/products/list.phtml | |
index 8a16509..2249d01 100644 | |
--- a/app/design/frontend/default/iphone/template/downloadable/customer/products/list.phtml | |
+++ b/app/design/frontend/default/iphone/template/downloadable/customer/products/list.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/downloadable/sales/order/creditmemo/items/renderer/downloadable.phtml b/app/design/frontend/default/iphone/template/downloadable/sales/order/creditmemo/items/renderer/downloadable.phtml | |
index 28282f7..33fc14e 100644 | |
--- a/app/design/frontend/default/iphone/template/downloadable/sales/order/creditmemo/items/renderer/downloadable.phtml | |
+++ b/app/design/frontend/default/iphone/template/downloadable/sales/order/creditmemo/items/renderer/downloadable.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/downloadable/sales/order/invoice/items/renderer/downloadable.phtml b/app/design/frontend/default/iphone/template/downloadable/sales/order/invoice/items/renderer/downloadable.phtml | |
index 3eb33f8..fb21ab4 100644 | |
--- a/app/design/frontend/default/iphone/template/downloadable/sales/order/invoice/items/renderer/downloadable.phtml | |
+++ b/app/design/frontend/default/iphone/template/downloadable/sales/order/invoice/items/renderer/downloadable.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/downloadable/sales/order/items/renderer/downloadable.phtml b/app/design/frontend/default/iphone/template/downloadable/sales/order/items/renderer/downloadable.phtml | |
index 7e28fb7..d00e7f9 100644 | |
--- a/app/design/frontend/default/iphone/template/downloadable/sales/order/items/renderer/downloadable.phtml | |
+++ b/app/design/frontend/default/iphone/template/downloadable/sales/order/items/renderer/downloadable.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/newsletter/subscribe.phtml b/app/design/frontend/default/iphone/template/newsletter/subscribe.phtml | |
index 92aa49a..0590498 100644 | |
--- a/app/design/frontend/default/iphone/template/newsletter/subscribe.phtml | |
+++ b/app/design/frontend/default/iphone/template/newsletter/subscribe.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/page/1column.phtml b/app/design/frontend/default/iphone/template/page/1column.phtml | |
index 265c13e..3fdcd14 100755 | |
--- a/app/design/frontend/default/iphone/template/page/1column.phtml | |
+++ b/app/design/frontend/default/iphone/template/page/1column.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/page/html/footer.phtml b/app/design/frontend/default/iphone/template/page/html/footer.phtml | |
index ce6db7f..d707225 100755 | |
--- a/app/design/frontend/default/iphone/template/page/html/footer.phtml | |
+++ b/app/design/frontend/default/iphone/template/page/html/footer.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/page/html/head.phtml b/app/design/frontend/default/iphone/template/page/html/head.phtml | |
index dd40474..c751db6 100755 | |
--- a/app/design/frontend/default/iphone/template/page/html/head.phtml | |
+++ b/app/design/frontend/default/iphone/template/page/html/head.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/page/html/header.phtml b/app/design/frontend/default/iphone/template/page/html/header.phtml | |
index b3e1576..e0b96f8 100755 | |
--- a/app/design/frontend/default/iphone/template/page/html/header.phtml | |
+++ b/app/design/frontend/default/iphone/template/page/html/header.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
/** | |
diff --git a/app/design/frontend/default/iphone/template/page/html/pager.phtml b/app/design/frontend/default/iphone/template/page/html/pager.phtml | |
index 49e2933..3d3027e 100644 | |
--- a/app/design/frontend/default/iphone/template/page/html/pager.phtml | |
+++ b/app/design/frontend/default/iphone/template/page/html/pager.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/page/switch/languages.phtml b/app/design/frontend/default/iphone/template/page/switch/languages.phtml | |
index 5025f48..920f078 100644 | |
--- a/app/design/frontend/default/iphone/template/page/switch/languages.phtml | |
+++ b/app/design/frontend/default/iphone/template/page/switch/languages.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/page/switch/stores.phtml b/app/design/frontend/default/iphone/template/page/switch/stores.phtml | |
index d16d5cc..475f9ce 100644 | |
--- a/app/design/frontend/default/iphone/template/page/switch/stores.phtml | |
+++ b/app/design/frontend/default/iphone/template/page/switch/stores.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/page/template/links.phtml b/app/design/frontend/default/iphone/template/page/template/links.phtml | |
index 78ab3aa..e6201d5 100644 | |
--- a/app/design/frontend/default/iphone/template/page/template/links.phtml | |
+++ b/app/design/frontend/default/iphone/template/page/template/links.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/paypal/express/review.phtml b/app/design/frontend/default/iphone/template/paypal/express/review.phtml | |
index 5844935..829898e 100644 | |
--- a/app/design/frontend/default/iphone/template/paypal/express/review.phtml | |
+++ b/app/design/frontend/default/iphone/template/paypal/express/review.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
/** @var $this Mage_Paypal_Block_Express_Review */ | |
diff --git a/app/design/frontend/default/iphone/template/paypal/express/review/details.phtml b/app/design/frontend/default/iphone/template/paypal/express/review/details.phtml | |
index 6b96b4b..02f5632 100644 | |
--- a/app/design/frontend/default/iphone/template/paypal/express/review/details.phtml | |
+++ b/app/design/frontend/default/iphone/template/paypal/express/review/details.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/app/design/frontend/default/iphone/template/persistent/checkout/onepage/login.phtml b/app/design/frontend/default/iphone/template/persistent/checkout/onepage/login.phtml | |
index 9dfbb98..55a0665 100644 | |
--- a/app/design/frontend/default/iphone/template/persistent/checkout/onepage/login.phtml | |
+++ b/app/design/frontend/default/iphone/template/persistent/checkout/onepage/login.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/persistent/customer/form/login.phtml b/app/design/frontend/default/iphone/template/persistent/customer/form/login.phtml | |
index 1c0dbd1..30e7b9d 100755 | |
--- a/app/design/frontend/default/iphone/template/persistent/customer/form/login.phtml | |
+++ b/app/design/frontend/default/iphone/template/persistent/customer/form/login.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/persistent/remember_me_tooltip.phtml b/app/design/frontend/default/iphone/template/persistent/remember_me_tooltip.phtml | |
index e1b7564..979a85c 100644 | |
--- a/app/design/frontend/default/iphone/template/persistent/remember_me_tooltip.phtml | |
+++ b/app/design/frontend/default/iphone/template/persistent/remember_me_tooltip.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/review/customer/list.phtml b/app/design/frontend/default/iphone/template/review/customer/list.phtml | |
index 1d9b82f..0e86f9a 100644 | |
--- a/app/design/frontend/default/iphone/template/review/customer/list.phtml | |
+++ b/app/design/frontend/default/iphone/template/review/customer/list.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/sales/billing/agreement/view.phtml b/app/design/frontend/default/iphone/template/sales/billing/agreement/view.phtml | |
index 37edd6b..ebb7217 100644 | |
--- a/app/design/frontend/default/iphone/template/sales/billing/agreement/view.phtml | |
+++ b/app/design/frontend/default/iphone/template/sales/billing/agreement/view.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/sales/billing/agreements.phtml b/app/design/frontend/default/iphone/template/sales/billing/agreements.phtml | |
index 46bfa0d..2419364 100644 | |
--- a/app/design/frontend/default/iphone/template/sales/billing/agreements.phtml | |
+++ b/app/design/frontend/default/iphone/template/sales/billing/agreements.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/sales/order/creditmemo/items.phtml b/app/design/frontend/default/iphone/template/sales/order/creditmemo/items.phtml | |
index d6356c9..eb673ee 100644 | |
--- a/app/design/frontend/default/iphone/template/sales/order/creditmemo/items.phtml | |
+++ b/app/design/frontend/default/iphone/template/sales/order/creditmemo/items.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/sales/order/creditmemo/items/renderer/default.phtml b/app/design/frontend/default/iphone/template/sales/order/creditmemo/items/renderer/default.phtml | |
index 5454063..c38526b 100644 | |
--- a/app/design/frontend/default/iphone/template/sales/order/creditmemo/items/renderer/default.phtml | |
+++ b/app/design/frontend/default/iphone/template/sales/order/creditmemo/items/renderer/default.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/sales/order/history.phtml b/app/design/frontend/default/iphone/template/sales/order/history.phtml | |
index 0c5b57f..8511836 100755 | |
--- a/app/design/frontend/default/iphone/template/sales/order/history.phtml | |
+++ b/app/design/frontend/default/iphone/template/sales/order/history.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/sales/order/invoice/items.phtml b/app/design/frontend/default/iphone/template/sales/order/invoice/items.phtml | |
index 94c43b6..793f939 100644 | |
--- a/app/design/frontend/default/iphone/template/sales/order/invoice/items.phtml | |
+++ b/app/design/frontend/default/iphone/template/sales/order/invoice/items.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/sales/order/invoice/items/renderer/default.phtml b/app/design/frontend/default/iphone/template/sales/order/invoice/items/renderer/default.phtml | |
index e28da59..7e71390 100644 | |
--- a/app/design/frontend/default/iphone/template/sales/order/invoice/items/renderer/default.phtml | |
+++ b/app/design/frontend/default/iphone/template/sales/order/invoice/items/renderer/default.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/sales/order/items.phtml b/app/design/frontend/default/iphone/template/sales/order/items.phtml | |
index 2b500e5..e6891fa 100644 | |
--- a/app/design/frontend/default/iphone/template/sales/order/items.phtml | |
+++ b/app/design/frontend/default/iphone/template/sales/order/items.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/sales/order/items/renderer/default.phtml b/app/design/frontend/default/iphone/template/sales/order/items/renderer/default.phtml | |
index efffc66..61bae0f 100644 | |
--- a/app/design/frontend/default/iphone/template/sales/order/items/renderer/default.phtml | |
+++ b/app/design/frontend/default/iphone/template/sales/order/items/renderer/default.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/sales/order/recent.phtml b/app/design/frontend/default/iphone/template/sales/order/recent.phtml | |
index 28a64e3..56fc1ca 100755 | |
--- a/app/design/frontend/default/iphone/template/sales/order/recent.phtml | |
+++ b/app/design/frontend/default/iphone/template/sales/order/recent.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/sales/order/totals.phtml b/app/design/frontend/default/iphone/template/sales/order/totals.phtml | |
index 217b12b..a777d72 100644 | |
--- a/app/design/frontend/default/iphone/template/sales/order/totals.phtml | |
+++ b/app/design/frontend/default/iphone/template/sales/order/totals.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
/** | |
diff --git a/app/design/frontend/default/iphone/template/shipping/tracking/popup.phtml b/app/design/frontend/default/iphone/template/shipping/tracking/popup.phtml | |
index b42cc7d..5d3ead3 100755 | |
--- a/app/design/frontend/default/iphone/template/shipping/tracking/popup.phtml | |
+++ b/app/design/frontend/default/iphone/template/shipping/tracking/popup.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/tag/list.phtml b/app/design/frontend/default/iphone/template/tag/list.phtml | |
index 6b4270b..0fe1723 100644 | |
--- a/app/design/frontend/default/iphone/template/tag/list.phtml | |
+++ b/app/design/frontend/default/iphone/template/tag/list.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/tax/order/tax.phtml b/app/design/frontend/default/iphone/template/tax/order/tax.phtml | |
index e71c9c4..22a726c 100644 | |
--- a/app/design/frontend/default/iphone/template/tax/order/tax.phtml | |
+++ b/app/design/frontend/default/iphone/template/tax/order/tax.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/wishlist/item/column/cart.phtml b/app/design/frontend/default/iphone/template/wishlist/item/column/cart.phtml | |
index 6f14231..531292e 100644 | |
--- a/app/design/frontend/default/iphone/template/wishlist/item/column/cart.phtml | |
+++ b/app/design/frontend/default/iphone/template/wishlist/item/column/cart.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/app/design/frontend/default/iphone/template/wishlist/item/column/image.phtml b/app/design/frontend/default/iphone/template/wishlist/item/column/image.phtml | |
index 85f8ed0..b776633 100644 | |
--- a/app/design/frontend/default/iphone/template/wishlist/item/column/image.phtml | |
+++ b/app/design/frontend/default/iphone/template/wishlist/item/column/image.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/app/design/frontend/default/iphone/template/wishlist/item/column/info.phtml b/app/design/frontend/default/iphone/template/wishlist/item/column/info.phtml | |
index c2475bb..ce1d730 100644 | |
--- a/app/design/frontend/default/iphone/template/wishlist/item/column/info.phtml | |
+++ b/app/design/frontend/default/iphone/template/wishlist/item/column/info.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/app/design/frontend/default/iphone/template/wishlist/item/configure/addto.phtml b/app/design/frontend/default/iphone/template/wishlist/item/configure/addto.phtml | |
index 96f700c..835f662 100644 | |
--- a/app/design/frontend/default/iphone/template/wishlist/item/configure/addto.phtml | |
+++ b/app/design/frontend/default/iphone/template/wishlist/item/configure/addto.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/wishlist/item/list.phtml b/app/design/frontend/default/iphone/template/wishlist/item/list.phtml | |
index a9cc653..09b3885 100644 | |
--- a/app/design/frontend/default/iphone/template/wishlist/item/list.phtml | |
+++ b/app/design/frontend/default/iphone/template/wishlist/item/list.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/iphone/template/wishlist/shared.phtml b/app/design/frontend/default/iphone/template/wishlist/shared.phtml | |
index 902772b..cfe8f90 100644 | |
--- a/app/design/frontend/default/iphone/template/wishlist/shared.phtml | |
+++ b/app/design/frontend/default/iphone/template/wishlist/shared.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
/* @var $this Mage_Wishlist_Block_Share_Wishlist */ | |
diff --git a/app/design/frontend/default/iphone/template/wishlist/view.phtml b/app/design/frontend/default/iphone/template/wishlist/view.phtml | |
index 2dbe03a..8062eb7 100755 | |
--- a/app/design/frontend/default/iphone/template/wishlist/view.phtml | |
+++ b/app/design/frontend/default/iphone/template/wishlist/view.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
/* @var $this Mage_Wishlist_Block_Customer_Wishlist */ | |
diff --git a/app/design/frontend/default/modern/etc/theme.xml b/app/design/frontend/default/modern/etc/theme.xml | |
index c237550..b3341a7 100644 | |
--- a/app/design/frontend/default/modern/etc/theme.xml | |
+++ b/app/design/frontend/default/modern/etc/theme.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
--> | |
diff --git a/app/design/frontend/default/modern/etc/widget.xml b/app/design/frontend/default/modern/etc/widget.xml | |
index 87ef905..6d29229 100755 | |
--- a/app/design/frontend/default/modern/etc/widget.xml | |
+++ b/app/design/frontend/default/modern/etc/widget.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
--> | |
diff --git a/app/design/frontend/default/modern/layout/catalog.xml b/app/design/frontend/default/modern/layout/catalog.xml | |
index 3e27567..e1a519d 100755 | |
--- a/app/design/frontend/default/modern/layout/catalog.xml | |
+++ b/app/design/frontend/default/modern/layout/catalog.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
@@ -168,6 +168,7 @@ Compare products page | |
<reference name="head"> | |
<action method="addJs"><script>scriptaculous/scriptaculous.js</script></action> | |
<action method="addJs"><script>varien/product.js</script></action> | |
+ <action method="addJs"><script>varien/product_options.js</script></action> | |
</reference> | |
<reference name="content"> | |
<block type="catalog/product_compare_list" name="catalog.compare.list" template="catalog/product/compare/list.phtml"/> | |
@@ -186,6 +187,7 @@ Product view | |
</reference> | |
<reference name="head"> | |
<action method="addJs"><script>varien/product.js</script></action> | |
+ <action method="addJs"><script>varien/product_options.js</script></action> | |
<action method="addJs"><script>varien/configurable.js</script></action> | |
<action method="addItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name><params/><!--<if/><condition>can_load_calendar_js</condition>--></action> | |
@@ -325,6 +327,7 @@ Product send to friend | |
</reference> | |
<reference name="head"> | |
<action method="addJs"><script>varien/product.js</script></action> | |
+ <action method="addJs"><script>varien/product_options.js</script></action> | |
</reference> | |
<reference name="content"> | |
<block type="catalog/product_send" name="product.send" template="catalog/product/send.phtml"> | |
diff --git a/app/design/frontend/default/modern/layout/catalogsearch.xml b/app/design/frontend/default/modern/layout/catalogsearch.xml | |
index 86ccb50..b5afe6e 100755 | |
--- a/app/design/frontend/default/modern/layout/catalogsearch.xml | |
+++ b/app/design/frontend/default/modern/layout/catalogsearch.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/app/design/frontend/default/modern/layout/checkout.xml b/app/design/frontend/default/modern/layout/checkout.xml | |
index 72c3cd1..4e22e70 100755 | |
--- a/app/design/frontend/default/modern/layout/checkout.xml | |
+++ b/app/design/frontend/default/modern/layout/checkout.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/app/design/frontend/default/modern/layout/contacts.xml b/app/design/frontend/default/modern/layout/contacts.xml | |
index 8b635b4..51065cd 100755 | |
--- a/app/design/frontend/default/modern/layout/contacts.xml | |
+++ b/app/design/frontend/default/modern/layout/contacts.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
--> | |
diff --git a/app/design/frontend/default/modern/layout/customer.xml b/app/design/frontend/default/modern/layout/customer.xml | |
index 42a6574..129f5b5 100755 | |
--- a/app/design/frontend/default/modern/layout/customer.xml | |
+++ b/app/design/frontend/default/modern/layout/customer.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/app/design/frontend/default/modern/layout/newsletter.xml b/app/design/frontend/default/modern/layout/newsletter.xml | |
index 4c22130..8ce6524 100755 | |
--- a/app/design/frontend/default/modern/layout/newsletter.xml | |
+++ b/app/design/frontend/default/modern/layout/newsletter.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/app/design/frontend/default/modern/layout/page.xml b/app/design/frontend/default/modern/layout/page.xml | |
index c29646b..ff6a580 100755 | |
--- a/app/design/frontend/default/modern/layout/page.xml | |
+++ b/app/design/frontend/default/modern/layout/page.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
--> | |
diff --git a/app/design/frontend/default/modern/layout/payment.xml b/app/design/frontend/default/modern/layout/payment.xml | |
index 01e3dc2..c8662c6 100755 | |
--- a/app/design/frontend/default/modern/layout/payment.xml | |
+++ b/app/design/frontend/default/modern/layout/payment.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/app/design/frontend/default/modern/layout/persistent.xml b/app/design/frontend/default/modern/layout/persistent.xml | |
index 7386c19..88680a3 100755 | |
--- a/app/design/frontend/default/modern/layout/persistent.xml | |
+++ b/app/design/frontend/default/modern/layout/persistent.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
--> | |
diff --git a/app/design/frontend/default/modern/layout/review.xml b/app/design/frontend/default/modern/layout/review.xml | |
index 6b22cd9..97687bb 100755 | |
--- a/app/design/frontend/default/modern/layout/review.xml | |
+++ b/app/design/frontend/default/modern/layout/review.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
@@ -73,6 +73,7 @@ Product reviews page | |
</reference> | |
<reference name="head"> | |
<action method="addJs"><script>varien/product.js</script></action> | |
+ <action method="addJs"><script>varien/product_options.js</script></action> | |
<action method="addJs"><script>varien/configurable.js</script></action> | |
</reference> | |
<reference name="content"> | |
diff --git a/app/design/frontend/default/modern/layout/rss.xml b/app/design/frontend/default/modern/layout/rss.xml | |
index aef7d21..395b8ee 100755 | |
--- a/app/design/frontend/default/modern/layout/rss.xml | |
+++ b/app/design/frontend/default/modern/layout/rss.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
--> | |
diff --git a/app/design/frontend/default/modern/layout/sales.xml b/app/design/frontend/default/modern/layout/sales.xml | |
index 231ee10..8c9af5c 100755 | |
--- a/app/design/frontend/default/modern/layout/sales.xml | |
+++ b/app/design/frontend/default/modern/layout/sales.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/app/design/frontend/default/modern/layout/sendfriend.xml b/app/design/frontend/default/modern/layout/sendfriend.xml | |
index a3fa404..1bd70ee 100755 | |
--- a/app/design/frontend/default/modern/layout/sendfriend.xml | |
+++ b/app/design/frontend/default/modern/layout/sendfriend.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
--> | |
@@ -33,6 +33,7 @@ | |
</reference> | |
<reference name="head"> | |
<action method="addJs"><script>varien/product.js</script></action> | |
+ <action method="addJs"><script>varien/product_options.js</script></action> | |
</reference> | |
<reference name="content"> | |
<block type="sendfriend/send" name="sendfriend.send" template="sendfriend/send.phtml" /> | |
diff --git a/app/design/frontend/default/modern/layout/tag.xml b/app/design/frontend/default/modern/layout/tag.xml | |
index cbc8ac1..0be2b37 100755 | |
--- a/app/design/frontend/default/modern/layout/tag.xml | |
+++ b/app/design/frontend/default/modern/layout/tag.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/app/design/frontend/default/modern/layout/wishlist.xml b/app/design/frontend/default/modern/layout/wishlist.xml | |
index c8cefd9..362a2f4 100755 | |
--- a/app/design/frontend/default/modern/layout/wishlist.xml | |
+++ b/app/design/frontend/default/modern/layout/wishlist.xml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/app/design/frontend/default/modern/template/catalog/product/list.phtml b/app/design/frontend/default/modern/template/catalog/product/list.phtml | |
index 020fe55..2edbdc1 100755 | |
--- a/app/design/frontend/default/modern/template/catalog/product/list.phtml | |
+++ b/app/design/frontend/default/modern/template/catalog/product/list.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/modern/template/catalog/product/list/upsell.phtml b/app/design/frontend/default/modern/template/catalog/product/list/upsell.phtml | |
index ee4a65d..d87b9c9 100755 | |
--- a/app/design/frontend/default/modern/template/catalog/product/list/upsell.phtml | |
+++ b/app/design/frontend/default/modern/template/catalog/product/list/upsell.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/modern/template/catalog/product/view.phtml b/app/design/frontend/default/modern/template/catalog/product/view.phtml | |
index 33788b5..e9809a1 100755 | |
--- a/app/design/frontend/default/modern/template/catalog/product/view.phtml | |
+++ b/app/design/frontend/default/modern/template/catalog/product/view.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/app/design/frontend/default/modern/template/catalog/product/view/media.phtml b/app/design/frontend/default/modern/template/catalog/product/view/media.phtml | |
index c65756a..95f0e5a 100755 | |
--- a/app/design/frontend/default/modern/template/catalog/product/view/media.phtml | |
+++ b/app/design/frontend/default/modern/template/catalog/product/view/media.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/app/design/frontend/default/modern/template/catalog/product/view/tabs.phtml b/app/design/frontend/default/modern/template/catalog/product/view/tabs.phtml | |
index 26dc0cb..3422f6f 100755 | |
--- a/app/design/frontend/default/modern/template/catalog/product/view/tabs.phtml | |
+++ b/app/design/frontend/default/modern/template/catalog/product/view/tabs.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/app/design/frontend/default/modern/template/catalogsearch/form.mini.phtml b/app/design/frontend/default/modern/template/catalogsearch/form.mini.phtml | |
index dadc281..7479a50 100755 | |
--- a/app/design/frontend/default/modern/template/catalogsearch/form.mini.phtml | |
+++ b/app/design/frontend/default/modern/template/catalogsearch/form.mini.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
/* @var $this Mage_Core_Block_Template */ | |
diff --git a/app/design/frontend/default/modern/template/checkout/cart.phtml b/app/design/frontend/default/modern/template/checkout/cart.phtml | |
index 9f3c3c8..37704fa 100755 | |
--- a/app/design/frontend/default/modern/template/checkout/cart.phtml | |
+++ b/app/design/frontend/default/modern/template/checkout/cart.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/modern/template/newsletter/subscribe.phtml b/app/design/frontend/default/modern/template/newsletter/subscribe.phtml | |
index 7223d15..992278b 100755 | |
--- a/app/design/frontend/default/modern/template/newsletter/subscribe.phtml | |
+++ b/app/design/frontend/default/modern/template/newsletter/subscribe.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/modern/template/page/3columns.phtml b/app/design/frontend/default/modern/template/page/3columns.phtml | |
index ad78e06..6420e7d 100755 | |
--- a/app/design/frontend/default/modern/template/page/3columns.phtml | |
+++ b/app/design/frontend/default/modern/template/page/3columns.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/modern/template/page/html/footer.phtml b/app/design/frontend/default/modern/template/page/html/footer.phtml | |
index 3c70354..21dd8f1 100755 | |
--- a/app/design/frontend/default/modern/template/page/html/footer.phtml | |
+++ b/app/design/frontend/default/modern/template/page/html/footer.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/default/modern/template/page/html/header.phtml b/app/design/frontend/default/modern/template/page/html/header.phtml | |
index 6e71904..9898c24 100755 | |
--- a/app/design/frontend/default/modern/template/page/html/header.phtml | |
+++ b/app/design/frontend/default/modern/template/page/html/header.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
/** | |
diff --git a/app/design/frontend/default/modern/template/sample/home.phtml b/app/design/frontend/default/modern/template/sample/home.phtml | |
index db7ff0b..f4a5eb2 100755 | |
--- a/app/design/frontend/default/modern/template/sample/home.phtml | |
+++ b/app/design/frontend/default/modern/template/sample/home.phtml | |
@@ -20,7 +20,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
?> | |
diff --git a/app/design/frontend/rwd/default/layout/catalog.xml b/app/design/frontend/rwd/default/layout/catalog.xml | |
index ae4505e..16836e1 100644 | |
--- a/app/design/frontend/rwd/default/layout/catalog.xml | |
+++ b/app/design/frontend/rwd/default/layout/catalog.xml | |
@@ -168,6 +168,7 @@ Compare products page | |
<reference name="head"> | |
<action method="addJs"><script>scriptaculous/scriptaculous.js</script></action> | |
<action method="addJs"><script>varien/product.js</script></action> | |
+ <action method="addJs"><script>varien/product_options.js</script></action> | |
<action method="unsetChild"><name>head.viewport</name></action> | |
</reference> | |
<reference name="content"> | |
@@ -193,6 +194,7 @@ Product view | |
</reference> | |
<reference name="head"> | |
<action method="addJs"><script>varien/product.js</script></action> | |
+ <action method="addJs"><script>varien/product_options.js</script></action> | |
<action method="addJs"><script>varien/configurable.js</script></action> | |
<action method="addItem"><type>skin_js</type><script>js/lib/elevatezoom/jquery.elevateZoom-3.0.8.min.js</script></action> | |
@@ -349,6 +351,7 @@ Product send to friend | |
</reference> | |
<reference name="head"> | |
<action method="addJs"><script>varien/product.js</script></action> | |
+ <action method="addJs"><script>varien/product_options.js</script></action> | |
</reference> | |
<reference name="content"> | |
<block type="catalog/product_send" name="product.send" template="catalog/product/send.phtml"> | |
diff --git a/app/design/frontend/rwd/default/layout/configurableswatches.xml b/app/design/frontend/rwd/default/layout/configurableswatches.xml | |
index d74b9be..e008526 100644 | |
--- a/app/design/frontend/rwd/default/layout/configurableswatches.xml | |
+++ b/app/design/frontend/rwd/default/layout/configurableswatches.xml | |
@@ -29,6 +29,12 @@ | |
<product_list> | |
<reference name="head"> | |
+ <action method="addJs" ifconfig="configswatches/general/product_list_price_change"> | |
+ <name>varien/product_options.js</name> | |
+ </action> | |
+ <action method="addItem" ifconfig="configswatches/general/product_list_price_change"> | |
+ <type>skin_js</type><name>js/configurableswatches/configurable-swatch-prices.js</name> | |
+ </action> | |
<action method="addItem"><type>skin_js</type><name>js/configurableswatches/product-media.js</name></action> | |
<action method="addItem"><type>skin_js</type><name>js/configurableswatches/swatches-list.js</name></action> | |
</reference> | |
@@ -37,6 +43,7 @@ | |
</reference> | |
<reference name="product_list.after"> | |
<block type="configurableswatches/catalog_media_js_list" name="configurableswatches.media.js.list" /> | |
+ <block type="configurableswatches/catalog_product_list_price" name="configurableswatches.price.js.list" /> | |
</reference> | |
</product_list> | |
@@ -59,7 +66,7 @@ | |
<PRODUCT_TYPE_configurable> | |
<reference name="head"> | |
<action method="addItem"><type>skin_js</type><name>js/configurableswatches/product-media.js</name></action> | |
- <action method="addItem"><type>skin_js</type><name>js/configurableswatches/swatches-product.js</name></action> | |
+ <action method="addItem"><type>skin_js</type><name helper="configurableswatches/getSwatchesProductJs"></name></action> | |
</reference> | |
<reference name="product.info.media"> | |
<action method="setGalleryFilterHelper"><helper>configurableswatches/productimg</helper></action> | |
diff --git a/app/design/frontend/rwd/default/layout/page.xml b/app/design/frontend/rwd/default/layout/page.xml | |
index 6e1f9f9..22a2fe6 100644 | |
--- a/app/design/frontend/rwd/default/layout/page.xml | |
+++ b/app/design/frontend/rwd/default/layout/page.xml | |
@@ -174,9 +174,7 @@ | |
<action method="addJs"><script>varien/js.js</script></action> | |
<action method="addCss"><stylesheet>css/styles.css</stylesheet></action> | |
- <action method="addItem"><type>skin_css</type><name>css/styles-ie.css</name><params/><if>lt IE 8</if></action> | |
<action method="addCss"><stylesheet>css/widgets.css</stylesheet></action> | |
- <action method="addCss"><stylesheet>css/print.css</stylesheet><params>media="print"</params></action> | |
<action method="addItem"><type>js</type><name>lib/ds-sleight.js</name><params/><if>lt IE 7</if></action> | |
<!--<action method="addItem"><type>skin_js</type><name>js/iehover-fix.js</name><params/><if>lt IE 7</if></action>--> | |
diff --git a/app/design/frontend/rwd/default/layout/review.xml b/app/design/frontend/rwd/default/layout/review.xml | |
index 7d0aea8..a850f8c 100644 | |
--- a/app/design/frontend/rwd/default/layout/review.xml | |
+++ b/app/design/frontend/rwd/default/layout/review.xml | |
@@ -84,6 +84,7 @@ Product reviews page | |
</reference> | |
<reference name="head"> | |
<action method="addJs"><script>varien/product.js</script></action> | |
+ <action method="addJs"><script>varien/product_options.js</script></action> | |
<action method="addJs"><script>varien/configurable.js</script></action> | |
</reference> | |
<reference name="content"> | |
diff --git a/app/design/frontend/rwd/default/template/bundle/catalog/product/view/type/bundle/option/select.phtml b/app/design/frontend/rwd/default/template/bundle/catalog/product/view/type/bundle/option/select.phtml | |
index 2ab4e39..57700da 100644 | |
--- a/app/design/frontend/rwd/default/template/bundle/catalog/product/view/type/bundle/option/select.phtml | |
+++ b/app/design/frontend/rwd/default/template/bundle/catalog/product/view/type/bundle/option/select.phtml | |
@@ -59,6 +59,7 @@ | |
</div> | |
<span id="bundle-option-<?php echo $_option->getId() ?>-tier-prices"> <?php echo $tierPriceHtml; ?></span> | |
<span class="qty-holder"> | |
- <label for="bundle-option-<?php echo $_option->getId() ?>-qty-input"><?php echo $this->__('Qty:') ?> </label><input onkeyup="bundle.changeOptionQty(this, event)" onblur="bundle.changeOptionQty(this, event)" <?php if (!$_canChangeQty) echo ' disabled="disabled"' ?> id="bundle-option-<?php echo $_option->getId() ?>-qty-input" class="input-text qty<?php if (!$_canChangeQty) echo ' qty-disabled' ?>" type="text" pattern="\d*" name="bundle_option_qty[<?php echo $_option->getId() ?>]" value="<?php echo $_defaultQty ?>"/> | |
+ <label for="bundle-option-<?php echo $_option->getId() ?>-qty-input"><?php echo $this->__('Qty:') ?> </label> | |
+ <input onkeyup="bundle.changeOptionQty(this, event)" onblur="bundle.changeOptionQty(this, event)" <?php if (!$_canChangeQty) echo ' disabled="disabled"' ?> id="bundle-option-<?php echo $_option->getId() ?>-qty-input" class="input-text qty<?php if (!$_canChangeQty) echo ' qty-disabled' ?>" type="text" pattern="\d*(\.\d+)?" name="bundle_option_qty[<?php echo $_option->getId() ?>]" value="<?php echo $_defaultQty ?>"/> | |
</span> | |
</dd> | |
diff --git a/app/design/frontend/rwd/default/template/catalog/product/view/addtocart.phtml b/app/design/frontend/rwd/default/template/catalog/product/view/addtocart.phtml | |
index d77ed29..afe7f1d 100644 | |
--- a/app/design/frontend/rwd/default/template/catalog/product/view/addtocart.phtml | |
+++ b/app/design/frontend/rwd/default/template/catalog/product/view/addtocart.phtml | |
@@ -31,7 +31,7 @@ | |
<?php if(!$_product->isGrouped()): ?> | |
<div class="qty-wrapper"> | |
<label for="qty"><?php echo $this->__('Qty:') ?></label> | |
- <input type="text" pattern="\d*" name="qty" id="qty" maxlength="12" value="<?php echo max($this->getProductDefaultQty() * 1, 1) ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Qty')) ?>" class="input-text qty" /> | |
+ <input type="text" pattern="\d*(\.\d+)?" name="qty" id="qty" maxlength="12" value="<?php echo $this->getProductDefaultQty() * 1 ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Qty')) ?>" class="input-text qty" /> | |
</div> | |
<?php endif; ?> | |
<div class="add-to-cart-buttons"> | |
diff --git a/app/design/frontend/rwd/default/template/catalog/product/view/type/grouped.phtml b/app/design/frontend/rwd/default/template/catalog/product/view/type/grouped.phtml | |
index a2fc1df..a70bd5c 100644 | |
--- a/app/design/frontend/rwd/default/template/catalog/product/view/type/grouped.phtml | |
+++ b/app/design/frontend/rwd/default/template/catalog/product/view/type/grouped.phtml | |
@@ -59,8 +59,8 @@ | |
<?php if ($_product->isSaleable()): ?> | |
<div class="qty-wrapper"> | |
<?php if ($_item->isSaleable()) : ?> | |
- <input id="super_group_<?php echo $_item->getId(); ?>" type="text" pattern="\d*" name="super_group[<?php echo $_item->getId() ?>]" maxlength="12" value="<?php echo $_item->getQty()*1 ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Qty')) ?>" class="input-text qty" /> | |
- <label for="super_group_<?php echo $_item->getId(); ?>" class="qty-label"> | |
+ <input id="super_group_<?php echo $_item->getId() ?>" type="text" pattern="\d*(\.\d+)?" name="super_group[<?php echo $_item->getId() ?>]" maxlength="12" value="<?php echo $_item->getQty() * 1 ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Qty')) ?>" class="input-text qty" /> | |
+ <label for="super_group_<?php echo $_item->getId() ?>" class="qty-label"> | |
<?php echo $this->__('Quantity'); ?> | |
</label> | |
<?php else: ?> | |
diff --git a/app/design/frontend/rwd/default/template/checkout/cart/item/configure/updatecart.phtml b/app/design/frontend/rwd/default/template/checkout/cart/item/configure/updatecart.phtml | |
index 081d501..82fe87f 100644 | |
--- a/app/design/frontend/rwd/default/template/checkout/cart/item/configure/updatecart.phtml | |
+++ b/app/design/frontend/rwd/default/template/checkout/cart/item/configure/updatecart.phtml | |
@@ -32,7 +32,7 @@ | |
<?php if (!$_product->isGrouped()): ?> | |
<div class="qty-wrapper"> | |
<label for="qty"><?php echo $this->__('Qty:') ?></label> | |
- <input type="text" pattern="\d*" name="qty" id="qty" maxlength="12" value="<?php echo $this->getProductDefaultQty() * 1 ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Qty')) ?>" class="input-text qty" /> | |
+ <input type="text" pattern="\d*(\.\d+)?" name="qty" id="qty" maxlength="12" value="<?php echo $this->getProductDefaultQty() * 1 ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Qty')) ?>" class="input-text qty" /> | |
</div> | |
<?php endif; ?> | |
<div class="add-to-cart-buttons"> | |
diff --git a/app/design/frontend/rwd/default/template/checkout/cart/item/default.phtml b/app/design/frontend/rwd/default/template/checkout/cart/item/default.phtml | |
index c116e1f..9750fcd 100644 | |
--- a/app/design/frontend/rwd/default/template/checkout/cart/item/default.phtml | |
+++ b/app/design/frontend/rwd/default/template/checkout/cart/item/default.phtml | |
@@ -205,7 +205,7 @@ $canApplyMsrp = Mage::helper('catalog')->canApplyMsrp($_item->getProduct(), Mage | |
<?php endif; ?> | |
<?php endif; ?> | |
<td class="product-cart-actions" data-rwd-label="<?php echo $this->__('Qty'); ?>"> | |
- <input type="text" pattern="\d*" name="cart[<?php echo $_item->getId() ?>][qty]" value="<?php echo $this->getQty() ?>" size="4" | |
+ <input type="text" pattern="\d*(\.\d+)?" name="cart[<?php echo $_item->getId() ?>][qty]" value="<?php echo $this->getQty() ?>" size="4" | |
data-cart-item-id="<?php echo $this->jsQuoteEscape($_item->getSku()) ?>" | |
title="<?php echo Mage::helper('core')->quoteEscape($this->__('Qty')) ?>" class="input-text qty" maxlength="12" /> | |
diff --git a/app/design/frontend/rwd/default/template/checkout/cart/render/default.phtml b/app/design/frontend/rwd/default/template/checkout/cart/render/default.phtml | |
index 9eaa25a..9502ca7 100644 | |
--- a/app/design/frontend/rwd/default/template/checkout/cart/render/default.phtml | |
+++ b/app/design/frontend/rwd/default/template/checkout/cart/render/default.phtml | |
@@ -55,7 +55,7 @@ | |
</td> | |
<?php endif; ?> | |
<td class="a-center"> | |
- <input type="text" pattern="\d*" name="cart[<?php echo $_item->getId() ?>][qty]" | |
+ <input type="text" pattern="\d*(\.\d+)?" name="cart[<?php echo $_item->getId() ?>][qty]" | |
data-cart-item-id="<?php echo $this->jsQuoteEscape($_item->getSku()) ?>" | |
value="<?php echo $this->getItemQty($_item) ?>" size="4" class="input-text qty" maxlength="12" /> | |
</td> | |
diff --git a/app/design/frontend/rwd/default/template/checkout/cart/render/simple.phtml b/app/design/frontend/rwd/default/template/checkout/cart/render/simple.phtml | |
index 5ac6360..95c1b17 100644 | |
--- a/app/design/frontend/rwd/default/template/checkout/cart/render/simple.phtml | |
+++ b/app/design/frontend/rwd/default/template/checkout/cart/render/simple.phtml | |
@@ -55,7 +55,7 @@ | |
</td> | |
<?php endif; ?> | |
<td class="a-center"> | |
- <input type="text" pattern="\d*" name="cart[<?php echo $_item->getId() ?>][qty]" | |
+ <input type="text" pattern="\d*(\.\d+)?" name="cart[<?php echo $_item->getId() ?>][qty]" | |
data-cart-item-id="<?php echo $this->jsQuoteEscape($_item->getSku()) ?>" | |
value="<?php echo $this->getItemQty($_item) ?>" size="4" class="input-text qty" maxlength="12" /> | |
</td> | |
diff --git a/app/design/frontend/rwd/default/template/checkout/onepage/payment.phtml b/app/design/frontend/rwd/default/template/checkout/onepage/payment.phtml | |
index 64c07da..52accb1 100644 | |
--- a/app/design/frontend/rwd/default/template/checkout/onepage/payment.phtml | |
+++ b/app/design/frontend/rwd/default/template/checkout/onepage/payment.phtml | |
@@ -28,6 +28,7 @@ | |
//<![CDATA[ | |
var quoteBaseGrandTotal = <?php echo (float)$this->getQuoteBaseGrandTotal(); ?>; | |
var checkQuoteBaseGrandTotal = quoteBaseGrandTotal; | |
+ var quoteGrandTotalClean = quoteBaseGrandTotal; | |
var payment = new Payment('co-payment-form', '<?php echo $this->getUrl('checkout/onepage/savePayment') ?>'); | |
var lastPrice; | |
//]]> | |
diff --git a/app/design/frontend/rwd/default/template/configurableswatches/catalog/product/list/price/js.phtml b/app/design/frontend/rwd/default/template/configurableswatches/catalog/product/list/price/js.phtml | |
new file mode 100644 | |
index 0000000..c96f268 | |
--- /dev/null | |
+++ b/app/design/frontend/rwd/default/template/configurableswatches/catalog/product/list/price/js.phtml | |
@@ -0,0 +1,32 @@ | |
+<?php | |
+/** | |
+ * Magento | |
+ * | |
+ * NOTICE OF LICENSE | |
+ * | |
+ * This source file is subject to the Academic Free License (AFL 3.0) | |
+ * that is bundled with this package in the file LICENSE_AFL.txt. | |
+ * It is also available through the world-wide-web at this URL: | |
+ * http://opensource.org/licenses/afl-3.0.php | |
+ * If you did not receive a copy of the license and are unable to | |
+ * obtain it through the world-wide-web, please send an email | |
+ * to [email protected] so we can send you a copy immediately. | |
+ * | |
+ * DISCLAIMER | |
+ * | |
+ * Do not edit or add to this file if you wish to upgrade Magento to newer | |
+ * versions in the future. If you wish to customize Magento for your | |
+ * needs please refer to http://www.magento.com for more information. | |
+ * | |
+ * @category design | |
+ * @package rwd_default | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
+ */ | |
+/** | |
+ * @var $this Mage_ConfigurableSwatches_Block_Catalog_Product_List_Price | |
+ */ | |
+?> | |
+<script type="text/javascript"> | |
+ new ConfigurableSwatchPrices(<?php echo $this->getJsonConfig(); ?>); | |
+</script> | |
diff --git a/app/design/frontend/rwd/default/template/configurableswatches/catalog/product/list/swatches.phtml b/app/design/frontend/rwd/default/template/configurableswatches/catalog/product/list/swatches.phtml | |
index 4378522..2eb9a0a 100644 | |
--- a/app/design/frontend/rwd/default/template/configurableswatches/catalog/product/list/swatches.phtml | |
+++ b/app/design/frontend/rwd/default/template/configurableswatches/catalog/product/list/swatches.phtml | |
@@ -29,7 +29,7 @@ $_product = $this->getProduct(); | |
if (Mage::helper('configurableswatches')->isEnabled() && $_product && $_product->getId() | |
&& ($_attrValues = $_product->getListSwatchAttrValues()) && count($_attrValues) > 0): | |
- | |
+ $_attrStockValues = $_product->getListSwatchAttrStockValues(); | |
$_swatchAttribute = Mage::helper('configurableswatches/productlist')->getSwatchAttribute(); | |
$_dimHelper = Mage::helper('configurableswatches/swatchdimensions'); | |
@@ -69,6 +69,9 @@ if (Mage::helper('configurableswatches')->isEnabled() && $_product && $_product- | |
<?php echo $_optionLabel; ?> | |
<?php endif; ?> | |
</span> | |
+ <?php if (isset($_attrStockValues[$_optionValue]) && !$_attrStockValues[$_optionValue]): ?> | |
+ <span class="x" style="display: none"></span> | |
+ <?php endif; ?> | |
</a> | |
</li> | |
<?php endforeach; ?> | |
diff --git a/app/design/frontend/rwd/default/template/customer/form/edit.phtml b/app/design/frontend/rwd/default/template/customer/form/edit.phtml | |
index f2e3a8e..15df683 100644 | |
--- a/app/design/frontend/rwd/default/template/customer/form/edit.phtml | |
+++ b/app/design/frontend/rwd/default/template/customer/form/edit.phtml | |
@@ -55,6 +55,14 @@ | |
<?php if ($_gender->isEnabled()): ?> | |
<li><?php echo $_gender->setGender($this->getCustomer()->getGender())->toHtml() ?></li> | |
<?php endif ?> | |
+ <li> | |
+ <label for="current_password" class="required"><em>*</em><?php echo Mage::helper('core')->quoteEscape($this->__('Current Password')) ?></label> | |
+ <div class="input-box"> | |
+ <!-- This is a dummy hidden field to trick firefox from auto filling the password --> | |
+ <input type="text" class="input-text no-display" name="dummy" id="dummy" /> | |
+ <input type="password" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Current Password')) ?>" class="input-text required-entry" name="current_password" id="current_password" /> | |
+ </div> | |
+ </li> | |
<li class="control"> | |
<input type="checkbox" name="change_password" id="change_password" value="1" onclick="setPasswordForm(this.checked)" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Change Password')) ?>"<?php if($this->getCustomer()->getChangePassword()==1): ?> checked="checked"<?php endif; ?> class="checkbox" /><label for="change_password"><?php echo $this->__('Change Password') ?></label> | |
</li> | |
@@ -63,25 +71,17 @@ | |
<div class="fieldset" style="display:none;"> | |
<h2 class="legend"><?php echo $this->__('Change Password') ?></h2> | |
<ul class="form-list"> | |
- <li> | |
- <label for="current_password" class="required"><em>*</em><?php echo $this->__('Current Password') ?></label> | |
- <div class="input-box"> | |
- <!-- This is a dummy hidden field to trick firefox from auto filling the password --> | |
- <input type="text" class="input-text no-display" name="dummy" id="dummy" /> | |
- <input type="password" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Current Password')) ?>" class="input-text" name="current_password" id="current_password" /> | |
- </div> | |
- </li> | |
<li class="fields"> | |
<div class="field"> | |
<label for="password" class="required"><em>*</em><?php echo $this->__('New Password') ?></label> | |
<div class="input-box"> | |
- <input type="password" title="<?php echo Mage::helper('core')->quoteEscape($this->__('New Password')) ?>" class="input-text validate-password" name="password" id="password" /> | |
+ <input type="password" title="<?php echo Mage::helper('core')->quoteEscape($this->__('New Password')) ?>" class="input-text required-entry validate-password" name="password" id="password" /> | |
</div> | |
</div> | |
<div class="field"> | |
<label for="confirmation" class="required"><em>*</em><?php echo $this->__('Confirm New Password') ?></label> | |
<div class="input-box"> | |
- <input type="password" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Confirm New Password')) ?>" class="input-text validate-cpassword" name="confirmation" id="confirmation" /> | |
+ <input type="password" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Confirm New Password')) ?>" class="input-text required-entry validate-cpassword" name="confirmation" id="confirmation" /> | |
</div> | |
</div> | |
</li> | |
@@ -96,18 +96,7 @@ | |
//<![CDATA[ | |
var dataForm = new VarienForm('form-validate', true); | |
function setPasswordForm(arg){ | |
- if(arg){ | |
- $('current_password').up(3).show(); | |
- $('current_password').addClassName('required-entry'); | |
- $('password').addClassName('required-entry'); | |
- $('confirmation').addClassName('required-entry'); | |
- | |
- }else{ | |
- $('current_password').up(3).hide(); | |
- $('current_password').removeClassName('required-entry'); | |
- $('password').removeClassName('required-entry'); | |
- $('confirmation').removeClassName('required-entry'); | |
- } | |
+ $('password').up('.fieldset')[arg ? 'show': 'hide'](); | |
} | |
<?php if($this->getCustomer()->getChangePassword()): ?> | |
diff --git a/app/design/frontend/rwd/default/template/downloadable/checkout/cart/item/default.phtml b/app/design/frontend/rwd/default/template/downloadable/checkout/cart/item/default.phtml | |
index 8f3db2e..f544403 100644 | |
--- a/app/design/frontend/rwd/default/template/downloadable/checkout/cart/item/default.phtml | |
+++ b/app/design/frontend/rwd/default/template/downloadable/checkout/cart/item/default.phtml | |
@@ -212,7 +212,7 @@ $canApplyMsrp = Mage::helper('catalog')->canApplyMsrp($_item->getProduct(), Mage | |
<?php endif; ?> | |
<?php endif; ?> | |
<td class="product-cart-actions" data-rwd-label="<?php echo $this->__('Qty'); ?>"> | |
- <input type="text" pattern="\d*" name="cart[<?php echo $_item->getId() ?>][qty]" value="<?php echo $this->getQty() ?>" | |
+ <input type="text" pattern="\d*(\.\d+)?" name="cart[<?php echo $_item->getId() ?>][qty]" value="<?php echo $this->getQty() ?>" | |
data-cart-item-id="<?php echo $this->jsQuoteEscape($_item->getSku()) ?>" | |
size="4" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Qty')) ?>" class="input-text qty" maxlength="12" /> | |
diff --git a/app/design/frontend/rwd/default/template/wishlist/item/column/quantity.phtml b/app/design/frontend/rwd/default/template/wishlist/item/column/quantity.phtml | |
index 8b045fc..b472ce8 100644 | |
--- a/app/design/frontend/rwd/default/template/wishlist/item/column/quantity.phtml | |
+++ b/app/design/frontend/rwd/default/template/wishlist/item/column/quantity.phtml | |
@@ -35,7 +35,7 @@ $options = $this->getChild('customer.wishlist.item.options') | |
<div class="cart-cell"> | |
<div class="add-to-cart-alt"> | |
<?php if ($item->canHaveQty() && $item->getProduct()->isVisibleInSiteVisibility()): ?> | |
- <input type="text" pattern="\d*" class="input-text qty validate-not-negative-number" name="qty[<?php echo $item->getId() ?>]" value="<?php echo $this->getAddToCartQty($item) * 1 ?>" /> | |
+ <input type="text" pattern="\d*(\.\d+)?" class="input-text qty validate-not-negative-number" name="qty[<?php echo $item->getId() ?>]" value="<?php echo $this->getAddToCartQty($item) * 1 ?>" /> | |
<?php endif; ?> | |
</div> | |
</div> | |
diff --git a/app/design/install/default/default/template/install/create_admin.phtml b/app/design/install/default/default/template/install/create_admin.phtml | |
index 8368bf7..1733303 100644 | |
--- a/app/design/install/default/default/template/install/create_admin.phtml | |
+++ b/app/design/install/default/default/template/install/create_admin.phtml | |
@@ -66,11 +66,11 @@ | |
<li> | |
<div class="input-box"> | |
<label for="password"><?php echo $this->__('Password') ?> <span class="required">*</span></label><br/> | |
- <input type="password" name="admin[new_password]" id="password" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Password')) ?>" class="required-entry validate-admin-password input-text"/> | |
+ <input type="password" name="admin[new_password]" id="password" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Password')) ?>" class="required-entry validate-admin-password input-text" autocomplete="off"/> | |
</div> | |
<div class="input-box"> | |
<label for="confirmation"><?php echo $this->__('Confirm Password') ?> <span class="required">*</span></label><br/> | |
- <input type="password" name="admin[password_confirmation]" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Password Confirmation')) ?>" id="confirmation" class="required-entry validate-cpassword input-text"/> | |
+ <input type="password" name="admin[password_confirmation]" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Password Confirmation')) ?>" id="confirmation" class="required-entry validate-cpassword input-text" autocomplete="off"/> | |
</div> | |
</li> | |
</ul> | |
diff --git a/app/design/install/default/default/template/install/state.phtml b/app/design/install/default/default/template/install/state.phtml | |
index cba70b1..e77b760 100644 | |
--- a/app/design/install/default/default/template/install/state.phtml | |
+++ b/app/design/install/default/default/template/install/state.phtml | |
@@ -40,7 +40,7 @@ | |
<br/> | |
<p> | |
<?php echo $this->__('Having trouble installing Magento?') ?> | |
- <?php echo $this->__('Check out our') ?> <a href="http://www.magentocommerce.com/knowledge-base/entry/magento-installation-cheat-sheet" id="installation_guide_link"><?php echo $this->__('Installation Guide') ?></a> | |
+ <?php echo $this->__('Check out our') ?> <a href="http://www.magentocommerce.com/knowledge-base/entry/magento-installation-guide" id="installation_guide_link"><?php echo $this->__('Installation Guide') ?></a> | |
<script type="text/javascript"> | |
$('installation_guide_link').target = "installation_guide"; | |
</script> | |
diff --git a/app/locale/en_US/Mage_Adminhtml.csv b/app/locale/en_US/Mage_Adminhtml.csv | |
index e9c476e..a399e98 100644 | |
--- a/app/locale/en_US/Mage_Adminhtml.csv | |
+++ b/app/locale/en_US/Mage_Adminhtml.csv | |
@@ -186,6 +186,9 @@ | |
"Both IPN and PDT","Both IPN and PDT" | |
"Browse Files...","Browse Files..." | |
"Bundle with dynamic pricing cannot include custom defined options. Options will not be saved.","Bundle with dynamic pricing cannot include custom defined options. Options will not be saved." | |
+"By Email","By Email" | |
+"By IP","By IP" | |
+"By IP and Email","By IP and Email" | |
"CMS","CMS" | |
"CRITICAL","CRITICAL" | |
"CSV","CSV" | |
@@ -1017,6 +1020,7 @@ | |
"The Layered Navigation indices were refreshed.","The Layered Navigation indices were refreshed." | |
"The Layered Navigation process has been queued to be killed.","The Layered Navigation process has been queued to be killed." | |
"The Magento cache storage has been flushed.","The Magento cache storage has been flushed." | |
+"The Special Price is active only when lower than the Actual Price.","The Special Price is active only when lower than the Actual Price." | |
"The URL Rewrite has been deleted.","The URL Rewrite has been deleted." | |
"The URL Rewrite has been saved.","The URL Rewrite has been saved." | |
"The account has been saved.","The account has been saved." | |
diff --git a/app/locale/en_US/Mage_Catalog.csv b/app/locale/en_US/Mage_Catalog.csv | |
index bbdc417..3ae7af5 100644 | |
--- a/app/locale/en_US/Mage_Catalog.csv | |
+++ b/app/locale/en_US/Mage_Catalog.csv | |
@@ -258,6 +258,7 @@ | |
"Details","Details" | |
"Disabled","Disabled" | |
"Disallowed file type.","Disallowed file type." | |
+"Disalollowed file format.","Disalollowed file format." | |
"Display Actual Price","Display Actual Price" | |
"Display Page Control","Display Page Control" | |
"Display Price Interval as One Price","Display Price Interval as One Price" | |
@@ -407,6 +408,9 @@ | |
"Maximum image width","Maximum image width" | |
"Maximum number of characters:","Maximum number of characters:" | |
"Maximum number of price intervals is 100","Maximum number of price intervals is 100" | |
+"Maximum resolution for upload image","Maximum resolution for upload image" | |
+"Maximum width and height dimension for upload image is %s.","Maximum width and height dimension for upload image is %s." | |
+"Maximum width and height resolutions for upload image","Maximum width and height resolutions for upload image" | |
"Maximum width base product image will be scaled down to in pixels","Maximum width base product image will be scaled down to in pixels" | |
"Maximum width small product image will be scaled down to in pixels","Maximum width small product image will be scaled down to in pixels" | |
"Media Image","Media Image" | |
diff --git a/app/locale/en_US/Mage_CatalogInventory.csv b/app/locale/en_US/Mage_CatalogInventory.csv | |
index 4fe9145..20317b2 100644 | |
--- a/app/locale/en_US/Mage_CatalogInventory.csv | |
+++ b/app/locale/en_US/Mage_CatalogInventory.csv | |
@@ -42,6 +42,7 @@ | |
"Rule price","Rule price" | |
"Set Items' Status to be In Stock When Order is Cancelled","Set Items' Status to be In Stock When Order is Cancelled" | |
"Some of the products are currently out of stock.","Some of the products are currently out of stock." | |
+"Some of the products are not available","Some of the products are not available" | |
"Some of the products cannot be ordered in requested quantity.","Some of the products cannot be ordered in requested quantity." | |
"Some of the products cannot be ordered in the requested quantity.","Some of the products cannot be ordered in the requested quantity." | |
"Stock Options","Stock Options" | |
diff --git a/app/locale/en_US/Mage_ConfigurableSwatches.csv b/app/locale/en_US/Mage_ConfigurableSwatches.csv | |
index 80bd69a..4f0bcb5 100644 | |
--- a/app/locale/en_US/Mage_ConfigurableSwatches.csv | |
+++ b/app/locale/en_US/Mage_ConfigurableSwatches.csv | |
@@ -2,6 +2,7 @@ | |
"Add to Cart","Add to Cart" | |
"Choose an Option...","Choose an Option..." | |
"Configurable Swatches","Configurable Swatches" | |
+"Dynamic Price Change for Swatches in Product Listing","Dynamic Price Change for Swatches in Product Listing" | |
"Enabled","Enabled" | |
"General Settings","General Settings" | |
"Height","Height" | |
diff --git a/app/locale/en_US/Mage_Core.csv b/app/locale/en_US/Mage_Core.csv | |
index 8bc4dbd..bab35ae 100644 | |
--- a/app/locale/en_US/Mage_Core.csv | |
+++ b/app/locale/en_US/Mage_Core.csv | |
@@ -219,7 +219,7 @@ | |
"Path ""%value%"" is protected and cannot be used.","Path ""%value%"" is protected and cannot be used." | |
"Path ""%value%"" may not include parent directory traversal (""../"", ""..\\).""","Path ""%value%"" may not include parent directory traversal (""../"", ""..\\).""" | |
"Please define flag code.","Please define flag code." | |
-"Please enter 6 or more characters. Leading or trailing spaces will be ignored.","Please enter 6 or more characters. Leading or trailing spaces will be ignored." | |
+"Please enter 6 or more characters without leading or trailing spaces.","Please enter 6 or more characters without leading or trailing spaces." | |
"Please enter 7 or more characters. Password should contain both numeric and alphabetic characters.","Please enter 7 or more characters. Password should contain both numeric and alphabetic characters." | |
"Please enter a number 0 or greater in this field.","Please enter a number 0 or greater in this field." | |
"Please enter a number 1 or greater in this field.","Please enter a number 1 or greater in this field." | |
@@ -270,6 +270,7 @@ | |
"Port (25)","Port (25)" | |
"Profiler","Profiler" | |
"Recovery Link Expiration Period (days)","Recovery Link Expiration Period (days)" | |
+"Recovery Link Expiration Period (hours)","Recovery Link Expiration Period (hours)" | |
"Request Path for Specified Store","Request Path for Specified Store" | |
"Request path length exceeds allowed %s symbols.","Request path length exceeds allowed %s symbols." | |
"Requested file may not include parent directory traversal (""../"", ""..\\ notation)""","Requested file may not include parent directory traversal (""../"", ""..\\ notation)""" | |
diff --git a/app/locale/en_US/Mage_Customer.csv b/app/locale/en_US/Mage_Customer.csv | |
index 3cd48fd..b2f257c 100644 | |
--- a/app/locale/en_US/Mage_Customer.csv | |
+++ b/app/locale/en_US/Mage_Customer.csv | |
@@ -50,6 +50,9 @@ | |
"Based on the VAT ID, the customer would belong to the Customer Group %s.","Based on the VAT ID, the customer would belong to the Customer Group %s." | |
"Bill to Name","Bill to Name" | |
"Bought From","Bought From" | |
+"By Email","By Email" | |
+"By IP","By IP" | |
+"By IP and Email","By IP and Email" | |
"By creating an account with our store, you will be able to move through the checkout process faster, store multiple shipping addresses, view and track your orders in your account and more.","By creating an account with our store, you will be able to move through the checkout process faster, store multiple shipping addresses, view and track your orders in your account and more." | |
"CSV","CSV" | |
"Cancel","Cancel" | |
@@ -57,10 +60,13 @@ | |
"Cannot save address.","Cannot save address." | |
"Cannot save the customer.","Cannot save the customer." | |
"Cannot share customer accounts globally because some customer accounts with the same emails exist on multiple websites and cannot be merged.","Cannot share customer accounts globally because some customer accounts with the same emails exist on multiple websites and cannot be merged." | |
+"Change Account Data","Change Account Data" | |
"Change Account Password","Change Account Password" | |
"Change Billing Address","Change Billing Address" | |
"Change Password","Change Password" | |
"Change Shipping Address","Change Shipping Address" | |
+"Changed Email or Password Email Template","Changed Email or Password Email Template" | |
+"Changed Password or Email","Changed Password or Email" | |
"City","City" | |
"Company","Company" | |
"Config","Config" | |
@@ -155,6 +161,9 @@ | |
"Forgot Your Password","Forgot Your Password" | |
"Forgot Your Password?","Forgot Your Password?" | |
"Forgot and Remind Email Sender","Forgot and Remind Email Sender" | |
+"Forgot password flow secure","Forgot password flow secure" | |
+"Forgot password requests to times per 24 hours from 1 e-mail","Forgot password requests to times per 24 hours from 1 e-mail" | |
+"Forgot password requests to times per hour from 1 IP","Forgot password requests to times per hour from 1 IP" | |
"Form Fields Before","Form Fields Before" | |
"From your My Account Dashboard you have the ability to view a snapshot of your recent account activity and update your account information. Select a link below to view or edit information.","From your My Account Dashboard you have the ability to view a snapshot of your recent account activity and update your account information. Select a link below to view or edit information." | |
"Gender","Gender" | |
@@ -300,6 +309,7 @@ | |
"Recent Orders","Recent Orders" | |
"Records for %s store found.","Records for %s store found." | |
"Recovery Link Expiration Period (days)","Recovery Link Expiration Period (days)" | |
+"Recovery Link Expiration Period (hours)","Recovery Link Expiration Period (hours)" | |
"Redirect Customer to Account Dashboard after Logging in","Redirect Customer to Account Dashboard after Logging in" | |
"Refunded","Refunded" | |
"Register","Register" | |
@@ -451,6 +461,8 @@ | |
"You are currently subscribed to 'General Subscription'.","You are currently subscribed to 'General Subscription'." | |
"You are currently subscribed to our newsletter.","You are currently subscribed to our newsletter." | |
"You are now logged out","You are now logged out" | |
+"You have exceeded requests to times per 24 hours from 1 e-mail.","You have exceeded requests to times per 24 hours from 1 e-mail." | |
+"You have exceeded requests to times per hour from 1 IP.","You have exceeded requests to times per hour from 1 IP." | |
"You have logged out and will be redirected to our homepage in 5 seconds.","You have logged out and will be redirected to our homepage in 5 seconds." | |
"You have no additional address entries in your address book.","You have no additional address entries in your address book." | |
"You have no additional entries in your address book.","You have no additional entries in your address book." | |
diff --git a/app/locale/en_US/Mage_ImportExport.csv b/app/locale/en_US/Mage_ImportExport.csv | |
index cb39a90..52529cd 100644 | |
--- a/app/locale/en_US/Mage_ImportExport.csv | |
+++ b/app/locale/en_US/Mage_ImportExport.csv | |
@@ -55,6 +55,7 @@ | |
"Header column names already set","Header column names already set" | |
"Import","Import" | |
"Import Behavior","Import Behavior" | |
+"Import CSV","Import CSV" | |
"Import Settings","Import Settings" | |
"Import has been done successfuly.","Import has been done successfuly." | |
"Import successfully done.","Import successfully done." | |
diff --git a/app/locale/en_US/Mage_Rss.csv b/app/locale/en_US/Mage_Rss.csv | |
index 8cd9c33..f539487 100644 | |
--- a/app/locale/en_US/Mage_Rss.csv | |
+++ b/app/locale/en_US/Mage_Rss.csv | |
@@ -3,6 +3,8 @@ | |
"%s RSS Feed","%s RSS Feed" | |
"%s has reached a quantity of %s.","%s has reached a quantity of %s." | |
"%s\'s Wishlist","%s\'s Wishlist" | |
+"Admin Catalog","Admin Catalog" | |
+"Admin Order","Admin Order" | |
"Cannot retrieve the wishlist","Cannot retrieve the wishlist" | |
"Catalog","Catalog" | |
"Category Feeds","Category Feeds" | |
@@ -11,6 +13,7 @@ | |
"Coupons/Discounts","Coupons/Discounts" | |
"Current Status: %s<br/>","Current Status: %s<br/>" | |
"Customer Name: %s","Customer Name: %s" | |
+"Customer Order Notification","Customer Order Notification" | |
"Customer Order Status Notification","Customer Order Status Notification" | |
"Details for %s #%s","Details for %s #%s" | |
"Discount","Discount" | |
@@ -24,10 +27,12 @@ | |
"Low Stock Products","Low Stock Products" | |
"Message:","Message:" | |
"Miscellaneous Feeds","Miscellaneous Feeds" | |
+"New Order Notification","New Order Notification" | |
"New Orders","New Orders" | |
"New Products","New Products" | |
"New Products from %s","New Products from %s" | |
"Notified Date: %s<br/>","Notified Date: %s<br/>" | |
+"Order","Order" | |
"Order # %s Notification(s)","Order # %s Notification(s)" | |
"Order #%s created at %s","Order #%s created at %s" | |
"Pending product review(s)","Pending product review(s)" | |
@@ -39,10 +44,12 @@ | |
"RSS Feeds","RSS Feeds" | |
"RSS Feeds List","RSS Feeds List" | |
"RSS Feeds Section","RSS Feeds Section" | |
+"Review Notification","Review Notification" | |
"Review: %s <br/>","Review: %s <br/>" | |
"Rss Config","Rss Config" | |
"Shipping & Handling","Shipping & Handling" | |
"Special Products","Special Products" | |
+"Stock Notification","Stock Notification" | |
"Store: %s <br/>","Store: %s <br/>" | |
"Subtotal","Subtotal" | |
"Summary of review: %s <br/>","Summary of review: %s <br/>" | |
diff --git a/app/locale/en_US/Mage_Uploader.csv b/app/locale/en_US/Mage_Uploader.csv | |
index c246b24..46ba3c4 100644 | |
--- a/app/locale/en_US/Mage_Uploader.csv | |
+++ b/app/locale/en_US/Mage_Uploader.csv | |
@@ -1,8 +1,9 @@ | |
+"...","..." | |
"Browse Files...","Browse Files..." | |
-"Upload Files","Upload Files" | |
-"Remove", "Remove" | |
-"There are files that were selected but not uploaded yet. After switching to another tab your selections will be lost. Do you wish to continue ?", "There are files that were selected but not uploaded yet. After switching to another tab your selections will be lost. Do you wish to continue ?" | |
+"Complete","Complete" | |
"Maximum allowed file size for upload is","Maximum allowed file size for upload is" | |
"Please check your server PHP settings.","Please check your server PHP settings." | |
+"Remove","Remove" | |
+"There are files that were selected but not uploaded yet. After switching to another tab your selections will be lost. Do you wish to continue ?","There are files that were selected but not uploaded yet. After switching to another tab your selections will be lost. Do you wish to continue ?" | |
+"Upload Files","Upload Files" | |
"Uploading...","Uploading..." | |
-"Complete","Complete" | |
\ No newline at end of file | |
diff --git a/app/locale/en_US/Mage_Usa.csv b/app/locale/en_US/Mage_Usa.csv | |
index 072170d..ec659e3 100644 | |
--- a/app/locale/en_US/Mage_Usa.csv | |
+++ b/app/locale/en_US/Mage_Usa.csv | |
@@ -66,6 +66,7 @@ | |
"Economy select","Economy select" | |
"Empty response","Empty response" | |
"Enable Negotiated Rates","Enable Negotiated Rates" | |
+"Enable SSL Verification","Enable SSL Verification" | |
"Enabled for Checkout","Enabled for Checkout" | |
"Enables/Disables SSL verification of Magento server by UPS.","Enables/Disables SSL verification of Magento server by UPS." | |
"Error #%s : %s","Error #%s : %s" | |
@@ -99,8 +100,10 @@ | |
"First-Class Mail Large Envelope","First-Class Mail Large Envelope" | |
"First-Class Mail Large Postcards","First-Class Mail Large Postcards" | |
"First-Class Mail Letter","First-Class Mail Letter" | |
+"First-Class Mail Metered Letter","First-Class Mail Metered Letter" | |
"First-Class Mail Parcel","First-Class Mail Parcel" | |
"First-Class Mail Postcards","First-Class Mail Postcards" | |
+"First-Class Mail Stamped Letter","First-Class Mail Stamped Letter" | |
"First-Class Package International Service","First-Class Package International Service" | |
"First-Class Package Service","First-Class Package Service" | |
"First-Class Package Service Hold For Pickup","First-Class Package Service Hold For Pickup" | |
diff --git a/app/locale/en_US/template/email/password_or_email_changed.html b/app/locale/en_US/template/email/password_or_email_changed.html | |
new file mode 100644 | |
index 0000000..e486d7b | |
--- /dev/null | |
+++ b/app/locale/en_US/template/email/password_or_email_changed.html | |
@@ -0,0 +1,34 @@ | |
+<!--@subject Your password or email changed at {{var store.getFrontendName()}} @--> | |
+<!--@vars | |
+{"store url=\"\"":"Store Url", | |
+"var logo_url":"Email Logo Image Url", | |
+"var logo_alt":"Email Logo Image Alt", | |
+"store url=\"customer/account/\"":"Customer Account Url", | |
+"var customer.email":"Customer Email", | |
+"var customer.is_change_email":"Customer Flag Email Change", | |
+"var customer.is_change_password":"Customer Flag Password Change", | |
+"htmlescape var=$customer.name":"Customer Name"} | |
+@--> | |
+<!--@styles | |
+@--> | |
+ | |
+{{template config_path="design/email/header"}} | |
+{{inlinecss file="email-inline.css"}} | |
+ | |
+<table cellpadding="0" cellspacing="0" border="0"> | |
+ <tr> | |
+ <td class="action-content"> | |
+ <h1>Hello {{htmlescape var=$customer.name}},</h1> | |
+ {{if customer.is_change_password}} | |
+ <p>We have received a request to change password associated with your account at {{var store.getFrontendName()}}.</p> | |
+ {{/if}} | |
+ {{if customer.is_change_email}} | |
+ <br>We have received a request to change email associated with your account at {{var store.getFrontendName()}}.<br /> | |
+ <strong>Your new email is:</strong> {{var customer.email}}</p> | |
+ {{/if}} | |
+ <p>If you have not authorized this action, please contact us immediately {{depend store_phone}} at <a href="tel:{{var store_phone}}">{{var store_phone}}</a>{{/depend}}.</p> | |
+ </td> | |
+ </tr> | |
+</table> | |
+ | |
+{{template config_path="design/email/footer"}} | |
diff --git a/cron.php b/cron.php | |
index 559ecc9..e382c20 100644 | |
--- a/cron.php | |
+++ b/cron.php | |
@@ -44,7 +44,7 @@ Mage::app('admin')->setUseSessionInUrl(false); | |
umask(0); | |
-$disabledFuncs = explode(',', ini_get('disable_functions')); | |
+$disabledFuncs = array_map('trim', explode(',', strtolower(ini_get('disable_functions')))); | |
$isShellDisabled = is_array($disabledFuncs) ? in_array('shell_exec', $disabledFuncs) : true; | |
$isShellDisabled = (stripos(PHP_OS, 'win') === false) ? $isShellDisabled : true; | |
diff --git a/errors/processor.php b/errors/processor.php | |
index 297e5c6..bff1065 100644 | |
--- a/errors/processor.php | |
+++ b/errors/processor.php | |
@@ -232,9 +232,12 @@ class Error_Processor | |
} | |
$isSecure = (!empty($_SERVER['HTTPS'])) && ($_SERVER['HTTPS'] != 'off'); | |
- $url = ($isSecure ? 'https://' : 'http://') . $host; | |
+ $url = ($isSecure ? 'https://' : 'http://') . htmlspecialchars($host, ENT_COMPAT | ENT_HTML401, 'UTF-8'); | |
- if (!empty($_SERVER['SERVER_PORT']) && !in_array($_SERVER['SERVER_PORT'], array(80, 433))) { | |
+ if (!empty($_SERVER['SERVER_PORT']) | |
+ && preg_match('/\d+/', $_SERVER['SERVER_PORT']) | |
+ && !in_array($_SERVER['SERVER_PORT'], array(80, 433)) | |
+ ) { | |
$url .= ':' . $_SERVER['SERVER_PORT']; | |
} | |
return $url; | |
@@ -439,10 +442,11 @@ class Error_Processor | |
$this->reportData['url'] = ''; | |
} | |
else { | |
- $this->reportData['url'] = $this->getHostUrl() . $reportData['url']; | |
+ $this->reportData['url'] = $this->getHostUrl() | |
+ . htmlspecialchars($reportData['url'], ENT_COMPAT | ENT_HTML401, 'UTF-8'); | |
} | |
- if ($this->reportData['script_name']) { | |
+ if (isset($this->reportData['script_name'])) { | |
$this->_scriptName = $this->reportData['script_name']; | |
} | |
} | |
@@ -474,7 +478,7 @@ class Error_Processor | |
if (headers_sent()) { | |
print '<script type="text/javascript">'; | |
- print "window.location.href = '{$this->reportUrl}';"; | |
+ print "window.location.href = encodeURI('{$this->reportUrl}');"; | |
print '</script>'; | |
exit; | |
} | |
@@ -487,6 +491,7 @@ class Error_Processor | |
*/ | |
public function loadReport($reportId) | |
{ | |
+ $reportData = false; | |
$this->reportId = $reportId; | |
$this->_reportFile = $this->_reportDir . '/' . $reportId; | |
@@ -494,7 +499,14 @@ class Error_Processor | |
header("Location: " . $this->getBaseUrl()); | |
die(); | |
} | |
- $this->_setReportData(unserialize(file_get_contents($this->_reportFile))); | |
+ | |
+ $reportContent = file_get_contents($this->_reportFile); | |
+ if (!preg_match('/[oc]:[+\-]?\d+:"/i', $reportContent )) { | |
+ $reportData = unserialize($reportContent ); | |
+ } | |
+ if (is_array($reportData)) { | |
+ $this->_setReportData($reportData); | |
+ } | |
} | |
/** | |
@@ -510,11 +522,11 @@ class Error_Processor | |
$this->postData['email'] = (isset($_POST['email'])) ? trim(htmlspecialchars($_POST['email'])) : ''; | |
$this->postData['telephone'] = (isset($_POST['telephone'])) ? trim(htmlspecialchars($_POST['telephone'])) : ''; | |
$this->postData['comment'] = (isset($_POST['comment'])) ? trim(htmlspecialchars($_POST['comment'])) : ''; | |
+ $url = htmlspecialchars($this->reportData['url'], ENT_COMPAT | ENT_HTML401); | |
if (isset($_POST['submit'])) { | |
if ($this->_validate()) { | |
- | |
- $msg = "URL: {$this->reportData['url']}\n" | |
+ $msg = "URL: {$url}\n" | |
. "IP Address: {$this->_getClientIp()}\n" | |
. "First Name: {$this->postData['firstName']}\n" | |
. "Last Name: {$this->postData['lastName']}\n" | |
@@ -537,7 +549,7 @@ class Error_Processor | |
} else { | |
$time = gmdate('Y-m-d H:i:s \G\M\T'); | |
- $msg = "URL: {$this->reportData['url']}\n" | |
+ $msg = "URL: {$url}\n" | |
. "IP Address: {$this->_getClientIp()}\n" | |
. "Time: {$time}\n" | |
. "Error:\n{$this->reportData[0]}\n\n" | |
diff --git a/js/lib/jquery/noconflict.js b/js/lib/jquery/noconflict.js | |
index 3ef7a2f..8b42515 100644 | |
--- a/js/lib/jquery/noconflict.js | |
+++ b/js/lib/jquery/noconflict.js | |
@@ -9,17 +9,17 @@ | |
* http://opensource.org/licenses/afl-3.0.php | |
* If you did not receive a copy of the license and are unable to | |
* obtain it through the world-wide-web, please send an email | |
- * to [email protected] so we can send you a copy immediately. | |
+ * to [email protected] so we can send you a copy immediately. | |
* | |
* DISCLAIMER | |
* | |
* Do not edit or add to this file if you wish to upgrade Magento to newer | |
* versions in the future. If you wish to customize Magento for your | |
- * needs please refer to http://www.magentocommerce.com for more information. | |
+ * needs please refer to http://www.magento.com for more information. | |
* | |
- * @category design | |
- * @package rwd_default | |
- * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com) | |
+ * @category Mage | |
+ * @package js | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/js/lib/uploader/fusty-flow.js b/js/lib/uploader/fusty-flow.js | |
index 4519a81..78b3542 100644 | |
--- a/js/lib/uploader/fusty-flow.js | |
+++ b/js/lib/uploader/fusty-flow.js | |
@@ -426,3 +426,4 @@ | |
window.FustyFlow = FustyFlow; | |
} | |
})(window.Flow, window, document); | |
+ | |
diff --git a/js/mage/adminhtml/accordion.js b/js/mage/adminhtml/accordion.js | |
index c086e6f..2dace58 100644 | |
--- a/js/mage/adminhtml/accordion.js | |
+++ b/js/mage/adminhtml/accordion.js | |
@@ -136,4 +136,4 @@ varienAccordion.prototype = { | |
} | |
} | |
} | |
-} | |
+}; | |
diff --git a/js/mage/adminhtml/backup.js b/js/mage/adminhtml/backup.js | |
index 8c816ea..855716b 100644 | |
--- a/js/mage/adminhtml/backup.js | |
+++ b/js/mage/adminhtml/backup.js | |
@@ -189,4 +189,4 @@ AdminBackup.prototype = { | |
$$('.backup-dialog').each(Element.hide); | |
$('popup-window-mask').hide(); | |
} | |
-} | |
+}; | |
diff --git a/js/mage/adminhtml/browser.js b/js/mage/adminhtml/browser.js | |
index b6d1481..e956f57 100644 | |
--- a/js/mage/adminhtml/browser.js | |
+++ b/js/mage/adminhtml/browser.js | |
@@ -140,7 +140,7 @@ Mediabrowser.prototype = { | |
var div = Event.findElement(event, 'DIV'); | |
$$('div.filecnt.selected[id!="' + div.id + '"]').each(function(e) { | |
e.removeClassName('selected'); | |
- }) | |
+ }); | |
div.toggleClassName('selected'); | |
if(div.hasClassName('selected')) { | |
this.showFileButtons(); | |
@@ -265,7 +265,7 @@ Mediabrowser.prototype = { | |
try { | |
this.onAjaxSuccess(transport); | |
if (transport.responseText.isJSON()) { | |
- var response = transport.responseText.evalJSON() | |
+ var response = transport.responseText.evalJSON(); | |
var newNode = new Ext.tree.AsyncTreeNode({ | |
text: response.short_name, | |
draggable:false, | |
@@ -281,7 +281,7 @@ Mediabrowser.prototype = { | |
alert(e.message); | |
} | |
}.bind(this) | |
- }) | |
+ }); | |
}, | |
deleteFolder: function() { | |
@@ -300,7 +300,7 @@ Mediabrowser.prototype = { | |
alert(e.message); | |
} | |
}.bind(this) | |
- }) | |
+ }); | |
}, | |
deleteFiles: function() { | |
@@ -384,7 +384,7 @@ Mediabrowser.prototype = { | |
onAjaxSuccess: function(transport) { | |
if (transport.responseText.isJSON()) { | |
- var response = transport.responseText.evalJSON() | |
+ var response = transport.responseText.evalJSON(); | |
if (response.error) { | |
throw response; | |
} else if (response.ajaxExpired && response.ajaxRedirect) { | |
@@ -392,4 +392,4 @@ Mediabrowser.prototype = { | |
} | |
} | |
} | |
-} | |
+}; | |
diff --git a/js/mage/adminhtml/events.js b/js/mage/adminhtml/events.js | |
index 1062ab2..91c1ded 100644 | |
--- a/js/mage/adminhtml/events.js | |
+++ b/js/mage/adminhtml/events.js | |
@@ -102,7 +102,9 @@ varienEvents.prototype = { | |
if (this.arrEvents[evtName][i].asynch) { | |
var eventArgs = arguments[1]; | |
var method = this.arrEvents[evtName][i].method.bind(this); | |
- setTimeout(function() { method(eventArgs) }.bind(this), 10); | |
+ setTimeout(function() { | |
+ method(eventArgs); | |
+ }.bind(this), 10); | |
} | |
else{ | |
result = this.arrEvents[evtName][i].method(arguments[1]); | |
diff --git a/js/mage/adminhtml/flexuploader.js b/js/mage/adminhtml/flexuploader.js | |
index b735955..b1749e4 100644 | |
--- a/js/mage/adminhtml/flexuploader.js | |
+++ b/js/mage/adminhtml/flexuploader.js | |
@@ -303,9 +303,9 @@ if(!window.Flex) { | |
this.files.each(function(file){ | |
if (file.size > maxUploadFileSizeInBytes) { | |
hasTooBigFiles = true; | |
- this.uploader.removeFile(file.id) | |
+ this.uploader.removeFile(file.id); | |
} else { | |
- newFiles.push(file) | |
+ newFiles.push(file); | |
} | |
}.bind(this)); | |
this.files = newFiles; | |
@@ -363,10 +363,10 @@ if(!window.Flex) { | |
checkAllComplete: function() { | |
if (this.files) { | |
return !this.files.any(function(file) { | |
- return (file.status !== 'full_complete') | |
+ return (file.status !== 'full_complete'); | |
}); | |
} | |
return true; | |
} | |
- } | |
+ }; | |
} | |
diff --git a/js/mage/adminhtml/form.js b/js/mage/adminhtml/form.js | |
index 8ea34b9..17d10e6 100644 | |
--- a/js/mage/adminhtml/form.js | |
+++ b/js/mage/adminhtml/form.js | |
@@ -107,7 +107,7 @@ varienForm.prototype = { | |
} | |
$form.submit(); | |
} | |
-} | |
+}; | |
/** | |
* redeclare Validation.isVisible function | |
@@ -124,7 +124,7 @@ Validation.isVisible = function(elm){ | |
elm = elm.parentNode; | |
} | |
return true; | |
-} | |
+}; | |
/** | |
* Additional elements methods | |
@@ -135,7 +135,7 @@ var varienElementMethods = { | |
var elm = element; | |
while(elm && elm.tagName != 'BODY') { | |
if(elm.statusBar) | |
- Element.addClassName($(elm.statusBar), 'changed') | |
+ Element.addClassName($(elm.statusBar), 'changed'); | |
elm = elm.parentNode; | |
} | |
}, | |
@@ -154,14 +154,14 @@ var varienElementMethods = { | |
form.errorSections.set(elm.statusBar.id, flag); | |
} | |
else if(!form.errorSections.get(elm.statusBar.id)){ | |
- Element.removeClassName($(elm.statusBar), 'error') | |
+ Element.removeClassName($(elm.statusBar), 'error'); | |
} | |
} | |
elm = elm.parentNode; | |
} | |
this.canShowElement = false; | |
} | |
-} | |
+}; | |
Element.addMethods(varienElementMethods); | |
@@ -388,7 +388,7 @@ RegionUpdater.prototype = { | |
$(elem).value = currentVal; | |
return; | |
} | |
-} | |
+}; | |
regionUpdater = RegionUpdater; | |
@@ -402,7 +402,7 @@ Event.pointerX = function(event){ | |
catch(e){ | |
} | |
-} | |
+}; | |
Event.pointerY = function(event){ | |
try{ | |
return event.pageY || (event.clientY +(document.documentElement.scrollTop || document.body.scrollTop)); | |
@@ -410,7 +410,7 @@ Event.pointerY = function(event){ | |
catch(e){ | |
} | |
-} | |
+}; | |
SelectUpdater = Class.create(); | |
SelectUpdater.prototype = { | |
@@ -465,7 +465,7 @@ SelectUpdater.prototype = { | |
select.appendChild(option); | |
} | |
} | |
-} | |
+}; | |
/** | |
@@ -561,4 +561,4 @@ FormElementDependenceController.prototype = { | |
$(idTo).up(this._config.levels_up).hide(); | |
} | |
} | |
-} | |
+}; | |
diff --git a/js/mage/adminhtml/giftmessage.js b/js/mage/adminhtml/giftmessage.js | |
index 6a73841..c437a61 100644 | |
--- a/js/mage/adminhtml/giftmessage.js | |
+++ b/js/mage/adminhtml/giftmessage.js | |
@@ -217,7 +217,7 @@ GiftOptionsPopup.prototype = { | |
this.giftOptionsWindowMask.style.display = 'none'; | |
this.giftOptionsWindow.style.display = 'none'; | |
} | |
-} | |
+}; | |
/********************* GIFT OPTIONS SET ***********************/ | |
@@ -241,7 +241,7 @@ GiftMessageSet.prototype = { | |
if ($('gift-message-form-data-' + this.id)) { | |
this.fields.each(function(el) { | |
if ($(this.sourcePrefix + this.id + '_' + el) && $(this.destPrefix + el)) { | |
- $(this.destPrefix + el).value = $(this.sourcePrefix + this.id + '_' + el).value | |
+ $(this.destPrefix + el).value = $(this.sourcePrefix + this.id + '_' + el).value; | |
} | |
}, this); | |
$('gift_options_giftmessage').show(); | |
@@ -268,4 +268,4 @@ GiftMessageSet.prototype = { | |
order.loadArea(['items'], true, data.toObject()); | |
} | |
} | |
-} | |
+}; | |
diff --git a/js/mage/adminhtml/giftoptions/tooltip.js b/js/mage/adminhtml/giftoptions/tooltip.js | |
index 5e75dfc..7d64e84 100644 | |
--- a/js/mage/adminhtml/giftoptions/tooltip.js | |
+++ b/js/mage/adminhtml/giftoptions/tooltip.js | |
@@ -149,7 +149,7 @@ GiftOptionsTooltip.prototype = { | |
tooltipContent = this._tooltipContentLoaderFunction(itemId); | |
} | |
if (tooltipContent != '') { | |
- this._updateTooltipWindowContent(tooltipContent) | |
+ this._updateTooltipWindowContent(tooltipContent); | |
this._moveTooltip(event); | |
new Element.show(this._tooltipWindow); | |
return true; | |
@@ -206,6 +206,6 @@ GiftOptionsTooltip.prototype = { | |
{ | |
this._tooltipWindowContent.update(content); | |
} | |
-} | |
+}; | |
giftOptionsTooltip = new GiftOptionsTooltip(); | |
diff --git a/js/mage/adminhtml/grid.js b/js/mage/adminhtml/grid.js | |
index 0e43d22..33e901e 100644 | |
--- a/js/mage/adminhtml/grid.js | |
+++ b/js/mage/adminhtml/grid.js | |
@@ -178,7 +178,7 @@ varienGrid.prototype = { | |
var responseText = transport.responseText.replace(/>\s+</g, '><'); | |
if (transport.responseText.isJSON()) { | |
- var response = transport.responseText.evalJSON() | |
+ var response = transport.responseText.evalJSON(); | |
if (response.error) { | |
alert(response.message); | |
} | |
@@ -898,7 +898,7 @@ serializerController.prototype = { | |
//Stuff methods | |
getGridDataHash: function (_object){ | |
- return $H(this.multidimensionalMode ? _object : this.convertArrayToObject(_object)) | |
+ return $H(this.multidimensionalMode ? _object : this.convertArrayToObject(_object)); | |
}, | |
getDataForReloadParam: function(){ | |
return this.multidimensionalMode ? this.gridData.keys() : this.gridData.values(); | |
diff --git a/js/mage/adminhtml/image.js b/js/mage/adminhtml/image.js | |
index dd8b21f..df395fd 100644 | |
--- a/js/mage/adminhtml/image.js | |
+++ b/js/mage/adminhtml/image.js | |
@@ -87,5 +87,5 @@ if(!window.Flex) { | |
getImage: function() { | |
this.getInnerElement('b64').value = this.flex.getBridge().getBase64Image(); | |
} | |
- } | |
+ }; | |
} | |
diff --git a/js/mage/adminhtml/loader.js b/js/mage/adminhtml/loader.js | |
index d5984e8..97f4115 100644 | |
--- a/js/mage/adminhtml/loader.js | |
+++ b/js/mage/adminhtml/loader.js | |
@@ -137,7 +137,7 @@ varienLoader.prototype = { | |
getCache : function(url){ | |
if(this.cache.get(url)){ | |
- return this.cache.get(url) | |
+ return this.cache.get(url); | |
} | |
return false; | |
}, | |
@@ -183,7 +183,7 @@ varienLoader.prototype = { | |
this.callback(transport.responseText); | |
} | |
} | |
-} | |
+}; | |
if (!window.varienLoaderHandler) | |
var varienLoaderHandler = new Object(); | |
@@ -197,7 +197,7 @@ varienLoaderHandler.handler = { | |
request.options.loaderArea = $$('#html-body .wrapper')[0]; // Blocks all page | |
if(request && request.options.loaderArea){ | |
- Element.clonePosition($('loading-mask'), $(request.options.loaderArea), {offsetLeft:-2}) | |
+ Element.clonePosition($('loading-mask'), $(request.options.loaderArea), {offsetLeft:-2}); | |
toggleSelectsUnderBlock($('loading-mask'), false); | |
Element.show('loading-mask'); | |
setLoaderPosition(); | |
diff --git a/js/mage/adminhtml/moneybookers.js b/js/mage/adminhtml/moneybookers.js | |
index ef38a5e..8ff42be 100644 | |
--- a/js/mage/adminhtml/moneybookers.js | |
+++ b/js/mage/adminhtml/moneybookers.js | |
@@ -209,4 +209,4 @@ Moneybookers.prototype = { | |
isStoreView: function() { | |
return $("moneybookers_settings_moneybookers_email_inherit") != undefined; | |
} | |
-} | |
+}; | |
diff --git a/js/mage/adminhtml/product.js b/js/mage/adminhtml/product.js | |
index e782579..8fe67c8 100644 | |
--- a/js/mage/adminhtml/product.js | |
+++ b/js/mage/adminhtml/product.js | |
@@ -399,7 +399,7 @@ Product.Configurable.prototype = { | |
li.id = this.idPrefix + '_attribute_' + index; | |
attribute.html_id = li.id; | |
if (attribute && attribute.label && attribute.label.blank()) { | |
- attribute.label = ' ' | |
+ attribute.label = ' '; | |
} | |
var label_readonly = ''; | |
var use_default_checked = ''; | |
@@ -477,7 +477,7 @@ Product.Configurable.prototype = { | |
this.grid.reload(null); | |
}, | |
createEmptyProduct : function() { | |
- this.createPopup(this.createEmptyUrl) | |
+ this.createPopup(this.createEmptyUrl); | |
}, | |
createNewProduct : function() { | |
this.createPopup(this.createNormalUrl); | |
@@ -990,7 +990,7 @@ Product.Configurable.prototype = { | |
showNoticeMessage : function() { | |
$('assign_product_warrning').show(); | |
} | |
-} | |
+}; | |
var onInitDisableFieldsList = []; | |
diff --git a/js/mage/adminhtml/product/composite/configure.js b/js/mage/adminhtml/product/composite/configure.js | |
index e90c89a..45cf24a 100644 | |
--- a/js/mage/adminhtml/product/composite/configure.js | |
+++ b/js/mage/adminhtml/product/composite/configure.js | |
@@ -430,13 +430,13 @@ ProductConfigure.prototype = { | |
var states = new Array; | |
var selects = this.blockForm.getElementsByTagName("select"); | |
for(var i=0; i<selects.length; i++){ | |
- states[i] = selects[i].style.visibility | |
+ states[i] = selects[i].style.visibility; | |
} | |
} | |
toggleSelectsUnderBlock(this.blockMask, flag); | |
if (this.blockForm) { | |
for(i=0; i<selects.length; i++){ | |
- selects[i].style.visibility = states[i] | |
+ selects[i].style.visibility = states[i]; | |
} | |
} | |
} | |
@@ -584,7 +584,7 @@ ProductConfigure.prototype = { | |
var pattern = null; | |
var patternFlat = null; | |
var replacement = null; | |
- var replacementFlat = null | |
+ var replacementFlat = null; | |
var scopeArr = blockItem.id.match(/.*\[\w+\]\[([^\]]+)\]$/); | |
var itemId = scopeArr[1]; | |
if (method == 'current_confirmed_to_form') { | |
diff --git a/js/mage/adminhtml/rules.js b/js/mage/adminhtml/rules.js | |
index fd84773..b96b2bf 100644 | |
--- a/js/mage/adminhtml/rules.js | |
+++ b/js/mage/adminhtml/rules.js | |
@@ -313,7 +313,7 @@ VarienRulesForm.prototype = { | |
_processSuccess : function(transport) { | |
if (transport.responseText.isJSON()) { | |
- var response = transport.responseText.evalJSON() | |
+ var response = transport.responseText.evalJSON(); | |
if (response.error) { | |
alert(response.message); | |
} | |
@@ -380,4 +380,4 @@ VarienRulesForm.prototype = { | |
grid.reloadParams = {'selected[]':this.chooserSelectedItems.keys()}; | |
this.updateElement.value = this.chooserSelectedItems.keys().join(', '); | |
} | |
-} | |
+}; | |
diff --git a/js/mage/adminhtml/sales.js b/js/mage/adminhtml/sales.js | |
index a18d1aa..64e7ca6 100644 | |
--- a/js/mage/adminhtml/sales.js | |
+++ b/js/mage/adminhtml/sales.js | |
@@ -68,7 +68,7 @@ AdminOrder.prototype = { | |
window.setTimeout(function () { | |
el.remove(); | |
}, 10); | |
- } | |
+ }; | |
this.dataArea.onLoad = this.dataArea.onLoad.wrap(function(proceed) { | |
proceed(); | |
@@ -197,10 +197,10 @@ AdminOrder.prototype = { | |
var data; | |
if(this.isBillingField(field.id)){ | |
- data = this.serializeData(this.billingAddressContainer) | |
+ data = this.serializeData(this.billingAddressContainer); | |
} | |
else{ | |
- data = this.serializeData(this.shippingAddressContainer) | |
+ data = this.serializeData(this.shippingAddressContainer); | |
} | |
data = data.toObject(); | |
@@ -377,7 +377,7 @@ AdminOrder.prototype = { | |
if(!this.paymentMethod || method){ | |
$('order-billing_method_form').select('input', 'select', 'textarea').each(function(elem){ | |
if(elem.type != 'radio') elem.disabled = true; | |
- }) | |
+ }); | |
} | |
if ($('payment_form_'+method)){ | |
@@ -393,7 +393,7 @@ AdminOrder.prototype = { | |
field.bindChange = true; | |
field.paymentContainer = form; /** @deprecated after 1.4.0.0-rc1 */ | |
field.method = method; | |
- field.observe('change', this.changePaymentData.bind(this)) | |
+ field.observe('change', this.changePaymentData.bind(this)); | |
} | |
},this); | |
} | |
@@ -797,7 +797,7 @@ AdminOrder.prototype = { | |
for(var i=0; i<elems.length; i++){ | |
if(!elems[i].bindOnchange){ | |
elems[i].bindOnchange = true; | |
- elems[i].observe('change', this.itemChange.bind(this)) | |
+ elems[i].observe('change', this.itemChange.bind(this)); | |
} | |
} | |
}, | |
@@ -880,10 +880,10 @@ AdminOrder.prototype = { | |
var fields = $(container).select('input', 'select', 'textarea'); | |
for(var i=0; i<fields.length; i++){ | |
if(fields[i].id == 'group_id'){ | |
- fields[i].observe('change', this.accountGroupChange.bind(this)) | |
+ fields[i].observe('change', this.accountGroupChange.bind(this)); | |
} | |
else{ | |
- fields[i].observe('change', this.accountFieldChange.bind(this)) | |
+ fields[i].observe('change', this.accountFieldChange.bind(this)); | |
} | |
} | |
} | |
@@ -901,7 +901,7 @@ AdminOrder.prototype = { | |
if($(container)){ | |
var fields = $(container).select('input', 'textarea'); | |
for(var i=0; i<fields.length; i++) | |
- fields[i].observe('change', this.commentFieldChange.bind(this)) | |
+ fields[i].observe('change', this.commentFieldChange.bind(this)); | |
} | |
}, | |
@@ -913,7 +913,7 @@ AdminOrder.prototype = { | |
if($(container)){ | |
var fields = $(container).select('input', 'textarea'); | |
for(var i=0; i<fields.length; i++) | |
- fields[i].observe('change', this.giftmessageFieldChange.bind(this)) | |
+ fields[i].observe('change', this.giftmessageFieldChange.bind(this)); | |
} | |
}, | |
@@ -1103,7 +1103,7 @@ AdminOrder.prototype = { | |
if (typeof(show) == 'undefined') { show = true; } | |
var orderObj = this; | |
- var obj = this.overlayData.get(elId) | |
+ var obj = this.overlayData.get(elId); | |
if (!obj) { | |
obj = { | |
show: show, | |
@@ -1112,7 +1112,7 @@ AdminOrder.prototype = { | |
fx: function(event) { | |
this.order.processOverlay(this.el, this.show); | |
} | |
- } | |
+ }; | |
obj.bfx = obj.fx.bindAsEventListener(obj); | |
this.overlayData.set(elId, obj); | |
} | |
diff --git a/js/mage/adminhtml/sales/centinel.js b/js/mage/adminhtml/sales/centinel.js | |
index cfb644f..01a77b0 100644 | |
--- a/js/mage/adminhtml/sales/centinel.js | |
+++ b/js/mage/adminhtml/sales/centinel.js | |
@@ -68,4 +68,4 @@ centinelValidator.prototype = { | |
return $(this.containerId); | |
} | |
-} | |
+}; | |
diff --git a/js/mage/adminhtml/sales/packaging.js b/js/mage/adminhtml/sales/packaging.js | |
index 723dd4f..86a156a 100644 | |
--- a/js/mage/adminhtml/sales/packaging.js | |
+++ b/js/mage/adminhtml/sales/packaging.js | |
@@ -132,7 +132,7 @@ Packaging.prototype = { | |
var weight, length, width, height = null; | |
var packagesParams = []; | |
this.packagesContent.childElements().each(function(pack) { | |
- var packageId = pack.id.match(/\d$/)[0]; | |
+ var packageId = pack.id.match(/\d+$/)[0]; | |
weight = parseFloat(pack.select('input[name="container_weight"]')[0].value); | |
length = parseFloat(pack.select('input[name="container_length"]')[0].value); | |
width = parseFloat(pack.select('input[name="container_width"]')[0].value); | |
@@ -170,7 +170,7 @@ Packaging.prototype = { | |
} | |
var deliveryConfirmation = pack.select('select[name="delivery_confirmation_types"]'); | |
if (deliveryConfirmation.length) { | |
- packagesParams[packageId]['delivery_confirmation'] = deliveryConfirmation[0].value | |
+ packagesParams[packageId]['delivery_confirmation'] = deliveryConfirmation[0].value; | |
} | |
}.bind(this)); | |
for (var packageId in this.packages) { | |
@@ -260,7 +260,7 @@ Packaging.prototype = { | |
dimensionElements.each(callback); | |
return result = $$('[id^="package_block_"] input').collect(function (element) { | |
- return this.validateElement(element) | |
+ return this.validateElement(element); | |
}, this).all(); | |
}, | |
@@ -345,7 +345,7 @@ Packaging.prototype = { | |
item.remove(); | |
this.messages.hide().update(); | |
this._recalcContainerWeightAndCustomsValue(packItems); | |
- this._setAllItemsPackedState() | |
+ this._setAllItemsPackedState(); | |
}, | |
recalcContainerWeightAndCustomsValue: function(obj) { | |
@@ -394,7 +394,7 @@ Packaging.prototype = { | |
if (items[packedItemId]) { | |
items[packedItemId] += this.packages[packageId]['items'][packedItemId]['qty']; | |
} else { | |
- items[packedItemId] = this.packages[packageId]['items'][packedItemId]['qty'] | |
+ items[packedItemId] = this.packages[packageId]['items'][packedItemId]['qty']; | |
} | |
} | |
} | |
@@ -506,7 +506,7 @@ Packaging.prototype = { | |
packagePrepare.hide(); | |
packageBlock.select('.AddSelectedBtn')[0].hide(); | |
packageBlock.select('.AddItemsBtn')[0].show(); | |
- this._setAllItemsPackedState() | |
+ this._setAllItemsPackedState(); | |
}, | |
validateItemQty: function (itemId, qty) { | |
@@ -627,13 +627,13 @@ Packaging.prototype = { | |
Form.Element.disable(inputElement); | |
inputElement.addClassName('disabled'); | |
if (inputElement.nodeName == 'INPUT') { | |
- $(inputElement).value = '' | |
+ $(inputElement).value = ''; | |
} | |
} else { | |
Form.Element.enable(inputElement); | |
inputElement.removeClassName('disabled'); | |
} | |
- }) | |
+ }); | |
}, | |
changeContentTypes: function(obj) { | |
@@ -759,7 +759,7 @@ Packaging.prototype = { | |
packagePrapare.select('tbody input[type="checkbox"]').each(function(item){ | |
$(item).observe('change', this._observeQty); | |
this._observeQty.call(item); | |
- }.bind(this)) | |
+ }.bind(this)); | |
}, | |
_observeQty: function() { | |
diff --git a/js/mage/adminhtml/scrollbar.js b/js/mage/adminhtml/scrollbar.js | |
index d170dea..6c96c3f 100644 | |
--- a/js/mage/adminhtml/scrollbar.js | |
+++ b/js/mage/adminhtml/scrollbar.js | |
@@ -114,8 +114,8 @@ var Drag = { | |
nx = x + ((ex - o.lastMouseX) * (o.hmode ? 1 : -1)); | |
ny = y + ((ey - o.lastMouseY) * (o.vmode ? 1 : -1)); | |
- if (o.xMapper) nx = o.xMapper(y) | |
- else if (o.yMapper) ny = o.yMapper(x) | |
+ if (o.xMapper) nx = o.xMapper(y); | |
+ else if (o.yMapper) ny = o.yMapper(x); | |
Drag.obj.root.style[o.hmode ? "left" : "right"] = nx + "px"; | |
Drag.obj.root.style[o.vmode ? "top" : "bottom"] = ny + "px"; | |
@@ -156,165 +156,173 @@ var Drag = { | |
-ypSimpleScroll.prototype.scrollNorth = function(count) { this.startScroll(90, count) } | |
-ypSimpleScroll.prototype.scrollSouth = function(count) { this.startScroll(270, count) } | |
-ypSimpleScroll.prototype.scrollWest = function(count) { this.startScroll(180, count) } | |
-ypSimpleScroll.prototype.scrollEast = function(count) { this.startScroll(0, count) } | |
+ypSimpleScroll.prototype.scrollNorth = function(count) { | |
+ this.startScroll(90, count); | |
+}; | |
+ypSimpleScroll.prototype.scrollSouth = function(count) { | |
+ this.startScroll(270, count); | |
+}; | |
+ypSimpleScroll.prototype.scrollWest = function(count) { | |
+ this.startScroll(180, count); | |
+}; | |
+ypSimpleScroll.prototype.scrollEast = function(count) { | |
+ this.startScroll(0, count); | |
+}; | |
ypSimpleScroll.prototype.startScroll = function(deg, count) { | |
if (this.loaded){ | |
- if (this.aniTimer) window.clearTimeout(this.aniTimer) | |
- this.overrideScrollAngle(deg) | |
- this.speed = this.origSpeed | |
- this.lastTime = (new Date()).getTime() - this.y.minRes | |
- this.aniTimer = window.setTimeout(this.gRef + ".scroll('"+deg+"','"+count+"')", this.y.minRes) | |
+ if (this.aniTimer) window.clearTimeout(this.aniTimer); | |
+ this.overrideScrollAngle(deg); | |
+ this.speed = this.origSpeed; | |
+ this.lastTime = (new Date()).getTime() - this.y.minRes; | |
+ this.aniTimer = window.setTimeout(this.gRef + ".scroll('"+deg+"','"+count+"')", this.y.minRes); | |
} | |
-} | |
+}; | |
ypSimpleScroll.prototype.endScroll = function() { | |
if (this.loaded){ | |
- window.clearTimeout(this.aniTimer) | |
+ window.clearTimeout(this.aniTimer); | |
this.aniTimer = 0; | |
- this.speed = this.origSpeed | |
+ this.speed = this.origSpeed; | |
} | |
-} | |
+}; | |
ypSimpleScroll.prototype.overrideScrollAngle = function(deg) { | |
if (this.loaded){ | |
- deg = deg % 360 | |
+ deg = deg % 360; | |
if (deg % 90 == 0) { | |
- var cos = deg == 0 ? 1 : deg == 180 ? -1 : 0 | |
- var sin = deg == 90 ? -1 : deg == 270 ? 1 : 0 | |
+ var cos = deg == 0 ? 1 : deg == 180 ? -1 : 0; | |
+ var sin = deg == 90 ? -1 : deg == 270 ? 1 : 0; | |
} | |
else { | |
- var angle = deg * Math.PI / 180 | |
- var cos = Math.cos(angle) | |
- var sin = Math.sin(angle) | |
- sin = -sin | |
+ var angle = deg * Math.PI / 180; | |
+ var cos = Math.cos(angle); | |
+ var sin = Math.sin(angle); | |
+ sin = -sin; | |
} | |
- this.fx = cos / (Math.abs(cos) + Math.abs(sin)) | |
- this.fy = sin / (Math.abs(cos) + Math.abs(sin)) | |
- this.stopH = deg == 90 || deg == 270 ? this.scrollLeft : deg < 90 || deg > 270 ? this.scrollW : 0 | |
- this.stopV = deg == 0 || deg == 180 ? this.scrollTop : deg < 180 ? 0 : this.scrollH | |
+ this.fx = cos / (Math.abs(cos) + Math.abs(sin)); | |
+ this.fy = sin / (Math.abs(cos) + Math.abs(sin)); | |
+ this.stopH = deg == 90 || deg == 270 ? this.scrollLeft : deg < 90 || deg > 270 ? this.scrollW : 0; | |
+ this.stopV = deg == 0 || deg == 180 ? this.scrollTop : deg < 180 ? 0 : this.scrollH; | |
} | |
-} | |
+}; | |
ypSimpleScroll.prototype.overrideScrollSpeed = function(speed) { | |
- if (this.loaded) this.speed = speed | |
-} | |
+ if (this.loaded) this.speed = speed; | |
+}; | |
ypSimpleScroll.prototype.scrollTo = function(stopH, stopV, aniLen) { | |
if (this.loaded){ | |
if (stopH != this.scrollLeft || stopV != this.scrollTop) { | |
- if (this.aniTimer) window.clearTimeout(this.aniTimer) | |
- this.lastTime = (new Date()).getTime() | |
- var dx = Math.abs(stopH - this.scrollLeft) | |
- var dy = Math.abs(stopV - this.scrollTop) | |
- var d = Math.sqrt(Math.pow(dx,2) + Math.pow(dy,2)) | |
- this.fx = (stopH - this.scrollLeft) / (dx + dy) | |
- this.fy = (stopV - this.scrollTop) / (dx + dy) | |
- this.stopH = stopH | |
- this.stopV = stopV | |
- this.speed = d / aniLen * 1000 | |
- window.setTimeout(this.gRef + ".scroll()", this.y.minRes) | |
+ if (this.aniTimer) window.clearTimeout(this.aniTimer); | |
+ this.lastTime = (new Date()).getTime(); | |
+ var dx = Math.abs(stopH - this.scrollLeft); | |
+ var dy = Math.abs(stopV - this.scrollTop); | |
+ var d = Math.sqrt(Math.pow(dx,2) + Math.pow(dy,2)); | |
+ this.fx = (stopH - this.scrollLeft) / (dx + dy); | |
+ this.fy = (stopV - this.scrollTop) / (dx + dy); | |
+ this.stopH = stopH; | |
+ this.stopV = stopV; | |
+ this.speed = d / aniLen * 1000; | |
+ window.setTimeout(this.gRef + ".scroll()", this.y.minRes); | |
} | |
} | |
-} | |
+}; | |
ypSimpleScroll.prototype.jumpTo = function(nx, ny) { | |
if (this.loaded){ | |
- nx = Math.min(Math.max(nx, 0), this.scrollW) | |
- ny = Math.min(Math.max(ny, 0), this.scrollH) | |
- this.scrollLeft = nx | |
- this.scrollTop = ny | |
- if (this.y.ns4)this.content.moveTo(-nx, -ny) | |
+ nx = Math.min(Math.max(nx, 0), this.scrollW); | |
+ ny = Math.min(Math.max(ny, 0), this.scrollH); | |
+ this.scrollLeft = nx; | |
+ this.scrollTop = ny; | |
+ if (this.y.ns4)this.content.moveTo(-nx, -ny); | |
else { | |
- this.content.style.left = -nx + "px" | |
- this.content.style.top = -ny + "px" | |
+ this.content.style.left = -nx + "px"; | |
+ this.content.style.top = -ny + "px"; | |
} | |
} | |
-} | |
+}; | |
-ypSimpleScroll.minRes = 10 | |
-ypSimpleScroll.ie = document.all ? 1 : 0 | |
-ypSimpleScroll.ns4 = document.layers ? 1 : 0 | |
-ypSimpleScroll.dom = document.getElementById ? 1 : 0 | |
-ypSimpleScroll.mac = navigator.platform == "MacPPC" | |
-ypSimpleScroll.mo5 = document.getElementById && !document.all ? 1 : 0 | |
+ypSimpleScroll.minRes = 10; | |
+ypSimpleScroll.ie = document.all ? 1 : 0; | |
+ypSimpleScroll.ns4 = document.layers ? 1 : 0; | |
+ypSimpleScroll.dom = document.getElementById ? 1 : 0; | |
+ypSimpleScroll.mac = navigator.platform == "MacPPC"; | |
+ypSimpleScroll.mo5 = document.getElementById && !document.all ? 1 : 0; | |
ypSimpleScroll.prototype.scroll = function(deg,count) { | |
- this.aniTimer = window.setTimeout(this.gRef + ".scroll('"+deg+"','"+count+"')", this.y.minRes) | |
- var nt = (new Date()).getTime() | |
- var d = Math.round((nt - this.lastTime) / 1000 * this.speed) | |
+ this.aniTimer = window.setTimeout(this.gRef + ".scroll('"+deg+"','"+count+"')", this.y.minRes); | |
+ var nt = (new Date()).getTime(); | |
+ var d = Math.round((nt - this.lastTime) / 1000 * this.speed); | |
if (d > 0){ | |
- var nx = d * this.fx + this.scrollLeft | |
- var ny = d * this.fy + this.scrollTop | |
- var xOut = (nx >= this.scrollLeft && nx >= this.stopH) || (nx <= this.scrollLeft && nx <= this.stopH) | |
- var yOut = (ny >= this.scrollTop && ny >= this.stopV) || (ny <= this.scrollTop && ny <= this.stopV) | |
+ var nx = d * this.fx + this.scrollLeft; | |
+ var ny = d * this.fy + this.scrollTop; | |
+ var xOut = (nx >= this.scrollLeft && nx >= this.stopH) || (nx <= this.scrollLeft && nx <= this.stopH); | |
+ var yOut = (ny >= this.scrollTop && ny >= this.stopV) || (ny <= this.scrollTop && ny <= this.stopV); | |
if (nt - this.lastTime != 0 && | |
((this.fx == 0 && this.fy == 0) || | |
(this.fy == 0 && xOut) || | |
(this.fx == 0 && yOut) || | |
(this.fx != 0 && this.fy != 0 && | |
xOut && yOut))) { | |
- this.jumpTo(this.stopH, this.stopV) | |
- this.endScroll() | |
+ this.jumpTo(this.stopH, this.stopV); | |
+ this.endScroll(); | |
} | |
else { | |
- this.jumpTo(nx, ny) | |
- this.lastTime = nt | |
+ this.jumpTo(nx, ny); | |
+ this.lastTime = nt; | |
} | |
// (zgtc) now we also update dragger position: | |
if(deg=='270') theThumb[count].style.top = parseInt(((theThumb[count].maxY-theThumb[count].minY)*this.scrollTop/this.stopV)+theThumb[count].minY) + "px"; //ok nomes down | |
if(deg=='90') theThumb[count].style.top = parseInt(((theThumb[count].maxY-theThumb[count].minY)*this.scrollTop/this.scrollH)+theThumb[count].minY) + "px"; //ok nomes down | |
} | |
-} | |
+}; | |
function ypSimpleScroll(id, left, top, width, height, speed) { | |
width -= 2; | |
- var y = this.y = ypSimpleScroll | |
- if (document.layers && !y.ns4) history.go(0) | |
+ var y = this.y = ypSimpleScroll; | |
+ if (document.layers && !y.ns4) history.go(0); | |
if (y.ie || y.ns4 || y.dom) { | |
- this.loaded = false | |
- this.id = id | |
- this.origSpeed = speed | |
- this.aniTimer = false | |
- this.op = "" | |
- this.lastTime = 0 | |
- this.clipH = height | |
- this.clipW = width | |
- this.scrollTop = 0 | |
- this.scrollLeft = 0 | |
- this.gRef = "ypSimpleScroll_"+id | |
- eval(this.gRef+"=this") | |
- var d = document | |
- d.write('<style type="text/css">') | |
- d.write('#' + this.id + 'Container { left:0px; top:' + top + 'px; width:' + (width+15) + 'px; height:' + (height+12) + 'px; clip:rect(0 ' + (width+15) + ' ' + (height+12) + ' 0); overflow:hidden; }') | |
- d.write('#' + this.id + 'Container, #' + this.id + 'Content { position:absolute; }') | |
- d.write('#' + this.id + 'Content { left:' + (-this.scrollLeft) + 'px; top:' + (-this.scrollTop) + 'px; width:' + width + 'px; }') | |
+ this.loaded = false; | |
+ this.id = id; | |
+ this.origSpeed = speed; | |
+ this.aniTimer = false; | |
+ this.op = ""; | |
+ this.lastTime = 0; | |
+ this.clipH = height; | |
+ this.clipW = width; | |
+ this.scrollTop = 0; | |
+ this.scrollLeft = 0; | |
+ this.gRef = "ypSimpleScroll_"+id; | |
+ eval(this.gRef+"=this"); | |
+ var d = document; | |
+ d.write('<style type="text/css">'); | |
+ d.write('#' + this.id + 'Container { left:0px; top:' + top + 'px; width:' + (width+15) + 'px; height:' + (height+12) + 'px; clip:rect(0 ' + (width+15) + ' ' + (height+12) + ' 0); overflow:hidden; }'); | |
+ d.write('#' + this.id + 'Container, #' + this.id + 'Content { position:absolute; }'); | |
+ d.write('#' + this.id + 'Content { left:' + (-this.scrollLeft) + 'px; top:' + (-this.scrollTop) + 'px; width:' + width + 'px; }'); | |
// (zgtc) fix to overwrite p/div/ul width (would be clipped if wider than scroller in css): | |
// d.write('#' + this.id + 'Container p, #' + this.id + 'Container div {width:' + parseInt(width-10) + 'px; }') | |
- d.write('</style>') | |
+ d.write('</style>'); | |
} | |
} | |
ypSimpleScroll.prototype.load = function() { | |
- var d, lyrId1, lyrId2 | |
- d = document | |
- lyrId1 = this.id + "Container" | |
- lyrId2 = this.id + "Content" | |
- this.container = this.y.dom ? d.getElementById(lyrId1) : this.y.ie ? d.all[lyrId1] : d.layers[lyrId1] | |
- this.content = obj2 = this.y.ns4 ? this.container.layers[lyrId2] : this.y.ie ? d.all[lyrId2] : d.getElementById(lyrId2) | |
- this.docH = Math.max(this.y.ns4 ? this.content.document.height : this.content.offsetHeight, this.clipH) | |
- this.docW = Math.max(this.y.ns4 ? this.content.document.width : this.content.offsetWidth, this.clipW) | |
- this.scrollH = this.docH - this.clipH | |
- this.scrollW = this.docW - this.clipW | |
- this.loaded = true | |
- this.scrollLeft = Math.max(Math.min(this.scrollLeft, this.scrollW),0) | |
- this.scrollTop = Math.max(Math.min(this.scrollTop, this.scrollH),0) | |
- this.jumpTo(this.scrollLeft, this.scrollTop) | |
-} | |
+ var d, lyrId1, lyrId2; | |
+ d = document; | |
+ lyrId1 = this.id + "Container"; | |
+ lyrId2 = this.id + "Content"; | |
+ this.container = this.y.dom ? d.getElementById(lyrId1) : this.y.ie ? d.all[lyrId1] : d.layers[lyrId1]; | |
+ this.content = obj2 = this.y.ns4 ? this.container.layers[lyrId2] : this.y.ie ? d.all[lyrId2] : d.getElementById(lyrId2); | |
+ this.docH = Math.max(this.y.ns4 ? this.content.document.height : this.content.offsetHeight, this.clipH); | |
+ this.docW = Math.max(this.y.ns4 ? this.content.document.width : this.content.offsetWidth, this.clipW); | |
+ this.scrollH = this.docH - this.clipH; | |
+ this.scrollW = this.docW - this.clipW; | |
+ this.loaded = true; | |
+ this.scrollLeft = Math.max(Math.min(this.scrollLeft, this.scrollW),0); | |
+ this.scrollTop = Math.max(Math.min(this.scrollTop, this.scrollH),0); | |
+ this.jumpTo(this.scrollLeft, this.scrollTop); | |
+}; | |
// ============================================================== | |
// HANDLES SCROLLER/S | |
@@ -370,7 +378,7 @@ function createDragger(count, handler, root, thumb, minX, maxX, minY, maxY){ | |
theThumb[count].onDrag = function(x, y) { | |
theScroll[count].jumpTo(null, Math.round((y - theThumb[count].minY) * ratio[count])); | |
- } | |
+ }; | |
} | |
// INITIALIZER: | |
@@ -385,7 +393,7 @@ function addLoadEvent(fn) { | |
window.onload = function() { | |
old(); | |
fn(); | |
- } | |
+ }; | |
} | |
} | |
addLoadEvent(function(){ | |
@@ -394,4 +402,4 @@ addLoadEvent(function(){ | |
createDragger(i, "handle"+i, "root"+i, "thumb"+i, theScroll[i].clipW, theScroll[i].clipW, 15, theScroll[i].clipH-30); | |
} | |
} | |
-}) | |
+}); | |
diff --git a/js/mage/adminhtml/tabs.js b/js/mage/adminhtml/tabs.js | |
index 32a604c..f114214 100644 | |
--- a/js/mage/adminhtml/tabs.js | |
+++ b/js/mage/adminhtml/tabs.js | |
@@ -49,7 +49,7 @@ varienTabs.prototype = { | |
this.tabs[tab].container = this; | |
this.tabs[tab].show = function(){ | |
this.container.showTabContent(this); | |
- } | |
+ }; | |
if(varienGlobalEvents){ | |
varienGlobalEvents.fireEvent('moveTab', {tab:this.tabs[tab]}); | |
} | |
@@ -88,7 +88,7 @@ varienTabs.prototype = { | |
this.tabs[tab].container = this; | |
this.tabs[tab].show = function(){ | |
this.container.showTabContent(this); | |
- } | |
+ }; | |
if(varienGlobalEvents){ | |
varienGlobalEvents.fireEvent('moveTab', {tab:this.tabs[tab]}); | |
} | |
@@ -176,7 +176,7 @@ varienTabs.prototype = { | |
onSuccess: function(transport) { | |
try { | |
if (transport.responseText.isJSON()) { | |
- var response = transport.responseText.evalJSON() | |
+ var response = transport.responseText.evalJSON(); | |
if (response.error) { | |
alert(response.message); | |
} | |
@@ -185,12 +185,12 @@ varienTabs.prototype = { | |
} | |
} else { | |
$(tabContentElement.id).update(transport.responseText); | |
- this.showTabContentImmediately(tab) | |
+ this.showTabContentImmediately(tab); | |
} | |
} | |
catch (e) { | |
$(tabContentElement.id).update(transport.responseText); | |
- this.showTabContentImmediately(tab) | |
+ this.showTabContentImmediately(tab); | |
} | |
}.bind(this) | |
}); | |
@@ -210,7 +210,7 @@ varienTabs.prototype = { | |
onSuccess: function(transport) { | |
try { | |
if (transport.responseText.isJSON()) { | |
- var response = transport.responseText.evalJSON() | |
+ var response = transport.responseText.evalJSON(); | |
if (response.error) { | |
alert(response.message); | |
} | |
@@ -245,4 +245,4 @@ varienTabs.prototype = { | |
varienGlobalEvents.fireEvent('hideTab', {tab:tab}); | |
} | |
} | |
-} | |
+}; | |
diff --git a/js/mage/adminhtml/tools.js b/js/mage/adminhtml/tools.js | |
index 82e48ce..06b5c07 100644 | |
--- a/js/mage/adminhtml/tools.js | |
+++ b/js/mage/adminhtml/tools.js | |
@@ -23,7 +23,7 @@ | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
function setLocation(url){ | |
- window.location.href = url; | |
+ window.location.href = encodeURI(url); | |
} | |
function confirmSetLocation(message, url){ | |
@@ -94,7 +94,7 @@ function imagePreview(element){ | |
win.document.close(); | |
Event.observe(win, 'load', function(){ | |
var img = win.document.getElementById('image_preview'); | |
- win.resizeTo(img.width+40, img.height+80) | |
+ win.resizeTo(img.width+40, img.height+80); | |
}); | |
} | |
} | |
@@ -167,7 +167,7 @@ function submitAndReloadArea(area, url) { | |
onSuccess: function(transport) { | |
try { | |
if (transport.responseText.isJSON()) { | |
- var response = transport.responseText.evalJSON() | |
+ var response = transport.responseText.evalJSON(); | |
if (response.error) { | |
alert(response.message); | |
} | |
@@ -204,7 +204,7 @@ Event.observe(window, 'load', function() { | |
}); | |
*/ | |
function syncOnchangeValue(baseElem, distElem){ | |
- var compare = {baseElem:baseElem, distElem:distElem} | |
+ var compare = {baseElem:baseElem, distElem:distElem}; | |
Event.observe(baseElem, 'change', function(){ | |
if($(this.baseElem) && $(this.distElem)){ | |
$(this.distElem).value = $(this.baseElem).value; | |
@@ -311,7 +311,7 @@ var toolbarToggle = { | |
// Create copy of header, that will serve as floating toolbar docked to top of window | |
this.headerCopy = $(document.createElement('div')); | |
this.headerCopy.appendChild(this.header.cloneNode(true)); | |
- document.body.insertBefore(this.headerCopy, document.body.lastChild) | |
+ document.body.insertBefore(this.headerCopy, document.body.lastChild); | |
this.headerCopy.addClassName('content-header-floating'); | |
// Remove duplicated buttons and their container | |
@@ -393,7 +393,7 @@ var toolbarToggle = { | |
if (buttons.oldParent == buttons.parentNode) { | |
// Make static dimensions for placeholder, so it's not collapsed when buttons are removed | |
if (buttons.placeholder) { | |
- var dimensions = buttons.placeholder.getDimensions() | |
+ var dimensions = buttons.placeholder.getDimensions(); | |
buttons.placeholder.style.width = dimensions.width + 'px'; | |
buttons.placeholder.style.height = dimensions.height + 'px'; | |
} | |
@@ -476,7 +476,7 @@ var toolbarToggle = { | |
this.eventsAdded = false; | |
} | |
-} | |
+}; | |
// Deprecated since 1.4.2.0-beta1 - use toolbarToggle.reset() instead | |
function updateTopButtonToolbarToggle() | |
diff --git a/js/mage/adminhtml/uploader/instance.js b/js/mage/adminhtml/uploader/instance.js | |
index 483b2af..a37b814 100644 | |
--- a/js/mage/adminhtml/uploader/instance.js | |
+++ b/js/mage/adminhtml/uploader/instance.js | |
@@ -1,12 +1,12 @@ | |
/** | |
- * Magento Enterprise Edition | |
+ * Magento | |
* | |
* NOTICE OF LICENSE | |
* | |
- * This source file is subject to the Magento Enterprise Edition End User License Agreement | |
- * that is bundled with this package in the file LICENSE_EE.txt. | |
+ * This source file is subject to the Academic Free License (AFL 3.0) | |
+ * that is bundled with this package in the file LICENSE_AFL.txt. | |
* It is also available through the world-wide-web at this URL: | |
- * http://www.magento.com/license/enterprise-edition | |
+ * http://opensource.org/licenses/afl-3.0.php | |
* If you did not receive a copy of the license and are unable to | |
* obtain it through the world-wide-web, please send an email | |
* to [email protected] so we can send you a copy immediately. | |
@@ -17,10 +17,10 @@ | |
* versions in the future. If you wish to customize Magento for your | |
* needs please refer to http://www.magento.com for more information. | |
* | |
- * @category design | |
- * @package default_default | |
- * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
- * @license http://www.magento.com/license/enterprise-edition | |
+ * @category Mage | |
+ * @package Mage_Adminhtml | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
(function(flowFactory, window, document) { | |
@@ -164,7 +164,7 @@ | |
} | |
}); | |
} else { | |
- result = $(ids) | |
+ result = $(ids); | |
} | |
return result; | |
diff --git a/js/mage/adminhtml/wysiwyg/tiny_mce/setup.js b/js/mage/adminhtml/wysiwyg/tiny_mce/setup.js | |
index 73442f0..9f4ddb5 100644 | |
--- a/js/mage/adminhtml/wysiwyg/tiny_mce/setup.js | |
+++ b/js/mage/adminhtml/wysiwyg/tiny_mce/setup.js | |
@@ -96,6 +96,261 @@ tinyMceWysiwygSetup.prototype = | |
var settings = { | |
schema : 'html5', | |
+ valid_elements : "" | |
+ +"a[accesskey|charset|class|coords|dir<ltr?rtl|href|hreflang|id|lang|name" | |
+ +"|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup" | |
+ +"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|rel|rev" | |
+ +"|shape<circle?default?poly?rect|style|tabindex|title|target|type]," | |
+ +"abbr[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" | |
+ +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" | |
+ +"|title]," | |
+ +"acronym[class|dir<ltr?rtl|id|id|lang|onclick|ondblclick|onkeydown|onkeypress" | |
+ +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" | |
+ +"|title]," | |
+ +"address[class|align|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown" | |
+ +"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover" | |
+ +"|onmouseup|style|title]," | |
+ +"applet[align<bottom?left?middle?right?top|alt|archive|class|code|codebase" | |
+ +"|height|hspace|id|name|object|style|title|vspace|width]," | |
+ +"area[accesskey|alt|class|coords|dir<ltr?rtl|href|id|lang|nohref<nohref" | |
+ +"|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup" | |
+ +"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup" | |
+ +"|shape<circle?default?poly?rect|style|tabindex|title|target]," | |
+ +"base[href|target]," | |
+ +"basefont[color|face|id|size]," | |
+ +"bdo[class|dir<ltr?rtl|id|lang|style|title]," | |
+ +"big[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" | |
+ +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" | |
+ +"|title]," | |
+ +"blockquote[cite|class|dir<ltr?rtl|id|lang|onclick|ondblclick" | |
+ +"|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout" | |
+ +"|onmouseover|onmouseup|style|title]," | |
+ +"body[alink|background|bgcolor|class|dir<ltr?rtl|id|lang|link|onclick" | |
+ +"|ondblclick|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove" | |
+ +"|onmouseout|onmouseover|onmouseup|onunload|style|title|text|vlink]," | |
+ +"br[class|clear<all?left?none?right|id|style|title]," | |
+ +"button[accesskey|class|dir<ltr?rtl|disabled<disabled|id|lang|name|onblur" | |
+ +"|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup|onmousedown" | |
+ +"|onmousemove|onmouseout|onmouseover|onmouseup|style|tabindex|title|type" | |
+ +"|value]," | |
+ +"caption[align<bottom?left?right?top|class|dir<ltr?rtl|id|lang|onclick" | |
+ +"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove" | |
+ +"|onmouseout|onmouseover|onmouseup|style|title]," | |
+ +"center[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" | |
+ +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" | |
+ +"|title]," | |
+ +"cite[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" | |
+ +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" | |
+ +"|title]," | |
+ +"code[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" | |
+ +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" | |
+ +"|title]," | |
+ +"col[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id" | |
+ +"|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown" | |
+ +"|onmousemove|onmouseout|onmouseover|onmouseup|span|style|title" | |
+ +"|valign<baseline?bottom?middle?top|width]," | |
+ +"colgroup[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl" | |
+ +"|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown" | |
+ +"|onmousemove|onmouseout|onmouseover|onmouseup|span|style|title" | |
+ +"|valign<baseline?bottom?middle?top|width]," | |
+ +"dd[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup" | |
+ +"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]," | |
+ +"del[cite|class|datetime|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown" | |
+ +"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover" | |
+ +"|onmouseup|style|title]," | |
+ +"dfn[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" | |
+ +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" | |
+ +"|title]," | |
+ +"dir[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown" | |
+ +"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover" | |
+ +"|onmouseup|style|title]," | |
+ +"div[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick" | |
+ +"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove" | |
+ +"|onmouseout|onmouseover|onmouseup|style|title]," | |
+ +"dl[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown" | |
+ +"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover" | |
+ +"|onmouseup|style|title]," | |
+ +"dt[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup" | |
+ +"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]," | |
+ +"em/i[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" | |
+ +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" | |
+ +"|title]," | |
+ +"fieldset[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" | |
+ +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" | |
+ +"|title]," | |
+ +"font[class|color|dir<ltr?rtl|face|id|lang|size|style|title]," | |
+ +"form[accept|accept-charset|action|class|dir<ltr?rtl|enctype|id|lang" | |
+ +"|method<get?post|name|onclick|ondblclick|onkeydown|onkeypress|onkeyup" | |
+ +"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onreset|onsubmit" | |
+ +"|style|title|target]," | |
+ +"frame[class|frameborder|id|longdesc|marginheight|marginwidth|name" | |
+ +"|noresize<noresize|scrolling<auto?no?yes|src|style|title]," | |
+ +"frameset[class|cols|id|onload|onunload|rows|style|title]," | |
+ +"h1[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick" | |
+ +"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove" | |
+ +"|onmouseout|onmouseover|onmouseup|style|title]," | |
+ +"h2[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick" | |
+ +"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove" | |
+ +"|onmouseout|onmouseover|onmouseup|style|title]," | |
+ +"h3[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick" | |
+ +"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove" | |
+ +"|onmouseout|onmouseover|onmouseup|style|title]," | |
+ +"h4[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick" | |
+ +"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove" | |
+ +"|onmouseout|onmouseover|onmouseup|style|title]," | |
+ +"h5[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick" | |
+ +"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove" | |
+ +"|onmouseout|onmouseover|onmouseup|style|title]," | |
+ +"h6[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick" | |
+ +"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove" | |
+ +"|onmouseout|onmouseover|onmouseup|style|title]," | |
+ +"head[dir<ltr?rtl|lang|profile]," | |
+ +"hr[align<center?left?right|class|dir<ltr?rtl|id|lang|noshade<noshade|onclick" | |
+ +"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove" | |
+ +"|onmouseout|onmouseover|onmouseup|size|style|title|width]," | |
+ +"html[dir<ltr?rtl|lang|version]," | |
+ +"iframe[align<bottom?left?middle?right?top|class|frameborder|height|id" | |
+ +"|longdesc|marginheight|marginwidth|name|scrolling<auto?no?yes|src|style" | |
+ +"|title|width]," | |
+ +"img[align<bottom?left?middle?right?top|alt|border|class|dir<ltr?rtl|height" | |
+ +"|hspace|id|ismap<ismap|lang|longdesc|name|onclick|ondblclick|onkeydown" | |
+ +"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover" | |
+ +"|onmouseup|src|style|title|usemap|vspace|width]," | |
+ +"input[accept|accesskey|align<bottom?left?middle?right?top|alt" | |
+ +"|checked<checked|class|dir<ltr?rtl|disabled<disabled|id|ismap<ismap|lang" | |
+ +"|maxlength|name|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress" | |
+ +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onselect" | |
+ +"|readonly<readonly|size|src|style|tabindex|title" | |
+ +"|type<button?checkbox?file?hidden?image?password?radio?reset?submit?text" | |
+ +"|usemap|value]," | |
+ +"ins[cite|class|datetime|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown" | |
+ +"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover" | |
+ +"|onmouseup|style|title]," | |
+ +"isindex[class|dir<ltr?rtl|id|lang|prompt|style|title]," | |
+ +"kbd[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" | |
+ +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" | |
+ +"|title]," | |
+ +"label[accesskey|class|dir<ltr?rtl|for|id|lang|onblur|onclick|ondblclick" | |
+ +"|onfocus|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout" | |
+ +"|onmouseover|onmouseup|style|title]," | |
+ +"legend[align<bottom?left?right?top|accesskey|class|dir<ltr?rtl|id|lang" | |
+ +"|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove" | |
+ +"|onmouseout|onmouseover|onmouseup|style|title]," | |
+ +"li[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup" | |
+ +"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title|type" | |
+ +"|value]," | |
+ +"link[charset|class|dir<ltr?rtl|href|hreflang|id|lang|media|onclick" | |
+ +"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove" | |
+ +"|onmouseout|onmouseover|onmouseup|rel|rev|style|title|target|type]," | |
+ +"map[class|dir<ltr?rtl|id|lang|name|onclick|ondblclick|onkeydown|onkeypress" | |
+ +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" | |
+ +"|title]," | |
+ +"menu[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown" | |
+ +"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover" | |
+ +"|onmouseup|style|title]," | |
+ +"meta[content|dir<ltr?rtl|http-equiv|lang|name|scheme]," | |
+ +"noframes[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" | |
+ +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" | |
+ +"|title]," | |
+ +"noscript[class|dir<ltr?rtl|id|lang|style|title]," | |
+ +"object[align<bottom?left?middle?right?top|archive|border|class|classid" | |
+ +"|codebase|codetype|data|declare|dir<ltr?rtl|height|hspace|id|lang|name" | |
+ +"|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove" | |
+ +"|onmouseout|onmouseover|onmouseup|standby|style|tabindex|title|type|usemap" | |
+ +"|vspace|width]," | |
+ +"ol[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown" | |
+ +"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover" | |
+ +"|onmouseup|start|style|title|type]," | |
+ +"optgroup[class|dir<ltr?rtl|disabled<disabled|id|label|lang|onclick" | |
+ +"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove" | |
+ +"|onmouseout|onmouseover|onmouseup|style|title]," | |
+ +"option[class|dir<ltr?rtl|disabled<disabled|id|label|lang|onclick|ondblclick" | |
+ +"|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout" | |
+ +"|onmouseover|onmouseup|selected<selected|style|title|value]," | |
+ +"p[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick" | |
+ +"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove" | |
+ +"|onmouseout|onmouseover|onmouseup|style|title]," | |
+ +"param[id|name|type|value|valuetype<DATA?OBJECT?REF]," | |
+ +"pre/listing/plaintext/xmp[align|class|dir<ltr?rtl|id|lang|onclick|ondblclick" | |
+ +"|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout" | |
+ +"|onmouseover|onmouseup|style|title|width]," | |
+ +"q[cite|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" | |
+ +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" | |
+ +"|title]," | |
+ +"s[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup" | |
+ +"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]," | |
+ +"samp[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" | |
+ +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" | |
+ +"|title]," | |
+ +"script[charset|defer|language|src|type]," | |
+ +"select[class|dir<ltr?rtl|disabled<disabled|id|lang|multiple<multiple|name" | |
+ +"|onblur|onchange|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup" | |
+ +"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|size|style" | |
+ +"|tabindex|title]," | |
+ +"small[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" | |
+ +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" | |
+ +"|title]," | |
+ +"span[align<center?justify?left?right|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown" | |
+ +"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover" | |
+ +"|onmouseup|style|title]," | |
+ +"strike[class|class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown" | |
+ +"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover" | |
+ +"|onmouseup|style|title]," | |
+ +"strong/b[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" | |
+ +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" | |
+ +"|title]," | |
+ +"style[dir<ltr?rtl|lang|media|title|type]," | |
+ +"sub[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" | |
+ +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" | |
+ +"|title]," | |
+ +"sup[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" | |
+ +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" | |
+ +"|title]," | |
+ +"table[align<center?left?right|bgcolor|border|cellpadding|cellspacing|class" | |
+ +"|dir<ltr?rtl|frame|height|id|lang|onclick|ondblclick|onkeydown|onkeypress" | |
+ +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|rules" | |
+ +"|style|summary|title|width]," | |
+ +"tbody[align<center?char?justify?left?right|char|class|charoff|dir<ltr?rtl|id" | |
+ +"|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown" | |
+ +"|onmousemove|onmouseout|onmouseover|onmouseup|style|title" | |
+ +"|valign<baseline?bottom?middle?top]," | |
+ +"td[abbr|align<center?char?justify?left?right|axis|bgcolor|char|charoff|class" | |
+ +"|colspan|dir<ltr?rtl|headers|height|id|lang|nowrap<nowrap|onclick" | |
+ +"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove" | |
+ +"|onmouseout|onmouseover|onmouseup|rowspan|scope<col?colgroup?row?rowgroup" | |
+ +"|style|title|valign<baseline?bottom?middle?top|width]," | |
+ +"textarea[accesskey|class|cols|dir<ltr?rtl|disabled<disabled|id|lang|name" | |
+ +"|onblur|onclick|ondblclick|onfocus|onkeydown|onkeypress|onkeyup" | |
+ +"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onselect" | |
+ +"|readonly<readonly|rows|style|tabindex|title]," | |
+ +"tfoot[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id" | |
+ +"|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown" | |
+ +"|onmousemove|onmouseout|onmouseover|onmouseup|style|title" | |
+ +"|valign<baseline?bottom?middle?top]," | |
+ +"th[abbr|align<center?char?justify?left?right|axis|bgcolor|char|charoff|class" | |
+ +"|colspan|dir<ltr?rtl|headers|height|id|lang|nowrap<nowrap|onclick" | |
+ +"|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove" | |
+ +"|onmouseout|onmouseover|onmouseup|rowspan|scope<col?colgroup?row?rowgroup" | |
+ +"|style|title|valign<baseline?bottom?middle?top|width]," | |
+ +"thead[align<center?char?justify?left?right|char|charoff|class|dir<ltr?rtl|id" | |
+ +"|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup|onmousedown" | |
+ +"|onmousemove|onmouseout|onmouseover|onmouseup|style|title" | |
+ +"|valign<baseline?bottom?middle?top]," | |
+ +"title[dir<ltr?rtl|lang]," | |
+ +"tr[abbr|align<center?char?justify?left?right|bgcolor|char|charoff|class" | |
+ +"|rowspan|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" | |
+ +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" | |
+ +"|title|valign<baseline?bottom?middle?top]," | |
+ +"tt[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup" | |
+ +"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]," | |
+ +"u[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress|onkeyup" | |
+ +"|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style|title]," | |
+ +"ul[class|compact<compact|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown" | |
+ +"|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover" | |
+ +"|onmouseup|style|title|type]," | |
+ +"var[class|dir<ltr?rtl|id|lang|onclick|ondblclick|onkeydown|onkeypress" | |
+ +"|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|style" | |
+ +"|title]", | |
mode : (mode != undefined ? mode : 'none'), | |
elements : this.id, | |
theme : 'advanced', | |
@@ -361,4 +616,4 @@ tinyMceWysiwygSetup.prototype = | |
widgetPlaceholderExist: function(filename) { | |
return this.config.widget_placeholders.indexOf(filename) != -1; | |
} | |
-} | |
+}; | |
diff --git a/js/mage/adminhtml/wysiwyg/widget.js b/js/mage/adminhtml/wysiwyg/widget.js | |
index 3e4d2d6..afd8307 100644 | |
--- a/js/mage/adminhtml/wysiwyg/widget.js | |
+++ b/js/mage/adminhtml/wysiwyg/widget.js | |
@@ -31,7 +31,7 @@ var widgetTools = { | |
onAjaxSuccess: function(transport) { | |
if (transport.responseText.isJSON()) { | |
- var response = transport.responseText.evalJSON() | |
+ var response = transport.responseText.evalJSON(); | |
if (response.error) { | |
throw response; | |
} else if (response.ajaxExpired && response.ajaxRedirect) { | |
@@ -74,7 +74,7 @@ var widgetTools = { | |
window.close(); | |
} | |
} | |
-} | |
+}; | |
var WysiwygWidget = {}; | |
WysiwygWidget.Widget = Class.create(); | |
@@ -272,7 +272,7 @@ WysiwygWidget.Widget.prototype = { | |
getWysiwygNode: function() { | |
return tinyMCE.activeEditor.selection.getNode(); | |
} | |
-} | |
+}; | |
WysiwygWidget.chooser = Class.create(); | |
WysiwygWidget.chooser.prototype = { | |
@@ -404,4 +404,4 @@ WysiwygWidget.chooser.prototype = { | |
setElementLabel: function(value) { | |
this.getElementLabel().innerHTML = value; | |
} | |
-} | |
+}; | |
diff --git a/js/mage/captcha.js b/js/mage/captcha.js | |
index 525862e..7000dcc 100644 | |
--- a/js/mage/captcha.js | |
+++ b/js/mage/captcha.js | |
@@ -54,10 +54,10 @@ Captcha.prototype = { | |
document.observe('billing-request:completed', function(event) { | |
if (typeof window.checkout != 'undefined') { | |
if (window.checkout.method == 'guest' && $('guest_checkout')){ | |
- $('guest_checkout').captcha.refresh() | |
+ $('guest_checkout').captcha.refresh(); | |
} | |
if (window.checkout.method == 'register' && $('register_during_checkout')){ | |
- $('register_during_checkout').captcha.refresh() | |
+ $('register_during_checkout').captcha.refresh(); | |
} | |
} | |
}); | |
diff --git a/js/mage/directpost.js b/js/mage/directpost.js | |
index 111a9ae..b7095f2 100644 | |
--- a/js/mage/directpost.js | |
+++ b/js/mage/directpost.js | |
@@ -150,20 +150,17 @@ directPost.prototype = { | |
$(this.iframeId).hide(); | |
this.resetLoadWaiting(); | |
} | |
- alert(msg); | |
+ alert(msg.stripTags().toString()); | |
}, | |
returnQuote : function() { | |
var url = this.orderSaveUrl.replace('place', 'returnQuote'); | |
new Ajax.Request(url, { | |
onSuccess : function(transport) { | |
- try { | |
- response = eval('(' + transport.responseText + ')'); | |
- } catch (e) { | |
- response = {}; | |
- } | |
+ var response = transport.responseJSON || transport.responseText.evalJSON(true) || {}; | |
+ | |
if (response.error_message) { | |
- alert(response.error_message); | |
+ alert(response.error_message.stripTags().toString()); | |
} | |
$(this.iframeId).show(); | |
switch (this.controller) { | |
@@ -221,27 +218,25 @@ directPost.prototype = { | |
if (transport.status == 403) { | |
checkout.ajaxFailure(); | |
} | |
- try { | |
- response = eval('(' + transport.responseText + ')'); | |
- } catch (e) { | |
- response = {}; | |
- } | |
+ var response = transport.responseJSON || transport.responseText.evalJSON(true) || {}; | |
if (response.success && response.directpost) { | |
this.orderIncrementId = response.directpost.fields.x_invoice_num; | |
var paymentData = {}; | |
for ( var key in response.directpost.fields) { | |
- paymentData[key] = response.directpost.fields[key]; | |
+ if(response.directpost.fields.hasOwnProperty(key)) { | |
+ paymentData[key] = response.directpost.fields[key]; | |
+ } | |
} | |
var preparedData = this.preparePaymentRequest(paymentData); | |
this.sendPaymentRequest(preparedData); | |
} else { | |
var msg = response.error_messages; | |
- if (typeof (msg) == 'object') { | |
+ if (Object.isArray(msg)) { | |
msg = msg.join("\n"); | |
} | |
if (msg) { | |
- alert(msg); | |
+ alert(msg.stripTags().toString()); | |
} | |
if (response.update_section) { | |
@@ -312,17 +307,15 @@ directPost.prototype = { | |
}, | |
saveAdminOrderSuccess : function(data) { | |
- try { | |
- response = eval('(' + data + ')'); | |
- } catch (e) { | |
- response = {}; | |
- } | |
+ var response = transport.responseJSON || transport.responseText.evalJSON(true) || {}; | |
if (response.directpost) { | |
this.orderIncrementId = response.directpost.fields.x_invoice_num; | |
var paymentData = {}; | |
for ( var key in response.directpost.fields) { | |
- paymentData[key] = response.directpost.fields[key]; | |
+ if(response.directpost.fields.hasOwnProperty(key)) { | |
+ paymentData[key] = response.directpost.fields[key]; | |
+ } | |
} | |
var preparedData = this.preparePaymentRequest(paymentData); | |
this.sendPaymentRequest(preparedData); | |
@@ -332,11 +325,11 @@ directPost.prototype = { | |
} | |
if (response.error_messages) { | |
var msg = response.error_messages; | |
- if (typeof (msg) == 'object') { | |
+ if (Object.isArray(msg)) { | |
msg = msg.join("\n"); | |
} | |
if (msg) { | |
- alert(msg); | |
+ alert(msg.stripTags().toString()); | |
} | |
} | |
} | |
diff --git a/js/mage/translate.js b/js/mage/translate.js | |
index df3e826..19d4d85 100644 | |
--- a/js/mage/translate.js | |
+++ b/js/mage/translate.js | |
@@ -47,4 +47,4 @@ Translate.prototype = { | |
}.bind(this)); | |
} | |
} | |
-} | |
+}; | |
diff --git a/js/mage/translate_inline.js b/js/mage/translate_inline.js | |
index f2d8cd8..7694642 100644 | |
--- a/js/mage/translate_inline.js | |
+++ b/js/mage/translate_inline.js | |
@@ -35,15 +35,15 @@ TranslateInline.prototype = { | |
$$('*[data-translate]').each(this.initializeElement.bind(this)); | |
var scope = this; | |
Ajax.Responders.register({ onComplete: function() { | |
- window.setTimeout(scope.reinitElements.bind(scope), 50) | |
+ window.setTimeout(scope.reinitElements.bind(scope), 50); | |
} | |
}); | |
- var ElementNode = (typeof HTMLElement != 'undefined' ? HTMLElement : Element) | |
+ var ElementNode = (typeof HTMLElement != 'undefined' ? HTMLElement : Element); | |
var ElementUpdate = ElementNode.prototype.update; | |
ElementNode.prototype.update = function() { | |
ElementUpdate.apply(this, arguments); | |
$(this).select('*[data-translate]').each(scope.initializeElement.bind(scope)); | |
- } | |
+ }; | |
} | |
this.trigEl = $(trigEl); | |
this.trigEl.observe('click', this.formShow.bind(this)); | |
@@ -222,4 +222,4 @@ TranslateInline.prototype = { | |
escaped = escaped.replace(/"/g, '"'); | |
return escaped; | |
} | |
-} | |
+}; | |
diff --git a/js/prototype/validation.js b/js/prototype/validation.js | |
index 40b1331..8e671e2 100644 | |
--- a/js/prototype/validation.js | |
+++ b/js/prototype/validation.js | |
@@ -531,9 +531,9 @@ Validation.addAllThese([ | |
['validate-emailSender', 'Please use only visible characters and spaces.', function (v) { | |
return Validation.get('IsEmpty').test(v) || /^[\S ]+$/.test(v) | |
}], | |
- ['validate-password', 'Please enter 6 or more characters. Leading or trailing spaces will be ignored.', function(v) { | |
+ ['validate-password', 'Please enter 6 or more characters without leading or trailing spaces.', function(v) { | |
var pass=v.strip(); /*strip leading and trailing spaces*/ | |
- return !(pass.length>0 && pass.length < 6); | |
+ return (!(v.length>0 && v.length < 6) && v.length == pass.length); | |
}], | |
['validate-admin-password', 'Please enter 7 or more characters. Password should contain both numeric and alphabetic characters.', function(v) { | |
var pass=v.strip(); | |
@@ -656,10 +656,29 @@ Validation.addAllThese([ | |
v = parseNumber(v); | |
return !isNaN(v) && v > 0; | |
}], | |
+ | |
+ ['validate-special-price', 'The Special Price is active only when lower than the Actual Price.', function(v) { | |
+ var priceInput = $('price'); | |
+ var priceType = $('price_type'); | |
+ var priceValue = parseFloat(v); | |
+ | |
+ // Passed on non-related validators conditions (to not change order of validation) | |
+ if( | |
+ !priceInput | |
+ || Validation.get('IsEmpty').test(v) | |
+ || !Validation.get('validate-number').test(v) | |
+ ) { | |
+ return true; | |
+ } | |
+ if(priceType) { | |
+ return (priceType && priceValue <= 99.99); | |
+ } | |
+ return priceValue < parseFloat($F(priceInput)); | |
+ }], | |
['validate-state', 'Please select State/Province.', function(v) { | |
return (v!=0 || v == ''); | |
}], | |
- ['validate-new-password', 'Please enter 6 or more characters. Leading or trailing spaces will be ignored.', function(v) { | |
+ ['validate-new-password', 'Please enter 6 or more characters without leading or trailing spaces.', function(v) { | |
if (!Validation.get('validate-password').test(v)) return false; | |
if (Validation.get('IsEmpty').test(v) && v != '') return false; | |
return true; | |
@@ -880,7 +899,7 @@ Validation.creditCartTypes = $H({ | |
// 'SS': [new RegExp('^((6759[0-9]{12})|(5018|5020|5038|6304|6759|6761|6763[0-9]{12,19})|(49[013][1356][0-9]{12})|(6333[0-9]{12})|(6334[0-4]\d{11})|(633110[0-9]{10})|(564182[0-9]{10}))([0-9]{2,3})?$'), new RegExp('^([0-9]{3}|[0-9]{4})?$'), true], | |
'SO': [new RegExp('^(6334[5-9]([0-9]{11}|[0-9]{13,14}))|(6767([0-9]{12}|[0-9]{14,15}))$'), new RegExp('^([0-9]{3}|[0-9]{4})?$'), true], | |
'VI': [new RegExp('^4[0-9]{12}([0-9]{3})?$'), new RegExp('^[0-9]{3}$'), true], | |
- 'MC': [new RegExp('^5[1-5][0-9]{14}$'), new RegExp('^[0-9]{3}$'), true], | |
+ 'MC': [new RegExp('^(5[1-5][0-9]{14}|2(22[1-9][0-9]{12}|2[3-9][0-9]{13}|[3-6][0-9]{14}|7[0-1][0-9]{13}|720[0-9]{12}))$'), new RegExp('^[0-9]{3}$'), true], | |
'AE': [new RegExp('^3[47][0-9]{13}$'), new RegExp('^[0-9]{4}$'), true], | |
'DI': [new RegExp('^(30[0-5][0-9]{13}|3095[0-9]{12}|35(2[8-9][0-9]{12}|[3-8][0-9]{13})|36[0-9]{12}|3[8-9][0-9]{14}|6011(0[0-9]{11}|[2-4][0-9]{11}|74[0-9]{10}|7[7-9][0-9]{10}|8[6-9][0-9]{10}|9[0-9]{11})|62(2(12[6-9][0-9]{10}|1[3-9][0-9]{11}|[2-8][0-9]{12}|9[0-1][0-9]{11}|92[0-5][0-9]{10})|[4-6][0-9]{13}|8[2-8][0-9]{12})|6(4[4-9][0-9]{13}|5[0-9]{14}))$'), new RegExp('^[0-9]{3}$'), true], | |
'JCB': [new RegExp('^(30[0-5][0-9]{13}|3095[0-9]{12}|35(2[8-9][0-9]{12}|[3-8][0-9]{13})|36[0-9]{12}|3[8-9][0-9]{14}|6011(0[0-9]{11}|[2-4][0-9]{11}|74[0-9]{10}|7[7-9][0-9]{10}|8[6-9][0-9]{10}|9[0-9]{11})|62(2(12[6-9][0-9]{10}|1[3-9][0-9]{11}|[2-8][0-9]{12}|9[0-1][0-9]{11}|92[0-5][0-9]{10})|[4-6][0-9]{13}|8[2-8][0-9]{12})|6(4[4-9][0-9]{13}|5[0-9]{14}))$'), new RegExp('^[0-9]{3,4}$'), true], | |
diff --git a/js/prototype/window.js b/js/prototype/window.js | |
index f7ae25d..c684f79 100644 | |
--- a/js/prototype/window.js | |
+++ b/js/prototype/window.js | |
@@ -1589,7 +1589,7 @@ var Dialog = { | |
if (win.cancelCallback) | |
win.cancelCallback(win); | |
} | |
-} | |
+}; | |
/* | |
Based on Lightbox JS: Fullsize Image Overlays | |
by Lokesh Dhakar - http://www.huddletogether.com | |
@@ -1867,5 +1867,4 @@ var WindowUtilities = { | |
objBody.removeChild(tmpObj); | |
return size; | |
} | |
-} | |
- | |
+}; | |
diff --git a/js/prototype/window_ext.js b/js/prototype/window_ext.js | |
index 60efac6..706a295 100644 | |
--- a/js/prototype/window_ext.js | |
+++ b/js/prototype/window_ext.js | |
@@ -3,113 +3,116 @@ | |
// | |
// Object to store hide/show windows status in a cookie | |
// Just add at the end of your HTML file this javascript line: WindowStore.init() | |
+/** | |
+ * @deprecated | |
+ */ | |
WindowStore = { | |
- doSetCookie: false, | |
- cookieName: "__window_store__", | |
- expired: null, | |
- | |
- // Init function with two optional parameters | |
- // - cookieName (default = __window_store__) | |
- // - expiration date (default 3 years from now) | |
- init: function(cookieName, expired) { | |
- WindowStore.cookieName = cookieName || WindowStore.cookieName | |
- | |
- if (! expired) { | |
- var today = new Date(); | |
- today.setYear(today.getYear()+1903); | |
- WindowStore.expired = today; | |
- } | |
- else | |
- WindowStore.expired = expired; | |
- | |
- Windows.windows.each(function(win) { | |
- win.setCookie(win.getId(), WindowStore.expired); | |
- }); | |
- | |
- // Create observer on show/hide events | |
- var myObserver = { | |
- onShow: function(eventName, win) { | |
- WindowStore._saveCookie(); | |
- }, | |
- | |
- onClose: function(eventName, win) { | |
- WindowStore._saveCookie(); | |
- }, | |
- | |
- onHide: function(eventName, win) { | |
- WindowStore._saveCookie(); | |
- } | |
- } | |
- Windows.addObserver(myObserver); | |
- | |
- WindowStore._restoreWindows(); | |
- WindowStore._saveCookie(); | |
- }, | |
- | |
- show: function(win) { | |
- eval("var cookie = " + WindowUtilities.getCookie(WindowStore.cookieName)); | |
- if (cookie != null) { | |
- if (cookie[win.getId()]) | |
- win.show(); | |
- } | |
- else | |
- win.show(); | |
- }, | |
- | |
- // Function to store windows show/hide status in a cookie | |
- _saveCookie: function() { | |
- if (!doSetCookie) | |
- return; | |
- | |
- var cookieValue = "{"; | |
- Windows.windows.each(function(win) { | |
- if (cookieValue != "{") | |
- cookieValue += "," | |
- cookieValue += win.getId() + ": " + win.isVisible(); | |
- }); | |
- cookieValue += "}" | |
- | |
- WindowUtilities.setCookie(cookieValue, [WindowStore.cookieName, WindowStore.expired]); | |
- }, | |
- | |
- // Function to restore windows show/hide status from a cookie if exists | |
- _restoreWindows: function() { | |
- eval("var cookie = " + WindowUtilities.getCookie(WindowStore.cookieName)); | |
- if (cookie != null) { | |
- doSetCookie = false; | |
- Windows.windows.each(function(win) { | |
- if (cookie[win.getId()]) | |
- win.show(); | |
- }); | |
+ doSetCookie: false, | |
+ cookieName: "__window_store__", | |
+ expired: null, | |
+ | |
+ // Init function with two optional parameters | |
+ // - cookieName (default = __window_store__) | |
+ // - expiration date (default 3 years from now) | |
+ init: function(cookieName, expired) { | |
+ WindowStore.cookieName = cookieName || WindowStore.cookieName | |
+ | |
+ if (! expired) { | |
+ var today = new Date(); | |
+ today.setYear(today.getYear()+1903); | |
+ WindowStore.expired = today; | |
+ } | |
+ else | |
+ WindowStore.expired = expired; | |
+ | |
+ Windows.windows.each(function(win) { | |
+ win.setCookie(win.getId(), WindowStore.expired); | |
+ }); | |
+ | |
+ // Create observer on show/hide events | |
+ var myObserver = { | |
+ onShow: function(eventName, win) { | |
+ WindowStore._saveCookie(); | |
+ }, | |
+ | |
+ onClose: function(eventName, win) { | |
+ WindowStore._saveCookie(); | |
+ }, | |
+ | |
+ onHide: function(eventName, win) { | |
+ WindowStore._saveCookie(); | |
+ } | |
+ } | |
+ Windows.addObserver(myObserver); | |
+ | |
+ WindowStore._restoreWindows(); | |
+ WindowStore._saveCookie(); | |
+ }, | |
+ | |
+ show: function(win) { | |
+ eval("var cookie = " + WindowUtilities.getCookie(WindowStore.cookieName)); | |
+ if (cookie != null) { | |
+ if (cookie[win.getId()]) | |
+ win.show(); | |
+ } | |
+ else | |
+ win.show(); | |
+ }, | |
+ | |
+ // Function to store windows show/hide status in a cookie | |
+ _saveCookie: function() { | |
+ if (!doSetCookie) | |
+ return; | |
+ | |
+ var cookieValue = "{"; | |
+ Windows.windows.each(function(win) { | |
+ if (cookieValue != "{") | |
+ cookieValue += "," | |
+ cookieValue += win.getId() + ": " + win.isVisible(); | |
+ }); | |
+ cookieValue += "}" | |
+ | |
+ WindowUtilities.setCookie(cookieValue, [WindowStore.cookieName, WindowStore.expired]); | |
+ }, | |
+ | |
+ // Function to restore windows show/hide status from a cookie if exists | |
+ _restoreWindows: function() { | |
+ eval("var cookie = " + WindowUtilities.getCookie(WindowStore.cookieName)); | |
+ if (cookie != null) { | |
+ doSetCookie = false; | |
+ Windows.windows.each(function(win) { | |
+ if (cookie[win.getId()]) | |
+ win.show(); | |
+ }); | |
+ } | |
+ doSetCookie = true; | |
} | |
- doSetCookie = true; | |
- } | |
-} | |
+}; | |
// Object to set a close key an all windows | |
WindowCloseKey = { | |
- keyCode: Event.KEY_ESC, | |
- | |
- init: function(keyCode) { | |
- if (keyCode) | |
- WindowCloseKey.keyCode = keyCode; | |
- | |
- Event.observe(document, 'keydown', this._closeCurrentWindow.bindAsEventListener(this)); | |
- }, | |
- | |
- _closeCurrentWindow: function(event) { | |
- var e = event || window.event | |
- var characterCode = e.which || e.keyCode; | |
- | |
- // Check if there is a top window (it means it's an URL content) | |
- var win = top.Windows.focusedWindow; | |
- if (characterCode == WindowCloseKey.keyCode && win) { | |
- if (win.cancelCallback) | |
- top.Dialog.cancelCallback(); | |
- else if (win.okCallback) | |
- top.Dialog.okCallback(); | |
- else | |
- top.Windows.close(top.Windows.focusedWindow.getId()); | |
+ keyCode: Event.KEY_ESC, | |
+ | |
+ init: function(keyCode) { | |
+ if (keyCode) | |
+ WindowCloseKey.keyCode = keyCode; | |
+ | |
+ Event.observe(document, 'keydown', this._closeCurrentWindow.bindAsEventListener(this)); | |
+ }, | |
+ | |
+ _closeCurrentWindow: function(event) { | |
+ var e = event || window.event | |
+ var characterCode = e.which || e.keyCode; | |
+ | |
+ // Check if there is a top window (it means it's an URL content) | |
+ var win = top.Windows.focusedWindow; | |
+ if (characterCode == WindowCloseKey.keyCode && win) { | |
+ if (win.cancelCallback) | |
+ top.Dialog.cancelCallback(); | |
+ else if (win.okCallback) | |
+ top.Dialog.okCallback(); | |
+ else | |
+ top.Windows.close(top.Windows.focusedWindow.getId()); | |
+ } | |
} | |
- } | |
-} | |
\ No newline at end of file | |
+}; | |
diff --git a/js/varien/accordion.js b/js/varien/accordion.js | |
index c71c50a..edbc8cb 100644 | |
--- a/js/varien/accordion.js | |
+++ b/js/varien/accordion.js | |
@@ -61,7 +61,7 @@ Accordion.prototype = { | |
var pastCurrentSection = false; | |
for (var i=0; i<this.sections.length; i++) { | |
if (pastCurrentSection) { | |
- Element.removeClassName(this.sections[i], 'allow') | |
+ Element.removeClassName(this.sections[i], 'allow'); | |
} | |
if (this.sections[i].id==section.id) { | |
pastCurrentSection = true; | |
@@ -83,7 +83,7 @@ Accordion.prototype = { | |
var nextIndex = parseInt(section)+1; | |
if (this.sections[section].id == this.currentSection && this.sections[nextIndex]){ | |
if (setAllow) { | |
- Element.addClassName(this.sections[nextIndex], 'allow') | |
+ Element.addClassName(this.sections[nextIndex], 'allow'); | |
} | |
this.openSection(this.sections[nextIndex]); | |
return; | |
@@ -96,7 +96,7 @@ Accordion.prototype = { | |
var prevIndex = parseInt(section)-1; | |
if (this.sections[section].id == this.currentSection && this.sections[prevIndex]){ | |
if (setAllow) { | |
- Element.addClassName(this.sections[prevIndex], 'allow') | |
+ Element.addClassName(this.sections[prevIndex], 'allow'); | |
} | |
this.openSection(this.sections[prevIndex]); | |
return; | |
@@ -109,4 +109,4 @@ Accordion.prototype = { | |
this.closeSection(this.currentSection); | |
} | |
} | |
-} | |
+}; | |
diff --git a/js/varien/configurable.js b/js/varien/configurable.js | |
index ec6305d..868fb3a 100644 | |
--- a/js/varien/configurable.js | |
+++ b/js/varien/configurable.js | |
@@ -72,7 +72,7 @@ Product.Config.prototype = { | |
// Put events to check select reloads | |
this.settings.each(function(element){ | |
- Event.observe(element, 'change', this.configure.bind(this)) | |
+ Event.observe(element, 'change', this.configure.bind(this)); | |
}.bind(this)); | |
// fill state | |
@@ -83,7 +83,7 @@ Product.Config.prototype = { | |
element.attributeId = attributeId; | |
this.state[attributeId] = false; | |
} | |
- }.bind(this)) | |
+ }.bind(this)); | |
// Init settings dropdown | |
var childSettings = []; | |
@@ -91,7 +91,7 @@ Product.Config.prototype = { | |
var prevSetting = this.settings[i-1] ? this.settings[i-1] : false; | |
var nextSetting = this.settings[i+1] ? this.settings[i+1] : false; | |
if (i == 0){ | |
- this.fillSelect(this.settings[i]) | |
+ this.fillSelect(this.settings[i]); | |
} else { | |
this.settings[i].disabled = true; | |
} | |
@@ -140,7 +140,7 @@ Product.Config.prototype = { | |
reloadOptionLabels: function(element){ | |
var selectedPrice; | |
if(element.options[element.selectedIndex].config && !this.config.stablePrices){ | |
- selectedPrice = parseFloat(element.options[element.selectedIndex].config.price) | |
+ selectedPrice = parseFloat(element.options[element.selectedIndex].config.price); | |
} | |
else{ | |
selectedPrice = 0; | |
@@ -317,4 +317,4 @@ Product.Config.prototype = { | |
} | |
} | |
-} | |
+}; | |
diff --git a/js/varien/form.js b/js/varien/form.js | |
index ef0442f..8a85445 100644 | |
--- a/js/varien/form.js | |
+++ b/js/varien/form.js | |
@@ -42,7 +42,7 @@ VarienForm.prototype = { | |
this.bindElements(); | |
if(this.firstFieldFocus){ | |
try{ | |
- Form.Element.focus(Form.findFirstElement(this.form)) | |
+ Form.Element.focus(Form.findFirstElement(this.form)); | |
} | |
catch(e){} | |
} | |
@@ -117,7 +117,7 @@ VarienForm.prototype = { | |
}, | |
reloadChildren: function(transport){ | |
- var data = eval('(' + transport.responseText + ')'); | |
+ var data = transport.responseJSON || transport.responseText.evalJSON(true) || {}; | |
this.cache[this.currLoader]['data'][this.currDataIndex] = data; | |
this.setDataToChild(data); | |
}, | |
@@ -158,7 +158,7 @@ VarienForm.prototype = { | |
this.callback(); | |
} | |
} | |
-} | |
+}; | |
RegionUpdater = Class.create(); | |
RegionUpdater.prototype = { | |
@@ -215,7 +215,7 @@ RegionUpdater.prototype = { | |
} else if (regionRequired) { | |
wildCard.show(); | |
if (!label.hasClassName('required')) { | |
- label.addClassName('required') | |
+ label.addClassName('required'); | |
} | |
} | |
} | |
@@ -358,7 +358,7 @@ RegionUpdater.prototype = { | |
$(elem).value = currentVal; | |
return; | |
} | |
-} | |
+}; | |
ZipUpdater = Class.create(); | |
ZipUpdater.prototype = { | |
@@ -377,7 +377,7 @@ ZipUpdater.prototype = { | |
// Ajax-request and normal content load compatibility | |
if (this.zipElement != undefined) { | |
- Validation.reset(this.zipElement) | |
+ Validation.reset(this.zipElement); | |
this._setPostcodeOptional(); | |
} else { | |
Event.observe(window, "load", this._setPostcodeOptional.bind(this)); | |
@@ -412,4 +412,4 @@ ZipUpdater.prototype = { | |
} | |
} | |
} | |
-} | |
+}; | |
diff --git a/js/varien/iehover-fix.js b/js/varien/iehover-fix.js | |
index 7f25ee0..8ff9c53 100644 | |
--- a/js/varien/iehover-fix.js | |
+++ b/js/varien/iehover-fix.js | |
@@ -31,11 +31,15 @@ function toggleMenu(el, over) | |
if (over) { | |
Element.addClassName(el, 'over'); | |
- if(iS){ uL.addClassName('shown-sub')}; | |
+ if(iS){ | |
+ uL.addClassName('shown-sub'); | |
+ }; | |
} | |
else { | |
Element.removeClassName(el, 'over'); | |
- if(iS){ uL.removeClassName('shown-sub')}; | |
+ if(iS){ | |
+ uL.removeClassName('shown-sub'); | |
+ }; | |
} | |
} | |
@@ -44,8 +48,8 @@ ieHover = function() { | |
items = $$('#nav ul', '.truncated_full_value .item-options', '.tool-tip'); | |
$$('#checkout-step-payment', '.tool-tip').each(function(el) { | |
el.show(); | |
- el.setStyle({'visibility':'hidden'}) | |
- }) | |
+ el.setStyle({'visibility':'hidden'}); | |
+ }); | |
for (var j=0; j<items.length; j++) { | |
iframe = document.createElement('IFRAME'); | |
iframe.src = BLANK_URL; | |
@@ -58,7 +62,7 @@ ieHover = function() { | |
} | |
$$('.tool-tip', '#checkout-step-payment').each(function(el) { | |
el.hide(); | |
- el.setStyle({'visibility':'visible'}) | |
- }) | |
-} | |
+ el.setStyle({'visibility':'visible'}); | |
+ }); | |
+}; | |
Event.observe(window, 'load', ieHover); | |
diff --git a/js/varien/js.js b/js/varien/js.js | |
index 8b761b3..665918e 100644 | |
--- a/js/varien/js.js | |
+++ b/js/varien/js.js | |
@@ -28,16 +28,19 @@ function popWin(url,win,para) { | |
} | |
function setLocation(url){ | |
- window.location.href = url; | |
+ window.location.href = encodeURI(url); | |
} | |
function setPLocation(url, setFocus){ | |
if( setFocus ) { | |
window.opener.focus(); | |
} | |
- window.opener.location.href = url; | |
+ window.opener.location.href = encodeURI(url); | |
} | |
+/** | |
+ * @deprecated | |
+ */ | |
function setLanguageCode(code, fromCode){ | |
//TODO: javascript cookies have different domain and path than php cookies | |
var href = window.location.href; | |
@@ -173,7 +176,7 @@ function decorateTable(table, options) { | |
function decorateList(list, nonRecursive) { | |
if ($(list)) { | |
if (typeof(nonRecursive) == 'undefined') { | |
- var items = $(list).select('li') | |
+ var items = $(list).select('li'); | |
} | |
else { | |
var items = $(list).childElements(); | |
@@ -251,7 +254,7 @@ function formatCurrency(price, format, showPlus){ | |
* when Math.abs(0).toFixed() executed on "0" number. | |
* Result is "0.-0" :( | |
*/ | |
- var r = (j ? i.substr(0, j) + groupSymbol : "") + i.substr(j).replace(re, "$1" + groupSymbol) + (precision ? decimalSymbol + Math.abs(price - i).toFixed(precision).replace(/-/, 0).slice(2) : "") | |
+ var r = (j ? i.substr(0, j) + groupSymbol : "") + i.substr(j).replace(re, "$1" + groupSymbol) + (precision ? decimalSymbol + Math.abs(price - i).toFixed(precision).replace(/-/, 0).slice(2) : ""); | |
var pattern = ''; | |
if (format.pattern.indexOf('{sign}') == -1) { | |
pattern = s + format.pattern; | |
@@ -264,11 +267,15 @@ function formatCurrency(price, format, showPlus){ | |
function expandDetails(el, childClass) { | |
if (Element.hasClassName(el,'show-details')) { | |
- $$(childClass).each(function(item){item.hide()}); | |
+ $$(childClass).each(function(item){ | |
+ item.hide(); | |
+ }); | |
Element.removeClassName(el,'show-details'); | |
} | |
else { | |
- $$(childClass).each(function(item){item.show()}); | |
+ $$(childClass).each(function(item){ | |
+ item.show(); | |
+ }); | |
Element.addClassName(el,'show-details'); | |
} | |
} | |
@@ -282,11 +289,11 @@ if (!window.Varien) | |
Varien.showLoading = function(){ | |
var loader = $('loading-process'); | |
loader && loader.show(); | |
-} | |
+}; | |
Varien.hideLoading = function(){ | |
var loader = $('loading-process'); | |
loader && loader.hide(); | |
-} | |
+}; | |
Varien.GlobalHandlers = { | |
onCreate: function() { | |
Varien.showLoading(); | |
@@ -369,7 +376,7 @@ Varien.searchForm.prototype = { | |
} | |
this.form.submit(); | |
} | |
-} | |
+}; | |
Varien.Tabs = Class.create(); | |
Varien.Tabs.prototype = { | |
@@ -399,7 +406,7 @@ Varien.Tabs.prototype = { | |
} | |
}); | |
} | |
-} | |
+}; | |
Varien.DateElement = Class.create(); | |
Varien.DateElement.prototype = { | |
@@ -436,6 +443,9 @@ Varien.DateElement.prototype = { | |
this.year.setAttribute('autocomplete','off'); | |
this.advice.hide(); | |
+ | |
+ var date = new Date; | |
+ this.curyear = date.getFullYear(); | |
}, | |
validate: function() { | |
var error = false, | |
@@ -452,12 +462,13 @@ Varien.DateElement.prototype = { | |
this.full.value = ''; | |
} | |
} else if (!day || !month || !year) { | |
- error = 'Please enter a valid full date.'; | |
+ error = 'Please enter a valid full date'; | |
} else { | |
var date = new Date, countDaysInMonth = 0, errorType = null; | |
date.setYear(year);date.setMonth(month-1);date.setDate(32); | |
countDaysInMonth = 32 - date.getDate(); | |
if(!countDaysInMonth || countDaysInMonth>31) countDaysInMonth = 31; | |
+ if(year < 1900) error = this.errorTextModifier(this.validateDataErrorText); | |
if (day<1 || day>countDaysInMonth) { | |
errorType = 'day'; | |
@@ -509,13 +520,12 @@ Varien.DateElement.prototype = { | |
}, | |
validateData: function() { | |
var year = this.fullDate.getFullYear(); | |
- var date = new Date; | |
- this.curyear = date.getFullYear(); | |
return (year>=1900 && year<=this.curyear); | |
}, | |
validateDataErrorType: 'year', | |
validateDataErrorText: 'Please enter a valid year (1900-%d).', | |
errorTextModifier: function(text) { | |
+ text = Translator.translate(text); | |
return text.replace('%d', this.curyear); | |
}, | |
setDateRange: function(minDate, maxDate) { | |
@@ -553,15 +563,15 @@ Varien.dateRangeDate.prototype = Object.extend(new Varien.DateElement(), { | |
if (isNaN(this.minDate)) { | |
this.minDate = new Date('1/1/1900'); | |
} | |
- validate = validate && (this.fullDate >= this.minDate) | |
+ validate = validate && (this.fullDate >= this.minDate); | |
} | |
if (this.maxDate) { | |
- this.maxDate = new Date(this.maxDate) | |
+ this.maxDate = new Date(this.maxDate); | |
this.minDate.setHours(0); | |
if (isNaN(this.maxDate)) { | |
this.maxDate = new Date(); | |
} | |
- validate = validate && (this.fullDate <= this.maxDate) | |
+ validate = validate && (this.fullDate <= this.maxDate); | |
} | |
if (this.maxDate && this.minDate) { | |
this.validateDataErrorText = 'Please enter a valid date between %s and %s'; | |
@@ -613,12 +623,12 @@ function truncateOptions() { | |
$$('.truncated').each(function(element){ | |
Event.observe(element, 'mouseover', function(){ | |
if (element.down('div.truncated_full_value')) { | |
- element.down('div.truncated_full_value').addClassName('show') | |
+ element.down('div.truncated_full_value').addClassName('show'); | |
} | |
}); | |
Event.observe(element, 'mouseout', function(){ | |
if (element.down('div.truncated_full_value')) { | |
- element.down('div.truncated_full_value').removeClassName('show') | |
+ element.down('div.truncated_full_value').removeClassName('show'); | |
} | |
}); | |
@@ -633,7 +643,7 @@ Element.addMethods({ | |
{ | |
element = $(element); | |
if(element.innerText && !Prototype.Browser.Opera) { | |
- return element.innerText | |
+ return element.innerText; | |
} | |
return element.innerHTML.stripScripts().unescapeHTML().replace(/[\n\r\s]+/g, ' ').strip(); | |
} | |
@@ -668,7 +678,7 @@ function fireEvent(element, event) { | |
} else { | |
// dispatch for IE before version 9 | |
var evt = document.createEventObject(); | |
- return element.fireEvent('on' + event, evt) | |
+ return element.fireEvent('on' + event, evt); | |
} | |
} | |
diff --git a/js/varien/payment.js b/js/varien/payment.js | |
index e6614e8..c644d40 100644 | |
--- a/js/varien/payment.js | |
+++ b/js/varien/payment.js | |
@@ -65,4 +65,4 @@ paymentForm.prototype = { | |
this.currentMethod = method; | |
} | |
} | |
-} | |
+}; | |
diff --git a/js/varien/product.js b/js/varien/product.js | |
index a915f59..dfc0eb3 100644 | |
--- a/js/varien/product.js | |
+++ b/js/varien/product.js | |
@@ -240,7 +240,7 @@ Product.Zoom.prototype = { | |
return [x,y]; | |
} | |
-} | |
+}; | |
/**************************** CONFIGURABLE PRODUCT **************************/ | |
Product.Config = Class.create(); | |
@@ -254,7 +254,7 @@ Product.Config.prototype = { | |
this.prices = config.prices; | |
this.settings.each(function(element){ | |
- Event.observe(element, 'change', this.configure.bind(this)) | |
+ Event.observe(element, 'change', this.configure.bind(this)); | |
}.bind(this)); | |
// fill state | |
@@ -265,7 +265,7 @@ Product.Config.prototype = { | |
element.attributeId = attributeId; | |
this.state[attributeId] = false; | |
} | |
- }.bind(this)) | |
+ }.bind(this)); | |
// Init settings dropdown | |
var childSettings = []; | |
@@ -273,7 +273,7 @@ Product.Config.prototype = { | |
var prevSetting = this.settings[i-1] ? this.settings[i-1] : false; | |
var nextSetting = this.settings[i+1] ? this.settings[i+1] : false; | |
if(i==0){ | |
- this.fillSelect(this.settings[i]) | |
+ this.fillSelect(this.settings[i]); | |
} | |
else { | |
this.settings[i].disabled=true; | |
@@ -340,7 +340,7 @@ Product.Config.prototype = { | |
reloadOptionLabels: function(element){ | |
var selectedPrice; | |
if(element.options[element.selectedIndex].config){ | |
- selectedPrice = parseFloat(element.options[element.selectedIndex].config.price) | |
+ selectedPrice = parseFloat(element.options[element.selectedIndex].config.price); | |
} | |
else{ | |
selectedPrice = 0; | |
@@ -509,7 +509,7 @@ Product.Config.prototype = { | |
} | |
} | |
-} | |
+}; | |
/**************************** SUPER PRODUCTS ********************************/ | |
@@ -548,263 +548,4 @@ Product.Super.Configurable.prototype = { | |
}); | |
} | |
} | |
-} | |
- | |
-/**************************** PRICE RELOADER ********************************/ | |
-Product.OptionsPrice = Class.create(); | |
-Product.OptionsPrice.prototype = { | |
- initialize: function(config) { | |
- this.productId = config.productId; | |
- this.priceFormat = config.priceFormat; | |
- this.includeTax = config.includeTax; | |
- this.defaultTax = config.defaultTax; | |
- this.currentTax = config.currentTax; | |
- this.productPrice = config.productPrice; | |
- this.showIncludeTax = config.showIncludeTax; | |
- this.showBothPrices = config.showBothPrices; | |
- this.productOldPrice = config.productOldPrice; | |
- this.priceInclTax = config.priceInclTax; | |
- this.priceExclTax = config.priceExclTax; | |
- this.skipCalculate = config.skipCalculate; /** @deprecated after 1.5.1.0 */ | |
- this.duplicateIdSuffix = config.idSuffix; | |
- this.specialTaxPrice = config.specialTaxPrice; | |
- this.tierPrices = config.tierPrices; | |
- this.tierPricesInclTax = config.tierPricesInclTax; | |
- | |
- this.oldPlusDisposition = config.oldPlusDisposition; | |
- this.plusDisposition = config.plusDisposition; | |
- this.plusDispositionTax = config.plusDispositionTax; | |
- | |
- this.oldMinusDisposition = config.oldMinusDisposition; | |
- this.minusDisposition = config.minusDisposition; | |
- | |
- this.exclDisposition = config.exclDisposition; | |
- | |
- this.optionPrices = {}; | |
- this.customPrices = {}; | |
- this.containers = {}; | |
- | |
- this.displayZeroPrice = true; | |
- | |
- this.initPrices(); | |
- }, | |
- | |
- setDuplicateIdSuffix: function(idSuffix) { | |
- this.duplicateIdSuffix = idSuffix; | |
- }, | |
- | |
- initPrices: function() { | |
- this.containers[0] = 'product-price-' + this.productId; | |
- this.containers[1] = 'bundle-price-' + this.productId; | |
- this.containers[2] = 'price-including-tax-' + this.productId; | |
- this.containers[3] = 'price-excluding-tax-' + this.productId; | |
- this.containers[4] = 'old-price-' + this.productId; | |
- }, | |
- | |
- changePrice: function(key, price) { | |
- this.optionPrices[key] = price; | |
- }, | |
- | |
- addCustomPrices: function(key, price) { | |
- this.customPrices[key] = price; | |
- }, | |
- getOptionPrices: function() { | |
- var price = 0; | |
- var nonTaxable = 0; | |
- var oldPrice = 0; | |
- var priceInclTax = 0; | |
- var currentTax = this.currentTax; | |
- $H(this.optionPrices).each(function(pair) { | |
- if ('undefined' != typeof(pair.value.price) && 'undefined' != typeof(pair.value.oldPrice)) { | |
- price += parseFloat(pair.value.price); | |
- oldPrice += parseFloat(pair.value.oldPrice); | |
- } else if (pair.key == 'nontaxable') { | |
- nonTaxable = pair.value; | |
- } else if (pair.key == 'priceInclTax') { | |
- priceInclTax += pair.value; | |
- } else if (pair.key == 'optionsPriceInclTax') { | |
- priceInclTax += pair.value * (100 + currentTax) / 100; | |
- } else { | |
- price += parseFloat(pair.value); | |
- oldPrice += parseFloat(pair.value); | |
- } | |
- }); | |
- var result = [price, nonTaxable, oldPrice, priceInclTax]; | |
- return result; | |
- }, | |
- | |
- reload: function() { | |
- var price; | |
- var formattedPrice; | |
- var optionPrices = this.getOptionPrices(); | |
- var nonTaxable = optionPrices[1]; | |
- var optionOldPrice = optionPrices[2]; | |
- var priceInclTax = optionPrices[3]; | |
- optionPrices = optionPrices[0]; | |
- | |
- $H(this.containers).each(function(pair) { | |
- var _productPrice; | |
- var _plusDisposition; | |
- var _minusDisposition; | |
- var _priceInclTax; | |
- if ($(pair.value)) { | |
- if (pair.value == 'old-price-'+this.productId && this.productOldPrice != this.productPrice) { | |
- _productPrice = this.productOldPrice; | |
- _plusDisposition = this.oldPlusDisposition; | |
- _minusDisposition = this.oldMinusDisposition; | |
- } else { | |
- _productPrice = this.productPrice; | |
- _plusDisposition = this.plusDisposition; | |
- _minusDisposition = this.minusDisposition; | |
- } | |
- _priceInclTax = priceInclTax; | |
- | |
- if (pair.value == 'old-price-'+this.productId && optionOldPrice !== undefined) { | |
- price = optionOldPrice+parseFloat(_productPrice); | |
- } else if (this.specialTaxPrice == 'true' && this.priceInclTax !== undefined && this.priceExclTax !== undefined) { | |
- price = optionPrices+parseFloat(this.priceExclTax); | |
- _priceInclTax += this.priceInclTax; | |
- } else { | |
- price = optionPrices+parseFloat(_productPrice); | |
- _priceInclTax += parseFloat(_productPrice) * (100 + this.currentTax) / 100; | |
- } | |
- | |
- if (this.specialTaxPrice == 'true') { | |
- var excl = price; | |
- var incl = _priceInclTax; | |
- } else if (this.includeTax == 'true') { | |
- // tax = tax included into product price by admin | |
- var tax = price / (100 + this.defaultTax) * this.defaultTax; | |
- var excl = price - tax; | |
- var incl = excl*(1+(this.currentTax/100)); | |
- } else { | |
- var tax = price * (this.currentTax / 100); | |
- var excl = price; | |
- var incl = excl + tax; | |
- } | |
- | |
- var subPrice = 0; | |
- var subPriceincludeTax = 0; | |
- Object.values(this.customPrices).each(function(el){ | |
- if (el.excludeTax && el.includeTax) { | |
- subPrice += parseFloat(el.excludeTax); | |
- subPriceincludeTax += parseFloat(el.includeTax); | |
- } else { | |
- subPrice += parseFloat(el.price); | |
- subPriceincludeTax += parseFloat(el.price); | |
- } | |
- }); | |
- excl += subPrice; | |
- incl += subPriceincludeTax; | |
- | |
- if (typeof this.exclDisposition == 'undefined') { | |
- excl += parseFloat(_plusDisposition); | |
- } | |
- | |
- incl += parseFloat(_plusDisposition) + parseFloat(this.plusDispositionTax); | |
- excl -= parseFloat(_minusDisposition); | |
- incl -= parseFloat(_minusDisposition); | |
- | |
- //adding nontaxlable part of options | |
- excl += parseFloat(nonTaxable); | |
- incl += parseFloat(nonTaxable); | |
- | |
- if (pair.value == 'price-including-tax-'+this.productId) { | |
- price = incl; | |
- } else if (pair.value == 'price-excluding-tax-'+this.productId) { | |
- price = excl; | |
- } else if (pair.value == 'old-price-'+this.productId) { | |
- if (this.showIncludeTax || this.showBothPrices) { | |
- price = incl; | |
- } else { | |
- price = excl; | |
- } | |
- } else { | |
- if (this.showIncludeTax) { | |
- price = incl; | |
- } else { | |
- price = excl; | |
- } | |
- } | |
- | |
- if (price < 0) price = 0; | |
- | |
- if (price > 0 || this.displayZeroPrice) { | |
- formattedPrice = this.formatPrice(price); | |
- } else { | |
- formattedPrice = ''; | |
- } | |
- | |
- if ($(pair.value).select('.price')[0]) { | |
- $(pair.value).select('.price')[0].innerHTML = formattedPrice; | |
- if ($(pair.value+this.duplicateIdSuffix) && $(pair.value+this.duplicateIdSuffix).select('.price')[0]) { | |
- $(pair.value+this.duplicateIdSuffix).select('.price')[0].innerHTML = formattedPrice; | |
- } | |
- } else { | |
- $(pair.value).innerHTML = formattedPrice; | |
- if ($(pair.value+this.duplicateIdSuffix)) { | |
- $(pair.value+this.duplicateIdSuffix).innerHTML = formattedPrice; | |
- } | |
- } | |
- }; | |
- }.bind(this)); | |
- | |
- if (typeof(skipTierPricePercentUpdate) === "undefined" && typeof(this.tierPrices) !== "undefined") { | |
- for (var i = 0; i < this.tierPrices.length; i++) { | |
- $$('.benefit').each(function(el) { | |
- var parsePrice = function(html) { | |
- var format = this.priceFormat; | |
- var decimalSymbol = format.decimalSymbol === undefined ? "," : format.decimalSymbol; | |
- var regexStr = '[^0-9-' + decimalSymbol + ']'; | |
- //remove all characters except number and decimal symbol | |
- html = html.replace(new RegExp(regexStr, 'g'), ''); | |
- html = html.replace(decimalSymbol, '.'); | |
- return parseFloat(html); | |
- }.bind(this); | |
- | |
- var updateTierPriceInfo = function(priceEl, tierPriceDiff, tierPriceEl, benefitEl) { | |
- if (typeof(tierPriceEl) === "undefined") { | |
- //tierPrice is not shown, e.g., MAP, no need to update the tier price info | |
- return; | |
- } | |
- var price = parsePrice(priceEl.innerHTML); | |
- var tierPrice = price + tierPriceDiff; | |
- | |
- tierPriceEl.innerHTML = this.formatPrice(tierPrice); | |
- | |
- var $percent = Selector.findChildElements(benefitEl, ['.percent.tier-' + i]); | |
- $percent.each(function(el) { | |
- el.innerHTML = Math.ceil(100 - ((100 / price) * tierPrice)); | |
- }); | |
- }.bind(this); | |
- | |
- var tierPriceElArray = $$('.tier-price.tier-' + i + ' .price'); | |
- if (this.showBothPrices) { | |
- var containerExclTax = $(this.containers[3]); | |
- var tierPriceExclTaxDiff = this.tierPrices[i]; | |
- var tierPriceExclTaxEl = tierPriceElArray[0]; | |
- updateTierPriceInfo(containerExclTax, tierPriceExclTaxDiff, tierPriceExclTaxEl, el); | |
- var containerInclTax = $(this.containers[2]); | |
- var tierPriceInclTaxDiff = this.tierPricesInclTax[i]; | |
- var tierPriceInclTaxEl = tierPriceElArray[1]; | |
- updateTierPriceInfo(containerInclTax, tierPriceInclTaxDiff, tierPriceInclTaxEl, el); | |
- } else if (this.showIncludeTax) { | |
- var container = $(this.containers[0]); | |
- var tierPriceInclTaxDiff = this.tierPricesInclTax[i]; | |
- var tierPriceInclTaxEl = tierPriceElArray[0]; | |
- updateTierPriceInfo(container, tierPriceInclTaxDiff, tierPriceInclTaxEl, el); | |
- } else { | |
- var container = $(this.containers[0]); | |
- var tierPriceExclTaxDiff = this.tierPrices[i]; | |
- var tierPriceExclTaxEl = tierPriceElArray[0]; | |
- updateTierPriceInfo(container, tierPriceExclTaxDiff, tierPriceExclTaxEl, el); | |
- } | |
- }, this); | |
- } | |
- } | |
- | |
- }, | |
- formatPrice: function(price) { | |
- return formatCurrency(price, this.priceFormat); | |
- } | |
-} | |
+}; | |
diff --git a/js/varien/product_options.js b/js/varien/product_options.js | |
new file mode 100644 | |
index 0000000..b3f7fbf | |
--- /dev/null | |
+++ b/js/varien/product_options.js | |
@@ -0,0 +1,287 @@ | |
+/** | |
+ * Magento | |
+ * | |
+ * NOTICE OF LICENSE | |
+ * | |
+ * This source file is subject to the Academic Free License (AFL 3.0) | |
+ * that is bundled with this package in the file LICENSE_AFL.txt. | |
+ * It is also available through the world-wide-web at this URL: | |
+ * http://opensource.org/licenses/afl-3.0.php | |
+ * If you did not receive a copy of the license and are unable to | |
+ * obtain it through the world-wide-web, please send an email | |
+ * to [email protected] so we can send you a copy immediately. | |
+ * | |
+ * DISCLAIMER | |
+ * | |
+ * Do not edit or add to this file if you wish to upgrade Magento to newer | |
+ * versions in the future. If you wish to customize Magento for your | |
+ * needs please refer to http://www.magento.com for more information. | |
+ * | |
+ * @category Varien | |
+ * @package js | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
+ */ | |
+ | |
+var Product = Product || {}; | |
+ | |
+/**************************** PRICE RELOADER ********************************/ | |
+Product.OptionsPrice = Class.create(); | |
+Product.OptionsPrice.prototype = { | |
+ initialize: function(config) { | |
+ this.productId = config.productId; | |
+ this.priceFormat = config.priceFormat; | |
+ this.includeTax = config.includeTax; | |
+ this.defaultTax = config.defaultTax; | |
+ this.currentTax = config.currentTax; | |
+ this.productPrice = config.productPrice; | |
+ this.showIncludeTax = config.showIncludeTax; | |
+ this.showBothPrices = config.showBothPrices; | |
+ this.productOldPrice = config.productOldPrice; | |
+ this.priceInclTax = config.priceInclTax; | |
+ this.priceExclTax = config.priceExclTax; | |
+ this.skipCalculate = config.skipCalculate; /** @deprecated after 1.5.1.0 */ | |
+ this.duplicateIdSuffix = config.idSuffix; | |
+ this.specialTaxPrice = config.specialTaxPrice; | |
+ this.tierPrices = config.tierPrices; | |
+ this.tierPricesInclTax = config.tierPricesInclTax; | |
+ | |
+ this.oldPlusDisposition = config.oldPlusDisposition; | |
+ this.plusDisposition = config.plusDisposition; | |
+ this.plusDispositionTax = config.plusDispositionTax; | |
+ | |
+ this.oldMinusDisposition = config.oldMinusDisposition; | |
+ this.minusDisposition = config.minusDisposition; | |
+ | |
+ this.exclDisposition = config.exclDisposition; | |
+ | |
+ this.optionPrices = {}; | |
+ this.customPrices = {}; | |
+ this.containers = {}; | |
+ | |
+ this.displayZeroPrice = true; | |
+ | |
+ this.initPrices(); | |
+ }, | |
+ | |
+ setDuplicateIdSuffix: function(idSuffix) { | |
+ this.duplicateIdSuffix = idSuffix; | |
+ }, | |
+ | |
+ initPrices: function() { | |
+ this.containers[0] = 'product-price-' + this.productId; | |
+ this.containers[1] = 'bundle-price-' + this.productId; | |
+ this.containers[2] = 'price-including-tax-' + this.productId; | |
+ this.containers[3] = 'price-excluding-tax-' + this.productId; | |
+ this.containers[4] = 'old-price-' + this.productId; | |
+ }, | |
+ | |
+ changePrice: function(key, price) { | |
+ this.optionPrices[key] = price; | |
+ }, | |
+ | |
+ addCustomPrices: function(key, price) { | |
+ this.customPrices[key] = price; | |
+ }, | |
+ getOptionPrices: function() { | |
+ var price = 0; | |
+ var nonTaxable = 0; | |
+ var oldPrice = 0; | |
+ var priceInclTax = 0; | |
+ var currentTax = this.currentTax; | |
+ $H(this.optionPrices).each(function(pair) { | |
+ if ('undefined' != typeof(pair.value.price) && 'undefined' != typeof(pair.value.oldPrice)) { | |
+ price += parseFloat(pair.value.price); | |
+ oldPrice += parseFloat(pair.value.oldPrice); | |
+ } else if (pair.key == 'nontaxable') { | |
+ nonTaxable = pair.value; | |
+ } else if (pair.key == 'priceInclTax') { | |
+ priceInclTax += pair.value; | |
+ } else if (pair.key == 'optionsPriceInclTax') { | |
+ priceInclTax += pair.value * (100 + currentTax) / 100; | |
+ } else { | |
+ price += parseFloat(pair.value); | |
+ oldPrice += parseFloat(pair.value); | |
+ } | |
+ }); | |
+ return [price, nonTaxable, oldPrice, priceInclTax]; | |
+ }, | |
+ | |
+ reload: function() { | |
+ var price; | |
+ var formattedPrice; | |
+ var optionPrices = this.getOptionPrices(); | |
+ var nonTaxable = optionPrices[1]; | |
+ var optionOldPrice = optionPrices[2]; | |
+ var priceInclTax = optionPrices[3]; | |
+ optionPrices = optionPrices[0]; | |
+ | |
+ $H(this.containers).each(function(pair) { | |
+ var _productPrice; | |
+ var _plusDisposition; | |
+ var _minusDisposition; | |
+ var _priceInclTax; | |
+ var excl; | |
+ var incl; | |
+ var tax; | |
+ if ($(pair.value)) { | |
+ if (pair.value == 'old-price-'+this.productId && this.productOldPrice != this.productPrice) { | |
+ _productPrice = this.productOldPrice; | |
+ _plusDisposition = this.oldPlusDisposition; | |
+ _minusDisposition = this.oldMinusDisposition; | |
+ } else { | |
+ _productPrice = this.productPrice; | |
+ _plusDisposition = this.plusDisposition; | |
+ _minusDisposition = this.minusDisposition; | |
+ } | |
+ _priceInclTax = priceInclTax; | |
+ | |
+ if (pair.value == 'old-price-'+this.productId && optionOldPrice !== undefined) { | |
+ price = optionOldPrice+parseFloat(_productPrice); | |
+ } else if (this.specialTaxPrice == 'true' && this.priceInclTax !== undefined && this.priceExclTax !== undefined) { | |
+ price = optionPrices+parseFloat(this.priceExclTax); | |
+ _priceInclTax += this.priceInclTax; | |
+ } else { | |
+ price = optionPrices+parseFloat(_productPrice); | |
+ _priceInclTax += parseFloat(_productPrice) * (100 + this.currentTax) / 100; | |
+ } | |
+ | |
+ if (this.specialTaxPrice == 'true') { | |
+ excl = price; | |
+ incl = _priceInclTax; | |
+ } else if (this.includeTax == 'true') { | |
+ // tax = tax included into product price by admin | |
+ tax = price / (100 + this.defaultTax) * this.defaultTax; | |
+ excl = price - tax; | |
+ incl = excl*(1+(this.currentTax/100)); | |
+ } else { | |
+ tax = price * (this.currentTax / 100); | |
+ excl = price; | |
+ incl = excl + tax; | |
+ } | |
+ | |
+ var subPrice = 0; | |
+ var subPriceincludeTax = 0; | |
+ Object.values(this.customPrices).each(function(el){ | |
+ if (el.excludeTax && el.includeTax) { | |
+ subPrice += parseFloat(el.excludeTax); | |
+ subPriceincludeTax += parseFloat(el.includeTax); | |
+ } else { | |
+ subPrice += parseFloat(el.price); | |
+ subPriceincludeTax += parseFloat(el.price); | |
+ } | |
+ }); | |
+ excl += subPrice; | |
+ incl += subPriceincludeTax; | |
+ | |
+ if (typeof this.exclDisposition == 'undefined') { | |
+ excl += parseFloat(_plusDisposition); | |
+ } | |
+ | |
+ incl += parseFloat(_plusDisposition) + parseFloat(this.plusDispositionTax); | |
+ excl -= parseFloat(_minusDisposition); | |
+ incl -= parseFloat(_minusDisposition); | |
+ | |
+ //adding nontaxlable part of options | |
+ excl += parseFloat(nonTaxable); | |
+ incl += parseFloat(nonTaxable); | |
+ | |
+ if (pair.value == 'price-including-tax-'+this.productId) { | |
+ price = incl; | |
+ } else if (pair.value == 'price-excluding-tax-'+this.productId) { | |
+ price = excl; | |
+ } else if (pair.value == 'old-price-'+this.productId) { | |
+ if (this.showIncludeTax || this.showBothPrices) { | |
+ price = incl; | |
+ } else { | |
+ price = excl; | |
+ } | |
+ } else { | |
+ if (this.showIncludeTax) { | |
+ price = incl; | |
+ } else { | |
+ price = excl; | |
+ } | |
+ } | |
+ | |
+ if (price < 0) price = 0; | |
+ | |
+ if (price > 0 || this.displayZeroPrice) { | |
+ formattedPrice = this.formatPrice(price); | |
+ } else { | |
+ formattedPrice = ''; | |
+ } | |
+ | |
+ if ($(pair.value).select('.price')[0]) { | |
+ $(pair.value).select('.price')[0].innerHTML = formattedPrice; | |
+ if ($(pair.value+this.duplicateIdSuffix) && $(pair.value+this.duplicateIdSuffix).select('.price')[0]) { | |
+ $(pair.value+this.duplicateIdSuffix).select('.price')[0].innerHTML = formattedPrice; | |
+ } | |
+ } else { | |
+ $(pair.value).innerHTML = formattedPrice; | |
+ if ($(pair.value+this.duplicateIdSuffix)) { | |
+ $(pair.value+this.duplicateIdSuffix).innerHTML = formattedPrice; | |
+ } | |
+ } | |
+ }; | |
+ }.bind(this)); | |
+ | |
+ if (typeof(skipTierPricePercentUpdate) === "undefined" && typeof(this.tierPrices) !== "undefined") { | |
+ for (var i = 0; i < this.tierPrices.length; i++) { | |
+ $$('.benefit').each(function(el) { | |
+ var parsePrice = function(html) { | |
+ var format = this.priceFormat; | |
+ var decimalSymbol = format.decimalSymbol === undefined ? "," : format.decimalSymbol; | |
+ var regexStr = '[^0-9-' + decimalSymbol + ']'; | |
+ //remove all characters except number and decimal symbol | |
+ html = html.replace(new RegExp(regexStr, 'g'), ''); | |
+ html = html.replace(decimalSymbol, '.'); | |
+ return parseFloat(html); | |
+ }.bind(this); | |
+ | |
+ var updateTierPriceInfo = function(priceEl, tierPriceDiff, tierPriceEl, benefitEl) { | |
+ if (typeof(tierPriceEl) === "undefined") { | |
+ //tierPrice is not shown, e.g., MAP, no need to update the tier price info | |
+ return; | |
+ } | |
+ var price = parsePrice(priceEl.innerHTML); | |
+ var tierPrice = price + tierPriceDiff; | |
+ | |
+ tierPriceEl.innerHTML = this.formatPrice(tierPrice); | |
+ | |
+ var $percent = Selector.findChildElements(benefitEl, ['.percent.tier-' + i]); | |
+ $percent.each(function(el) { | |
+ el.innerHTML = Math.ceil(100 - ((100 / price) * tierPrice)); | |
+ }); | |
+ }.bind(this); | |
+ | |
+ var tierPriceElArray = $$('.tier-price.tier-' + i + ' .price'); | |
+ if (this.showBothPrices) { | |
+ var containerExclTax = $(this.containers[3]); | |
+ var tierPriceExclTaxDiff = this.tierPrices[i]; | |
+ var tierPriceExclTaxEl = tierPriceElArray[0]; | |
+ updateTierPriceInfo(containerExclTax, tierPriceExclTaxDiff, tierPriceExclTaxEl, el); | |
+ var containerInclTax = $(this.containers[2]); | |
+ var tierPriceInclTaxDiff = this.tierPricesInclTax[i]; | |
+ var tierPriceInclTaxEl = tierPriceElArray[1]; | |
+ updateTierPriceInfo(containerInclTax, tierPriceInclTaxDiff, tierPriceInclTaxEl, el); | |
+ } else if (this.showIncludeTax) { | |
+ var container = $(this.containers[0]); | |
+ var tierPriceInclTaxDiff = this.tierPricesInclTax[i]; | |
+ var tierPriceInclTaxEl = tierPriceElArray[0]; | |
+ updateTierPriceInfo(container, tierPriceInclTaxDiff, tierPriceInclTaxEl, el); | |
+ } else { | |
+ var container = $(this.containers[0]); | |
+ var tierPriceExclTaxDiff = this.tierPrices[i]; | |
+ var tierPriceExclTaxEl = tierPriceElArray[0]; | |
+ updateTierPriceInfo(container, tierPriceExclTaxDiff, tierPriceExclTaxEl, el); | |
+ } | |
+ }, this); | |
+ } | |
+ } | |
+ | |
+ }, | |
+ formatPrice: function(price) { | |
+ return formatCurrency(price, this.priceFormat); | |
+ } | |
+}; | |
diff --git a/js/varien/telephone.js b/js/varien/telephone.js | |
index c09d446..cc670c4 100644 | |
--- a/js/varien/telephone.js | |
+++ b/js/varien/telephone.js | |
@@ -128,4 +128,4 @@ telephoneElem.prototype = { | |
} | |
} | |
} | |
-} | |
+}; | |
diff --git a/lib/Unserialize/Parser.php b/lib/Unserialize/Parser.php | |
index 20a6a3c..88c6555 100644 | |
--- a/lib/Unserialize/Parser.php | |
+++ b/lib/Unserialize/Parser.php | |
@@ -34,6 +34,7 @@ class Unserialize_Parser | |
const TYPE_DOUBLE = 'd'; | |
const TYPE_ARRAY = 'a'; | |
const TYPE_BOOL = 'b'; | |
+ const TYPE_NULL = 'N'; | |
const SYMBOL_QUOTE = '"'; | |
const SYMBOL_SEMICOLON = ';'; | |
diff --git a/lib/Unserialize/Reader/Arr.php b/lib/Unserialize/Reader/Arr.php | |
index cf039f7..9526017 100644 | |
--- a/lib/Unserialize/Reader/Arr.php | |
+++ b/lib/Unserialize/Reader/Arr.php | |
@@ -101,7 +101,10 @@ class Unserialize_Reader_Arr | |
if ($this->_status == self::READING_VALUE) { | |
$value = $this->_reader->read($char, $prevChar); | |
if (!is_null($value)) { | |
- $this->_result[$this->_reader->key] = $value; | |
+ $this->_result[$this->_reader->key] = | |
+ ($value == Unserialize_Reader_Null::NULL_VALUE && $prevChar == Unserialize_Parser::TYPE_NULL) | |
+ ? null | |
+ : $value; | |
if (count($this->_result) < $this->_length) { | |
$this->_reader = new Unserialize_Reader_ArrKey(); | |
$this->_status = self::READING_KEY; | |
diff --git a/lib/Unserialize/Reader/ArrValue.php b/lib/Unserialize/Reader/ArrValue.php | |
index 620e52b..e392d81 100644 | |
--- a/lib/Unserialize/Reader/ArrValue.php | |
+++ b/lib/Unserialize/Reader/ArrValue.php | |
@@ -84,6 +84,10 @@ class Unserialize_Reader_ArrValue | |
$this->_reader = new Unserialize_Reader_Dbl(); | |
$this->_status = self::READING_VALUE; | |
break; | |
+ case Unserialize_Parser::TYPE_NULL: | |
+ $this->_reader = new Unserialize_Reader_Null(); | |
+ $this->_status = self::READING_VALUE; | |
+ break; | |
default: | |
throw new Exception('Unsupported data type ' . $char); | |
} | |
diff --git a/lib/Unserialize/Reader/Null.php b/lib/Unserialize/Reader/Null.php | |
new file mode 100644 | |
index 0000000..ead7f77 | |
--- /dev/null | |
+++ b/lib/Unserialize/Reader/Null.php | |
@@ -0,0 +1,64 @@ | |
+<?php | |
+/** | |
+ * Magento | |
+ * | |
+ * NOTICE OF LICENSE | |
+ * | |
+ * This source file is subject to the Open Software License (OSL 3.0) | |
+ * that is bundled with this package in the file LICENSE.txt. | |
+ * It is also available through the world-wide-web at this URL: | |
+ * http://opensource.org/licenses/osl-3.0.php | |
+ * If you did not receive a copy of the license and are unable to | |
+ * obtain it through the world-wide-web, please send an email | |
+ * to [email protected] so we can send you a copy immediately. | |
+ * | |
+ * DISCLAIMER | |
+ * | |
+ * Do not edit or add to this file if you wish to upgrade Magento to newer | |
+ * versions in the future. If you wish to customize Magento for your | |
+ * needs please refer to http://www.magento.com for more information. | |
+ * | |
+ * @category Unserialize | |
+ * @package Unserialize_Reader | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
+ */ | |
+ | |
+/** | |
+ * Class Unserialize_Reader_Null | |
+ */ | |
+class Unserialize_Reader_Null | |
+{ | |
+ /** | |
+ * @var int | |
+ */ | |
+ protected $_status; | |
+ | |
+ /** | |
+ * @var string | |
+ */ | |
+ protected $_value; | |
+ | |
+ const NULL_VALUE = 'null'; | |
+ | |
+ const READING_VALUE = 1; | |
+ | |
+ /** | |
+ * @param string $char | |
+ * @param string $prevChar | |
+ * @return string|null | |
+ */ | |
+ public function read($char, $prevChar) | |
+ { | |
+ if ($prevChar == Unserialize_Parser::SYMBOL_SEMICOLON) { | |
+ $this->_value = self::NULL_VALUE; | |
+ $this->_status = self::READING_VALUE; | |
+ return null; | |
+ } | |
+ | |
+ if ($this->_status == self::READING_VALUE && $char == Unserialize_Parser::SYMBOL_SEMICOLON) { | |
+ return $this->_value; | |
+ } | |
+ return null; | |
+ } | |
+} | |
diff --git a/lib/Varien/Autoload.php b/lib/Varien/Autoload.php | |
index 2d9cfac..2e7fa65 100644 | |
--- a/lib/Varien/Autoload.php | |
+++ b/lib/Varien/Autoload.php | |
@@ -105,7 +105,7 @@ class Varien_Autoload | |
{ | |
self::$_scope = $code; | |
if (defined('COMPILER_INCLUDE_PATH')) { | |
- @include COMPILER_INCLUDE_PATH . DIRECTORY_SEPARATOR . self::SCOPE_FILE_PREFIX.$code.'.php'; | |
+ @include_once COMPILER_INCLUDE_PATH . DIRECTORY_SEPARATOR . self::SCOPE_FILE_PREFIX.$code.'.php'; | |
} | |
} | |
diff --git a/lib/Varien/Db/Ddl/Table.php b/lib/Varien/Db/Ddl/Table.php | |
index 167425c..924b942 100644 | |
--- a/lib/Varien/Db/Ddl/Table.php | |
+++ b/lib/Varien/Db/Ddl/Table.php | |
@@ -342,8 +342,9 @@ class Varien_Db_Ddl_Table | |
case self::TYPE_DECIMAL: | |
case self::TYPE_NUMERIC: | |
$match = array(); | |
- $scale = 10; | |
- $precision = 0; | |
+ //For decimal(M,D), M must be >= D | |
+ $precision = 10; | |
+ $scale = 0; | |
// parse size value | |
if (is_array($size)) { | |
if (count($size) == 2) { | |
diff --git a/lib/Varien/File/Uploader.php b/lib/Varien/File/Uploader.php | |
index 88d8ae0..8c9e799 100644 | |
--- a/lib/Varien/File/Uploader.php | |
+++ b/lib/Varien/File/Uploader.php | |
@@ -271,7 +271,7 @@ class Varien_File_Uploader | |
//run validate callbacks | |
foreach ($this->_validateCallbacks as $params) { | |
if (is_object($params['object']) && method_exists($params['object'], $params['method'])) { | |
- $params['object']->$params['method']($this->_file['tmp_name']); | |
+ $params['object']->{$params['method']}($this->_file['tmp_name']); | |
} | |
} | |
} | |
diff --git a/lib/Varien/Io/Abstract.php b/lib/Varien/Io/Abstract.php | |
index 0fc6852..fb9d9c2 100644 | |
--- a/lib/Varien/Io/Abstract.php | |
+++ b/lib/Varien/Io/Abstract.php | |
@@ -115,4 +115,20 @@ abstract class Varien_Io_Abstract implements Varien_Io_Interface | |
{ | |
return strpos($this->getCleanPath($haystackPath), $this->getCleanPath($needlePath)) === 0; | |
} | |
+ | |
+ /** | |
+ * Replace full path to relative | |
+ * | |
+ * @param $path | |
+ * @return string | |
+ */ | |
+ public function getFilteredPath($path) | |
+ { | |
+ $dir = pathinfo($_SERVER['SCRIPT_FILENAME'], PATHINFO_DIRNAME); | |
+ $position = strpos($path, $dir); | |
+ if ($position !== false && $position < 1) { | |
+ $path = substr_replace($path, '.', 0, strlen($dir)); | |
+ } | |
+ return $path; | |
+ } | |
} | |
diff --git a/lib/Varien/Io/File.php b/lib/Varien/Io/File.php | |
index bf444e6..2f7904d 100644 | |
--- a/lib/Varien/Io/File.php | |
+++ b/lib/Varien/Io/File.php | |
@@ -127,7 +127,7 @@ class Varien_Io_File extends Varien_Io_Abstract | |
{ | |
$writeableMode = preg_match('#^[wax]#i', $mode); | |
if ($writeableMode && !is_writeable($this->_cwd)) { | |
- throw new Exception('Permission denied for write to ' . $this->_cwd); | |
+ throw new Exception('Permission denied for write to ' . $this->getFilteredPath($this->_cwd)); | |
} | |
if (!ini_get('auto_detect_line_endings')) { | |
@@ -138,7 +138,7 @@ class Varien_Io_File extends Varien_Io_Abstract | |
$this->_streamHandler = @fopen($fileName, $mode); | |
@chdir($this->_iwd); | |
if ($this->_streamHandler === false) { | |
- throw new Exception('Error write to file ' . $fileName); | |
+ throw new Exception('Error write to file ' . $this->getFilteredPath($fileName)); | |
} | |
$this->_streamFileName = $fileName; | |
@@ -507,12 +507,12 @@ class Varien_Io_File extends Varien_Io_Abstract | |
@chdir($this->_cwd); | |
if (file_exists($filename)) { | |
if (!is_writeable($filename)) { | |
- $error = "File '{$filename}' isn't writeable"; | |
+ $error = "File '{$this->getFilteredPath($filename)}' isn't writeable"; | |
} | |
} else { | |
$folder = dirname($filename); | |
if (!is_writable($folder)) { | |
- $error = "Folder '{$folder}' isn't writeable"; | |
+ $error = "Folder '{$this->getFilteredPath($folder)}' isn't writeable"; | |
} | |
} | |
@chdir($this->_iwd); | |
@@ -615,7 +615,7 @@ class Varien_Io_File extends Varien_Io_Abstract | |
$this->checkAndCreateFolder(dirname($folder), $mode); | |
} | |
if (!is_dir($folder) && !$this->mkdir($folder, $mode)) { | |
- throw new Exception("Unable to create directory '{$folder}'. Access forbidden."); | |
+ throw new Exception("Unable to create directory '{$this->getFilteredPath($folder)}'. Access forbidden."); | |
} | |
return true; | |
} | |
diff --git a/lib/flex/uploader/uploader.mxml b/lib/flex/uploader/uploader.mxml | |
index 3a86065..c1ee571 100755 | |
--- a/lib/flex/uploader/uploader.mxml | |
+++ b/lib/flex/uploader/uploader.mxml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category Mage | |
* @package Mage_Uploader | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
*/ | |
--> | |
diff --git a/lib/flex/uploader/uploaderSingle.mxml b/lib/flex/uploader/uploaderSingle.mxml | |
index 42582f3..f711000 100755 | |
--- a/lib/flex/uploader/uploaderSingle.mxml | |
+++ b/lib/flex/uploader/uploaderSingle.mxml | |
@@ -21,7 +21,7 @@ | |
* | |
* @category Mage | |
* @package Mage_Uploader | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
*/ | |
--> | |
diff --git a/lib/flex/varien/varien/upload/Uploader.as b/lib/flex/varien/varien/upload/Uploader.as | |
index e27f6a4..60dfcbc 100755 | |
--- a/lib/flex/varien/varien/upload/Uploader.as | |
+++ b/lib/flex/varien/varien/upload/Uploader.as | |
@@ -19,7 +19,7 @@ | |
* | |
* @category Mage | |
* @package Mage_Uploader | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
*/ | |
package varien.upload | |
diff --git a/lib/flex/varien/varien/upload/UploaderEvent.as b/lib/flex/varien/varien/upload/UploaderEvent.as | |
index 6820dbb..99accef 100755 | |
--- a/lib/flex/varien/varien/upload/UploaderEvent.as | |
+++ b/lib/flex/varien/varien/upload/UploaderEvent.as | |
@@ -19,7 +19,7 @@ | |
* | |
* @category Mage | |
* @package Mage_Uploader | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
*/ | |
package varien.upload | |
diff --git a/lib/flex/varien/varien/upload/UploaderSingle.as b/lib/flex/varien/varien/upload/UploaderSingle.as | |
index 9f586e7..fea2ed4 100755 | |
--- a/lib/flex/varien/varien/upload/UploaderSingle.as | |
+++ b/lib/flex/varien/varien/upload/UploaderSingle.as | |
@@ -19,7 +19,7 @@ | |
* | |
* @category Mage | |
* @package Mage_Uploader | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
*/ | |
package varien.upload | |
diff --git a/mage b/mage | |
index ea0574a..c25799f 100644 | |
--- a/mage | |
+++ b/mage | |
@@ -20,7 +20,7 @@ | |
# | |
# @category Mage | |
# @package Mage | |
-# @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+# @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
# @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
# | |
diff --git a/skin/adminhtml/default/default/media/flex.swf b/skin/adminhtml/default/default/media/flex.swf | |
new file mode 100644 | |
index 0000000..a8ecaa0 | |
Binary files /dev/null and b/skin/adminhtml/default/default/media/flex.swf differ | |
diff --git a/skin/adminhtml/default/default/media/uploader.swf b/skin/adminhtml/default/default/media/uploader.swf | |
new file mode 100644 | |
index 0000000..e38a5a5 | |
Binary files /dev/null and b/skin/adminhtml/default/default/media/uploader.swf differ | |
diff --git a/skin/adminhtml/default/default/media/uploaderSingle.swf b/skin/adminhtml/default/default/media/uploaderSingle.swf | |
new file mode 100644 | |
index 0000000..3dd31ce | |
Binary files /dev/null and b/skin/adminhtml/default/default/media/uploaderSingle.swf differ | |
diff --git a/skin/frontend/base/default/images/window_overlay.png b/skin/frontend/base/default/images/window_overlay.png | |
new file mode 100644 | |
index 0000000..681a61d | |
Binary files /dev/null and b/skin/frontend/base/default/images/window_overlay.png differ | |
diff --git a/skin/frontend/base/default/js/bundle.js b/skin/frontend/base/default/js/bundle.js | |
index 16f0970..2ae8e2a 100644 | |
--- a/skin/frontend/base/default/js/bundle.js | |
+++ b/skin/frontend/base/default/js/bundle.js | |
@@ -140,7 +140,7 @@ Product.Bundle.prototype = { | |
}, | |
selectionPrice: function(optionId, selectionId) { | |
- if (selectionId == '' || selectionId == 'none') { | |
+ if (selectionId == '' || selectionId == 'none' || typeof(this.config.options[optionId].selections[selectionId]) == 'undefined') { | |
return 0; | |
} | |
var qty = null; | |
@@ -271,4 +271,4 @@ Product.Bundle.prototype = { | |
} | |
} | |
} | |
-} | |
+}; | |
diff --git a/skin/frontend/base/default/js/checkout/review.js b/skin/frontend/base/default/js/checkout/review.js | |
index 739e918..7a60fbc 100644 | |
--- a/skin/frontend/base/default/js/checkout/review.js | |
+++ b/skin/frontend/base/default/js/checkout/review.js | |
@@ -355,7 +355,7 @@ OrderReviewController.prototype = { | |
* @param input | |
*/ | |
_bindElementChange : function(input){ | |
- Event.observe(input, 'change', this._onElementChange.bindAsEventListener(this)) | |
+ Event.observe(input, 'change', this._onElementChange.bindAsEventListener(this)); | |
}, | |
/** | |
diff --git a/skin/frontend/base/default/js/giftmessage.js b/skin/frontend/base/default/js/giftmessage.js | |
index c505585..76d8a7b 100644 | |
--- a/skin/frontend/base/default/js/giftmessage.js | |
+++ b/skin/frontend/base/default/js/giftmessage.js | |
@@ -118,7 +118,7 @@ GiftMessageWindow.prototype = { | |
}, | |
updateParent: function (url, buttonUrl) { | |
if(this.parentObject) { | |
- this.parentObject.url = url | |
+ this.parentObject.url = url; | |
this.parentObject.reloadContainer(buttonUrl); | |
} | |
setTimeout(function(){ | |
diff --git a/skin/frontend/base/default/js/ie6.js b/skin/frontend/base/default/js/ie6.js | |
index a5184a4..d18a19f 100644 | |
--- a/skin/frontend/base/default/js/ie6.js | |
+++ b/skin/frontend/base/default/js/ie6.js | |
@@ -28,8 +28,8 @@ ieHover = function() { | |
items = $$('#nav ul', '#nav div', '.truncated_full_value .item-options', '.tool-tip'); | |
$$('#checkout-step-payment', '.tool-tip').each(function(el) { | |
el.show(); | |
- el.setStyle({'visibility':'hidden'}) | |
- }) | |
+ el.setStyle({'visibility':'hidden'}); | |
+ }); | |
for (var j=0; j<items.length; j++) { | |
iframe = document.createElement('IFRAME'); | |
iframe.src = BLANK_URL; | |
@@ -42,7 +42,7 @@ ieHover = function() { | |
} | |
$$('.tool-tip', '#checkout-step-payment').each(function(el) { | |
el.hide(); | |
- el.setStyle({'visibility':'visible'}) | |
- }) | |
-} | |
+ el.setStyle({'visibility':'visible'}); | |
+ }); | |
+}; | |
Event.observe(window, 'load', ieHover); | |
diff --git a/skin/frontend/base/default/js/msrp.js b/skin/frontend/base/default/js/msrp.js | |
index 17fb1aa..4613fa7 100644 | |
--- a/skin/frontend/base/default/js/msrp.js | |
+++ b/skin/frontend/base/default/js/msrp.js | |
@@ -322,7 +322,7 @@ Event.observe(window, 'resize', function(event) { | |
if (Catalog.Map.active) { | |
Catalog.Map.showHelp(event); | |
} | |
-}) | |
+}); | |
$(document).observe('bundle:reload-price', function (event) { //reload price | |
var data = event.memo, bundle = data.bundle; | |
diff --git a/skin/frontend/base/default/js/opcheckout.js b/skin/frontend/base/default/js/opcheckout.js | |
index fbe6655..52108b6 100644 | |
--- a/skin/frontend/base/default/js/opcheckout.js | |
+++ b/skin/frontend/base/default/js/opcheckout.js | |
@@ -31,7 +31,7 @@ Checkout.prototype = { | |
this.saveMethodUrl = urls.saveMethod; | |
this.failureUrl = urls.failure; | |
this.billingForm = false; | |
- this.shippingForm= false; | |
+ this.shippingForm = false; | |
this.syncBillingShipping = false; | |
this.method = ''; | |
this.payment = ''; | |
@@ -53,7 +53,7 @@ Checkout.prototype = { | |
* @param event | |
*/ | |
_onSectionClick: function(event) { | |
- var section = $(Event.element(event).up().up()); | |
+ var section = $(Event.element(event).up('.section')); | |
if (section.hasClassName('allow')) { | |
Event.stop(event); | |
this.gotoSection(section.readAttribute('id').replace('opc-', ''), false); | |
@@ -62,7 +62,7 @@ Checkout.prototype = { | |
}, | |
ajaxFailure: function(){ | |
- location.href = this.failureUrl; | |
+ location.href = encodeURI(this.failureUrl); | |
}, | |
reloadProgressBlock: function(toStep) { | |
@@ -85,7 +85,7 @@ Checkout.prototype = { | |
}, | |
reloadReviewBlock: function(){ | |
- var updater = new Ajax.Updater('checkout-review-load', this.reviewUrl, {method: 'get', onFailure: this.ajaxFailure.bind(this)}); | |
+ new Ajax.Updater('checkout-review-load', this.reviewUrl, {method: 'get', onFailure: this.ajaxFailure.bind(this)}); | |
}, | |
_disableEnableAll: function(element, isDisabled) { | |
@@ -97,18 +97,19 @@ Checkout.prototype = { | |
}, | |
setLoadWaiting: function(step, keepDisabled) { | |
+ var container; | |
if (step) { | |
if (this.loadWaiting) { | |
this.setLoadWaiting(false); | |
} | |
- var container = $(step+'-buttons-container'); | |
+ container = $(step+'-buttons-container'); | |
container.addClassName('disabled'); | |
container.setStyle({opacity:.5}); | |
this._disableEnableAll(container, true); | |
Element.show(step+'-please-wait'); | |
} else { | |
if (this.loadWaiting) { | |
- var container = $(this.loadWaiting+'-buttons-container'); | |
+ container = $(this.loadWaiting+'-buttons-container'); | |
var isDisabled = (keepDisabled ? true : false); | |
if (!isDisabled) { | |
container.removeClassName('disabled'); | |
@@ -144,16 +145,10 @@ Checkout.prototype = { | |
var progressDiv = nextStep + '-progress-opcheckout'; | |
if ($(progressDiv)) { | |
//Remove the link | |
- $(progressDiv).select('.changelink').each(function (item) { | |
- item.remove(); | |
- }); | |
- $(progressDiv).select('dt').each(function (item) { | |
- item.removeClassName('complete'); | |
- }); | |
+ $(progressDiv).select('.changelink').invoke('remove'); | |
+ $(progressDiv).select('dt').invoke('removeClassName','complete'); | |
//Remove the content | |
- $(progressDiv).select('dd.complete').each(function (item) { | |
- item.remove(); | |
- }); | |
+ $(progressDiv).select('dd.complete').invoke('remove'); | |
} | |
} | |
}, | |
@@ -166,7 +161,7 @@ Checkout.prototype = { | |
setMethod: function(){ | |
if ($('login:guest') && $('login:guest').checked) { | |
this.method = 'guest'; | |
- var request = new Ajax.Request( | |
+ new Ajax.Request( | |
this.saveMethodUrl, | |
{method: 'post', onFailure: this.ajaxFailure.bind(this), parameters: {method:'guest'}} | |
); | |
@@ -175,7 +170,7 @@ Checkout.prototype = { | |
} | |
else if($('login:register') && ($('login:register').checked || $('login:register').type == 'hidden')) { | |
this.method = 'register'; | |
- var request = new Ajax.Request( | |
+ new Ajax.Request( | |
this.saveMethodUrl, | |
{method: 'post', onFailure: this.ajaxFailure.bind(this), parameters: {method:'register'}} | |
); | |
@@ -279,12 +274,12 @@ Checkout.prototype = { | |
return true; | |
} | |
if (response.redirect) { | |
- location.href = response.redirect; | |
+ location.href = encodeURI(response.redirect); | |
return true; | |
} | |
return false; | |
} | |
-} | |
+}; | |
// billing | |
var Billing = Class.create(); | |
@@ -303,7 +298,7 @@ Billing.prototype = { | |
setAddress: function(addressId){ | |
if (addressId) { | |
- request = new Ajax.Request( | |
+ new Ajax.Request( | |
this.addressUrl+addressId, | |
{method:'get', onSuccess: this.onAddressLoad, onFailure: checkout.ajaxFailure.bind(checkout)} | |
); | |
@@ -323,32 +318,26 @@ Billing.prototype = { | |
}, | |
resetSelectedAddress: function(){ | |
- var selectElement = $('billing-address-select') | |
+ var selectElement = $('billing-address-select'); | |
if (selectElement) { | |
selectElement.value=''; | |
} | |
}, | |
fillForm: function(transport){ | |
- var elementValues = {}; | |
- if (transport && transport.responseText){ | |
- try{ | |
- elementValues = eval('(' + transport.responseText + ')'); | |
- } | |
- catch (e) { | |
- elementValues = {}; | |
- } | |
- } | |
- else{ | |
+ var elementValues = transport.responseJSON || transport.responseText.evalJSON(true) || {}; | |
+ if (!transport && !Object.keys(elementValues).length){ | |
this.resetSelectedAddress(); | |
} | |
- arrElements = Form.getElements(this.form); | |
+ var arrElements = Form.getElements(this.form); | |
for (var elemIndex in arrElements) { | |
- if (arrElements[elemIndex].id) { | |
- var fieldName = arrElements[elemIndex].id.replace(/^billing:/, ''); | |
- arrElements[elemIndex].value = elementValues[fieldName] ? elementValues[fieldName] : ''; | |
- if (fieldName == 'country_id' && billingForm){ | |
- billingForm.elementChildLoad(arrElements[elemIndex]); | |
+ if(arrElements.hasOwnProperty(elemIndex)) { | |
+ if (arrElements[elemIndex].id) { | |
+ var fieldName = arrElements[elemIndex].id.replace(/^billing:/, ''); | |
+ arrElements[elemIndex].value = elementValues[fieldName] ? elementValues[fieldName] : ''; | |
+ if (fieldName == 'country_id' && billingForm){ | |
+ billingForm.elementChildLoad(arrElements[elemIndex]); | |
+ } | |
} | |
} | |
} | |
@@ -369,7 +358,7 @@ Billing.prototype = { | |
// $('billing:use_for_shipping').value=1; | |
// } | |
- var request = new Ajax.Request( | |
+ new Ajax.Request( | |
this.saveUrl, | |
{ | |
method: 'post', | |
@@ -392,37 +381,36 @@ Billing.prototype = { | |
There are 3 options: error, redirect or html with shipping options. | |
*/ | |
nextStep: function(transport){ | |
- if (transport && transport.responseText){ | |
- try{ | |
- response = eval('(' + transport.responseText + ')'); | |
- } | |
- catch (e) { | |
- response = {}; | |
- } | |
- } | |
+ var response = transport.responseJSON || transport.responseText.evalJSON(true) || {}; | |
if (response.error){ | |
- if ((typeof response.message) == 'string') { | |
- alert(response.message); | |
+ if (Object.isString(response.message)) { | |
+ alert(response.message.stripTags().toString()); | |
} else { | |
if (window.billingRegionUpdater) { | |
billingRegionUpdater.update(); | |
} | |
- alert(response.message.join("\n")); | |
+ var msg = response.message; | |
+ if(Object.isArray(msg)) { | |
+ alert(msg.join("\n")); | |
+ } | |
+ alert(msg.stripTags().toString()); | |
} | |
return false; | |
} | |
checkout.setStepResponse(response); | |
- payment.initWhatIsCvvListeners(); | |
+ if(payment) { | |
+ payment.initWhatIsCvvListeners(); | |
+ } | |
// DELETE | |
//alert('error: ' + response.error + ' / redirect: ' + response.redirect + ' / shipping_methods_html: ' + response.shipping_methods_html); | |
// This moves the accordion panels of one page checkout and updates the checkout progress | |
//checkout.setBilling(); | |
} | |
-} | |
+}; | |
// shipping | |
var Shipping = Class.create(); | |
@@ -442,7 +430,7 @@ Shipping.prototype = { | |
setAddress: function(addressId){ | |
if (addressId) { | |
- request = new Ajax.Request( | |
+ new Ajax.Request( | |
this.addressUrl+addressId, | |
{method:'get', onSuccess: this.onAddressLoad, onFailure: checkout.ajaxFailure.bind(checkout)} | |
); | |
@@ -463,32 +451,26 @@ Shipping.prototype = { | |
}, | |
resetSelectedAddress: function(){ | |
- var selectElement = $('shipping-address-select') | |
+ var selectElement = $('shipping-address-select'); | |
if (selectElement) { | |
selectElement.value=''; | |
} | |
}, | |
fillForm: function(transport){ | |
- var elementValues = {}; | |
- if (transport && transport.responseText){ | |
- try{ | |
- elementValues = eval('(' + transport.responseText + ')'); | |
- } | |
- catch (e) { | |
- elementValues = {}; | |
- } | |
- } | |
- else{ | |
+ var elementValues = transport.responseJSON || transport.responseText.evalJSON(true) || {}; | |
+ if (!transport && !Object.keys(elementValues).length) { | |
this.resetSelectedAddress(); | |
} | |
- arrElements = Form.getElements(this.form); | |
+ var arrElements = Form.getElements(this.form); | |
for (var elemIndex in arrElements) { | |
- if (arrElements[elemIndex].id) { | |
- var fieldName = arrElements[elemIndex].id.replace(/^shipping:/, ''); | |
- arrElements[elemIndex].value = elementValues[fieldName] ? elementValues[fieldName] : ''; | |
- if (fieldName == 'country_id' && shippingForm){ | |
- shippingForm.elementChildLoad(arrElements[elemIndex]); | |
+ if(arrElements.hasOwnProperty(elemIndex)) { | |
+ if (arrElements[elemIndex].id) { | |
+ var fieldName = arrElements[elemIndex].id.replace(/^shipping:/, ''); | |
+ arrElements[elemIndex].value = elementValues[fieldName] ? elementValues[fieldName] : ''; | |
+ if (fieldName == 'country_id' && shippingForm){ | |
+ shippingForm.elementChildLoad(arrElements[elemIndex]); | |
+ } | |
} | |
} | |
} | |
@@ -535,7 +517,7 @@ Shipping.prototype = { | |
var validator = new Validation(this.form); | |
if (validator.validate()) { | |
checkout.setLoadWaiting('shipping'); | |
- var request = new Ajax.Request( | |
+ new Ajax.Request( | |
this.saveUrl, | |
{ | |
method:'post', | |
@@ -548,27 +530,25 @@ Shipping.prototype = { | |
} | |
}, | |
- resetLoadWaiting: function(transport){ | |
+ resetLoadWaiting: function(){ | |
checkout.setLoadWaiting(false); | |
}, | |
nextStep: function(transport){ | |
- if (transport && transport.responseText){ | |
- try{ | |
- response = eval('(' + transport.responseText + ')'); | |
- } | |
- catch (e) { | |
- response = {}; | |
- } | |
- } | |
+ var response = transport.responseJSON || transport.responseText.evalJSON(true) || {}; | |
+ | |
if (response.error){ | |
- if ((typeof response.message) == 'string') { | |
- alert(response.message); | |
+ if (Object.isString(response.message)) { | |
+ alert(response.message.stripTags().toString()); | |
} else { | |
if (window.shippingRegionUpdater) { | |
shippingRegionUpdater.update(); | |
} | |
- alert(response.message.join("\n")); | |
+ var msg = response.message; | |
+ if(Object.isArray(msg)) { | |
+ alert(msg.join("\n")); | |
+ } | |
+ alert(msg.stripTags().toString()); | |
} | |
return false; | |
@@ -585,7 +565,7 @@ Shipping.prototype = { | |
*/ | |
//checkout.setShipping(); | |
} | |
-} | |
+}; | |
// shipping method | |
var ShippingMethod = Class.create(); | |
@@ -626,7 +606,7 @@ ShippingMethod.prototype = { | |
if (checkout.loadWaiting!=false) return; | |
if (this.validate()) { | |
checkout.setLoadWaiting('shipping-method'); | |
- var request = new Ajax.Request( | |
+ new Ajax.Request( | |
this.saveUrl, | |
{ | |
method:'post', | |
@@ -644,17 +624,10 @@ ShippingMethod.prototype = { | |
}, | |
nextStep: function(transport){ | |
- if (transport && transport.responseText){ | |
- try{ | |
- response = eval('(' + transport.responseText + ')'); | |
- } | |
- catch (e) { | |
- response = {}; | |
- } | |
- } | |
+ var response = transport.responseJSON || transport.responseText.evalJSON(true) || {}; | |
if (response.error) { | |
- alert(response.message); | |
+ alert(response.message.stripTags().toString()); | |
return false; | |
} | |
@@ -676,7 +649,7 @@ ShippingMethod.prototype = { | |
checkout.setShippingMethod(); | |
} | |
-} | |
+}; | |
// payment | |
@@ -845,7 +818,7 @@ Payment.prototype = { | |
var validator = new Validation(this.form); | |
if (this.validate() && validator.validate()) { | |
checkout.setLoadWaiting('payment'); | |
- var request = new Ajax.Request( | |
+ new Ajax.Request( | |
this.saveUrl, | |
{ | |
method:'post', | |
@@ -863,14 +836,8 @@ Payment.prototype = { | |
}, | |
nextStep: function(transport){ | |
- if (transport && transport.responseText){ | |
- try{ | |
- response = eval('(' + transport.responseText + ')'); | |
- } | |
- catch (e) { | |
- response = {}; | |
- } | |
- } | |
+ var response = transport.responseJSON || transport.responseText.evalJSON(true) || {}; | |
+ | |
/* | |
* if there is an error in payment, need to show error message | |
*/ | |
@@ -885,10 +852,10 @@ Payment.prototype = { | |
} | |
return; | |
} | |
- if (typeof(response.message) == 'string') { | |
- alert(response.message); | |
+ if (Object.isString(response.message)) { | |
+ alert(response.message.stripTags().toString()); | |
} else { | |
- alert(response.error); | |
+ alert(response.error.stripTags().toString()); | |
} | |
return; | |
} | |
@@ -903,7 +870,7 @@ Payment.prototype = { | |
Event.observe(element, 'click', toggleToolTip); | |
}); | |
} | |
-} | |
+}; | |
var Review = Class.create(); | |
Review.prototype = { | |
@@ -923,7 +890,7 @@ Review.prototype = { | |
params += '&'+Form.serialize(this.agreementsForm); | |
} | |
params.save = true; | |
- var request = new Ajax.Request( | |
+ new Ajax.Request( | |
this.saveUrl, | |
{ | |
method:'post', | |
@@ -940,26 +907,22 @@ Review.prototype = { | |
}, | |
nextStep: function(transport){ | |
- if (transport && transport.responseText) { | |
- try{ | |
- response = eval('(' + transport.responseText + ')'); | |
- } | |
- catch (e) { | |
- response = {}; | |
- } | |
+ if (transport) { | |
+ var response = transport.responseJSON || transport.responseText.evalJSON(true) || {}; | |
+ | |
if (response.redirect) { | |
this.isSuccess = true; | |
- location.href = response.redirect; | |
+ location.href = encodeURI(response.redirect); | |
return; | |
} | |
if (response.success) { | |
this.isSuccess = true; | |
- window.location=this.successUrl; | |
+ location.href = encodeURI(this.successUrl); | |
} | |
else{ | |
var msg = response.error_messages; | |
- if (typeof(msg)=='object') { | |
- msg = msg.join("\n"); | |
+ if (Object.isArray(msg)) { | |
+ msg = msg.join("\n").stripTags().toString(); | |
} | |
if (msg) { | |
alert(msg); | |
@@ -977,4 +940,4 @@ Review.prototype = { | |
}, | |
isSuccess: false | |
-} | |
+}; | |
diff --git a/skin/frontend/default/blank/css/print.css b/skin/frontend/default/blank/css/print.css | |
index 18c75e6..50833cb 100755 | |
--- a/skin/frontend/default/blank/css/print.css | |
+++ b/skin/frontend/default/blank/css/print.css | |
@@ -19,7 +19,7 @@ | |
* | |
* @category design | |
* @package default_blank | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
* { background:none !important; text-align:left !important; } | |
diff --git a/skin/frontend/default/blank/css/styles-ie.css b/skin/frontend/default/blank/css/styles-ie.css | |
index 5aabfc5..e8caebe 100755 | |
--- a/skin/frontend/default/blank/css/styles-ie.css | |
+++ b/skin/frontend/default/blank/css/styles-ie.css | |
@@ -19,7 +19,7 @@ | |
* | |
* @category design | |
* @package default_blank | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/skin/frontend/default/blank/css/styles.css b/skin/frontend/default/blank/css/styles.css | |
index d2c6936..1b53a2c 100755 | |
--- a/skin/frontend/default/blank/css/styles.css | |
+++ b/skin/frontend/default/blank/css/styles.css | |
@@ -19,7 +19,7 @@ | |
* | |
* @category design | |
* @package default_blank | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/skin/frontend/default/blank/images/window_overlay.png b/skin/frontend/default/blank/images/window_overlay.png | |
new file mode 100644 | |
index 0000000..681a61d | |
Binary files /dev/null and b/skin/frontend/default/blank/images/window_overlay.png differ | |
diff --git a/skin/frontend/default/blue/css/styles-ie.css b/skin/frontend/default/blue/css/styles-ie.css | |
index 5de6b46..dfa8824 100755 | |
--- a/skin/frontend/default/blue/css/styles-ie.css | |
+++ b/skin/frontend/default/blue/css/styles-ie.css | |
@@ -19,7 +19,7 @@ | |
* | |
* @category design | |
* @package default_blue | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/skin/frontend/default/blue/css/styles.css b/skin/frontend/default/blue/css/styles.css | |
index d5c0dd6..add502b 100755 | |
--- a/skin/frontend/default/blue/css/styles.css | |
+++ b/skin/frontend/default/blue/css/styles.css | |
@@ -19,7 +19,7 @@ | |
* | |
* @category design | |
* @package default_blue | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/skin/frontend/default/blue/images/window_overlay.png b/skin/frontend/default/blue/images/window_overlay.png | |
new file mode 100644 | |
index 0000000..681a61d | |
Binary files /dev/null and b/skin/frontend/default/blue/images/window_overlay.png differ | |
diff --git a/skin/frontend/default/default/images/window_overlay.png b/skin/frontend/default/default/images/window_overlay.png | |
new file mode 100644 | |
index 0000000..681a61d | |
Binary files /dev/null and b/skin/frontend/default/default/images/window_overlay.png differ | |
diff --git a/skin/frontend/default/iphone/css/custom.css b/skin/frontend/default/iphone/css/custom.css | |
index 0e7efd4..dcb789c 100644 | |
--- a/skin/frontend/default/iphone/css/custom.css | |
+++ b/skin/frontend/default/iphone/css/custom.css | |
@@ -19,7 +19,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
/* Theme options */ | |
diff --git a/skin/frontend/default/iphone/css/iphone.css b/skin/frontend/default/iphone/css/iphone.css | |
index feca5ca..cbc1742 100755 | |
--- a/skin/frontend/default/iphone/css/iphone.css | |
+++ b/skin/frontend/default/iphone/css/iphone.css | |
@@ -19,7 +19,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/skin/frontend/default/iphone/js/dnd.js b/skin/frontend/default/iphone/js/dnd.js | |
index b71a21d..6282bd8 100644 | |
--- a/skin/frontend/default/iphone/js/dnd.js | |
+++ b/skin/frontend/default/iphone/js/dnd.js | |
@@ -1,27 +1,3 @@ | |
-/** | |
- * Magento | |
- * | |
- * NOTICE OF LICENSE | |
- * | |
- * This source file is subject to the Academic Free License (AFL 3.0) | |
- * that is bundled with this package in the file LICENSE_AFL.txt. | |
- * It is also available through the world-wide-web at this URL: | |
- * http://opensource.org/licenses/afl-3.0.php | |
- * If you did not receive a copy of the license and are unable to | |
- * obtain it through the world-wide-web, please send an email | |
- * to [email protected] so we can send you a copy immediately. | |
- * | |
- * DISCLAIMER | |
- * | |
- * Do not edit or add to this file if you wish to upgrade Magento to newer | |
- * versions in the future. If you wish to customize Magento for your | |
- * needs please refer to http://www.magento.com for more information. | |
- * | |
- * @category design | |
- * @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
- */ | |
// webkitdragdrop.js v1.0, Mon May 15 2010 | |
// | |
// Copyright (c) 2010 Tommaso Buvoli (http://www.tommasobuvoli.com) | |
diff --git a/skin/frontend/default/iphone/js/iphone.js b/skin/frontend/default/iphone/js/iphone.js | |
index f13854f..987c056 100644 | |
--- a/skin/frontend/default/iphone/js/iphone.js | |
+++ b/skin/frontend/default/iphone/js/iphone.js | |
@@ -19,7 +19,7 @@ | |
* | |
* @category design | |
* @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
@@ -101,7 +101,7 @@ document.observe("dom:loaded", function() { | |
$$('.c-list')[0], | |
$$('.next-page')[0], | |
'.c-list > li' | |
- ) | |
+ ); | |
} | |
if ( $$('.downloadable-products-history .list')[0] && $$('.next-page')[0] ) { | |
@@ -109,7 +109,7 @@ document.observe("dom:loaded", function() { | |
$$('.downloadable-products-history .list')[0], | |
$$('.next-page')[0], | |
'.downloadable-products-history .list > li' | |
- ) | |
+ ); | |
} | |
if ( $$('.review-history .list')[0] && $$('.next-page')[0] ) { | |
@@ -117,7 +117,7 @@ document.observe("dom:loaded", function() { | |
$$('.review-history .list')[0], | |
$$('.next-page')[0], | |
'.review-history .list > li' | |
- ) | |
+ ); | |
} | |
if ( $$('.recent-orders .data-table')[0] && $$('.next-page')[0] ) { | |
@@ -125,7 +125,7 @@ document.observe("dom:loaded", function() { | |
$$('.recent-orders .data-table')[0], | |
$$('.next-page')[0], | |
'.recent-orders .data-table tbody > tr' | |
- ) | |
+ ); | |
} | |
//-----------------------------// | |
@@ -164,7 +164,7 @@ document.observe("dom:loaded", function() { | |
var div = document.createElement('div'), | |
supports = div.style['webkitTouchCallout'] !== undefined || div.style['touchCallout'] !== undefined; | |
- return supports | |
+ return supports; | |
} | |
$$('input[name=qty], input[name*=super_group], input[name*=qty]').each(function (el) { | |
@@ -219,7 +219,7 @@ document.observe("dom:loaded", function() { | |
selected = []; | |
select.select('option').each(function (option) { | |
if (option.selected) { | |
- selected.push(option.text) | |
+ selected.push(option.text); | |
} | |
}); | |
@@ -230,7 +230,7 @@ document.observe("dom:loaded", function() { | |
select.previous().update('Choose options...').removeClassName('filled'); | |
} | |
document.stopObserving('click', closeSelect); | |
- } | |
+ }; | |
select_options.select('.select-close')[0].observe('click', closeSelect ); | |
@@ -238,7 +238,7 @@ document.observe("dom:loaded", function() { | |
var option = select.select('option[value=' + elem.readAttribute('data-option-value') + ']')[0]; | |
elem.toggleClassName('active'); | |
if (option.selected) { | |
- option.selected = false | |
+ option.selected = false; | |
} else { | |
option.selected = true; | |
} | |
@@ -252,7 +252,7 @@ document.observe("dom:loaded", function() { | |
e.stopPropagation(); | |
}); | |
setTimeout(function() { | |
- document.observe('click', closeSelect) | |
+ document.observe('click', closeSelect); | |
}, 1); | |
}) | |
}); | |
@@ -329,16 +329,16 @@ document.observe("dom:loaded", function() { | |
sliderLink.observe('click', function(e) { | |
e.preventDefault(); | |
- var transformValue = {} | |
+ var transformValue = {}; | |
//homeLink.hasClassName('disabled') ? homeLink.removeClassName('disabled') : ''; | |
if (last) { | |
- diff = e.timeStamp - last | |
+ diff = e.timeStamp - last; | |
} | |
last = e.timeStamp; | |
if (diff && diff < 200) { | |
- return | |
+ return; | |
} | |
if (!this.clonedSubmenuList.firstDescendant().hasClassName('subcategory-header')) { | |
var subcategoryHeader = new Element('li', {'class': 'subcategory-header'}); | |
@@ -353,11 +353,11 @@ document.observe("dom:loaded", function() { | |
this.clonedSubmenuList.firstDescendant().firstDescendant().observe('click', function(e) { | |
if (last) { | |
- diff = e.timeStamp - last | |
+ diff = e.timeStamp - last; | |
} | |
last = e.timeStamp; | |
if (diff && diff < 200) { | |
- return | |
+ return; | |
} | |
if ( Modernizr.csstransforms3d ) { | |
transformValue[transformPref] = "translate3d(" + (document.body.offsetWidth + sliderPosition) + "px, 0, 0)"; | |
@@ -366,7 +366,10 @@ document.observe("dom:loaded", function() { | |
} | |
$("nav-container").setStyle(transformValue); | |
sliderPosition = sliderPosition + document.body.offsetWidth; | |
- setTimeout(function() { $$("#nav-container > ul:last-child")[0].remove(); $("nav-container").setStyle({'height' : 'auto'}) }, 250) | |
+ setTimeout(function() { | |
+ $$("#nav-container > ul:last-child")[0].remove(); | |
+ $("nav-container").setStyle({'height' : 'auto'}); | |
+ }, 250); | |
}); | |
new NoClickDelay(this.clonedSubmenuList); | |
}; | |
@@ -402,7 +405,7 @@ document.observe("dom:loaded", function() { | |
function NoClickDelay(el) { | |
if ( getSupportedProp(['OTransform']) ) { | |
- return | |
+ return; | |
} | |
this.element = typeof el == 'object' ? el : document.getElementById(el); | |
if( window.Touch ) this.element.addEventListener('touchstart', this, false); | |
@@ -722,7 +725,7 @@ document.observe("dom:loaded", function() { | |
}, | |
touchEnd: function (e) { | |
if ( e.preventSwipe ) { | |
- return | |
+ return; | |
} | |
if (!this.isScrolling) { | |
@@ -1031,10 +1034,10 @@ document.observe("dom:loaded", function() { | |
}, | |
gestureChange : function (e) { | |
e.preventDefault(); | |
- var $this = e.target | |
+ var $this = e.target; | |
if ( (e.scale * this.scale) > 2 ) | |
- return | |
+ return; | |
$this.setStyle({ | |
'webkitTransition' : '', | |
@@ -1068,7 +1071,7 @@ document.observe("dom:loaded", function() { | |
this.isScrolling = undefined; | |
if (e.targetTouches.length != 1) { | |
- return false | |
+ return false; | |
} | |
this.t1 = Date.now(); | |
@@ -1094,7 +1097,7 @@ document.observe("dom:loaded", function() { | |
} | |
if (e.targetTouches.length != 1 || this.scale === 1.0 || this.gestureStart) { | |
- return false | |
+ return false; | |
} | |
e.preventDefault(); | |
diff --git a/skin/frontend/default/iphone/js/modernizr.js b/skin/frontend/default/iphone/js/modernizr.js | |
index cb1843d..2dbe336 100644 | |
--- a/skin/frontend/default/iphone/js/modernizr.js | |
+++ b/skin/frontend/default/iphone/js/modernizr.js | |
@@ -1,27 +1,3 @@ | |
-/** | |
- * Magento | |
- * | |
- * NOTICE OF LICENSE | |
- * | |
- * This source file is subject to the Academic Free License (AFL 3.0) | |
- * that is bundled with this package in the file LICENSE_AFL.txt. | |
- * It is also available through the world-wide-web at this URL: | |
- * http://opensource.org/licenses/afl-3.0.php | |
- * If you did not receive a copy of the license and are unable to | |
- * obtain it through the world-wide-web, please send an email | |
- * to [email protected] so we can send you a copy immediately. | |
- * | |
- * DISCLAIMER | |
- * | |
- * Do not edit or add to this file if you wish to upgrade Magento to newer | |
- * versions in the future. If you wish to customize Magento for your | |
- * needs please refer to http://www.magento.com for more information. | |
- * | |
- * @category design | |
- * @package default_iphone | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
- */ | |
/* Modernizr 2.0.6 (Custom Build) | MIT & BSD | |
* Build: http://www.modernizr.com/download/#-csstransforms-csstransforms3d-cssclasses-prefixed-teststyles-testprop-testallprops-prefixes-domprefixes | |
*/ | |
diff --git a/skin/frontend/default/modern/css/print.css b/skin/frontend/default/modern/css/print.css | |
index 7b4e2c7..18c757c 100755 | |
--- a/skin/frontend/default/modern/css/print.css | |
+++ b/skin/frontend/default/modern/css/print.css | |
@@ -19,7 +19,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
* { background:none !important; text-align:left !important; } | |
diff --git a/skin/frontend/default/modern/css/styles-ie.css b/skin/frontend/default/modern/css/styles-ie.css | |
index 4b1cfbd..d3e8c0c 100755 | |
--- a/skin/frontend/default/modern/css/styles-ie.css | |
+++ b/skin/frontend/default/modern/css/styles-ie.css | |
@@ -19,7 +19,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/skin/frontend/default/modern/css/styles.css b/skin/frontend/default/modern/css/styles.css | |
index 6a2c20f..39a80ae 100755 | |
--- a/skin/frontend/default/modern/css/styles.css | |
+++ b/skin/frontend/default/modern/css/styles.css | |
@@ -19,7 +19,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/skin/frontend/default/modern/css/widgets.css b/skin/frontend/default/modern/css/widgets.css | |
index 25e1da7..9f1eca3 100755 | |
--- a/skin/frontend/default/modern/css/widgets.css | |
+++ b/skin/frontend/default/modern/css/widgets.css | |
@@ -19,7 +19,7 @@ | |
* | |
* @category design | |
* @package default_modern | |
- * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com) | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
*/ | |
diff --git a/skin/frontend/default/modern/images/window_overlay.png b/skin/frontend/default/modern/images/window_overlay.png | |
new file mode 100644 | |
index 0000000..681a61d | |
Binary files /dev/null and b/skin/frontend/default/modern/images/window_overlay.png differ | |
diff --git a/skin/frontend/rwd/default/js/app.js b/skin/frontend/rwd/default/js/app.js | |
index 6986c6c..c1bb710 100644 | |
--- a/skin/frontend/rwd/default/js/app.js | |
+++ b/skin/frontend/rwd/default/js/app.js | |
@@ -37,7 +37,7 @@ var bp = { | |
medium: 770, | |
large: 979, | |
xlarge: 1199 | |
-} | |
+}; | |
// ============================================== | |
// Search | |
@@ -57,7 +57,7 @@ Varien.searchForm.prototype.initialize = function (form, field, emptyText) { | |
Event.observe(this.field, 'focus', this.focus.bind(this)); | |
Event.observe(this.field, 'blur', this.blur.bind(this)); | |
this.blur(); | |
-} | |
+}; | |
Varien.searchForm.prototype.submit = function (event) { | |
if (this.field.value == this.emptyText || this.field.value == ''){ | |
@@ -67,7 +67,7 @@ Varien.searchForm.prototype.submit = function (event) { | |
return false; | |
} | |
return true; | |
-} | |
+}; | |
Varien.searchForm.prototype.change = function (event) { | |
if ( | |
@@ -77,13 +77,13 @@ Varien.searchForm.prototype.change = function (event) { | |
) { | |
this.field.removeClassName('validation-failed'); | |
} | |
-} | |
+}; | |
Varien.searchForm.prototype.blur = function (event) { | |
if (this.field.hasClassName('validation-failed')) { | |
this.field.removeClassName('validation-failed'); | |
} | |
-} | |
+}; | |
// ============================================== | |
// Pointer abstraction | |
@@ -684,7 +684,7 @@ $j(document).ready(function () { | |
$j(".change").click(function (e) { | |
$j( this ).toggleClass('active'); | |
- e.stopPropagation() | |
+ e.stopPropagation(); | |
}); | |
$j(document).click(function (e) { | |
@@ -867,7 +867,7 @@ $j(document).ready(function () { | |
} | |
}); | |
- } | |
+ }; | |
// ============================================== | |
// UI Pattern - Toggle Content (tabs and accordions in one setup) | |
@@ -951,14 +951,14 @@ $j(document).ready(function () { | |
// While it would make more sense to just move the .block-layered-nav block rather than .col-left-first | |
// (since other blocks can be inserted into left_first), it creates simpler code to move the entire | |
// .col-left-first block, so that is the approach we're taking | |
- if ($j('.col-left-first > .block').length && $j('.category-products').length) { | |
+ if ($j('.col-left-first > .block').length && $j('div.category-products').length) { | |
enquire.register('screen and (max-width: ' + bp.medium + 'px)', { | |
match: function () { | |
- $j('.col-left-first').insertBefore($j('.category-products')) | |
+ $j('.col-left-first').insertBefore($j('div.category-products')); | |
}, | |
unmatch: function () { | |
// Move layered nav back to left column | |
- $j('.col-left-first').insertBefore($j('.col-main')) | |
+ $j('.col-left-first').insertBefore($j('.col-main')); | |
} | |
}); | |
} | |
@@ -1044,12 +1044,12 @@ $j(document).ready(function () { | |
match: function () { | |
$j('.gift-info').each(function() { | |
$j(this).next('td').children('textarea').appendTo(this).children(); | |
- }) | |
+ }); | |
}, | |
unmatch: function () { | |
$j('.left-note').each(function() { | |
$j(this).prev('td').children('textarea').appendTo(this).children(); | |
- }) | |
+ }); | |
} | |
}); | |
} | |
@@ -1122,7 +1122,7 @@ $j(document).ready(function () { | |
}); | |
}); | |
}); | |
- } | |
+ }; | |
alignProductGridActions(); | |
// Since the height of each cell and the number of columns per page may change when the page is resized, we are | |
diff --git a/skin/frontend/rwd/default/js/configurableswatches/configurable-swatch-prices.js b/skin/frontend/rwd/default/js/configurableswatches/configurable-swatch-prices.js | |
new file mode 100644 | |
index 0000000..d620966 | |
--- /dev/null | |
+++ b/skin/frontend/rwd/default/js/configurableswatches/configurable-swatch-prices.js | |
@@ -0,0 +1,75 @@ | |
+/** | |
+ * Magento | |
+ * | |
+ * NOTICE OF LICENSE | |
+ * | |
+ * This source file is subject to the Academic Free License (AFL 3.0) | |
+ * that is bundled with this package in the file LICENSE_AFL.txt. | |
+ * It is also available through the world-wide-web at this URL: | |
+ * http://opensource.org/licenses/afl-3.0.php | |
+ * If you did not receive a copy of the license and are unable to | |
+ * obtain it through the world-wide-web, please send an email | |
+ * to [email protected] so we can send you a copy immediately. | |
+ * | |
+ * DISCLAIMER | |
+ * | |
+ * Do not edit or add to this file if you wish to upgrade Magento to newer | |
+ * versions in the future. If you wish to customize Magento for your | |
+ * needs please refer to http://www.magento.com for more information. | |
+ * | |
+ * @category design | |
+ * @package rwd_default | |
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com) | |
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | |
+ */ | |
+ | |
+var ConfigurableSwatchPrices = Class.create({ | |
+ initialize: function(config) { | |
+ this.swatchesPrices = []; | |
+ this.generalConfig = config.generalConfig; | |
+ this.products = config.products; | |
+ | |
+ this.addObservers(); | |
+ }, | |
+ | |
+ addObservers: function() { | |
+ $(document).on('click', '.swatch-link', this.onSwatchClick.bind(this)); | |
+ }, | |
+ | |
+ onSwatchClick: function(e) { | |
+ var element = Event.findElement(e); | |
+ var swatchElement = element.up('[data-product-id]'); | |
+ var productId = parseInt(swatchElement.getAttribute('data-product-id'), 10); | |
+ var swatchLabel = swatchElement.getAttribute('data-option-label'); | |
+ var optionsPrice = this.optionsPrice(productId); | |
+ var swatchTarget = this.getSwatchPriceInfo(productId, swatchLabel); | |
+ | |
+ if(swatchTarget) { | |
+ optionsPrice.changePrice('config', {price: swatchTarget.price, oldPrice: swatchTarget.oldPrice}); | |
+ optionsPrice.reload(); | |
+ } | |
+ }, | |
+ | |
+ getSwatchPriceInfo: function(productId, swatchLabel) { | |
+ var productInfo = this.products[productId]; | |
+ if(productInfo && productInfo.swatchPrices[swatchLabel]) { | |
+ return productInfo.swatchPrices[swatchLabel]; | |
+ } | |
+ return 0; | |
+ }, | |
+ | |
+ optionsPrice: function(productId) { | |
+ if(this.swatchesPrices[productId]) { | |
+ return this.swatchesPrices[productId]; | |
+ } | |
+ this.swatchesPrices[productId] = new Product.OptionsPrice(this.getProductConfig(productId)); | |
+ | |
+ return this.swatchesPrices[productId]; | |
+ }, | |
+ | |
+ getProductConfig: function(productId) { | |
+ var generalConfigClone = Object.extend({}, this.generalConfig); | |
+ | |
+ return Object.extend(generalConfigClone, this.products[productId]); | |
+ } | |
+}); | |
diff --git a/skin/frontend/rwd/default/js/configurableswatches/product-media.js b/skin/frontend/rwd/default/js/configurableswatches/product-media.js | |
index 859707e..a17796e 100644 | |
--- a/skin/frontend/rwd/default/js/configurableswatches/product-media.js | |
+++ b/skin/frontend/rwd/default/js/configurableswatches/product-media.js | |
@@ -52,17 +52,19 @@ var ConfigurableMediaImages = { | |
var compatibleProducts = []; | |
var compatibleProductSets = []; | |
selectedLabels.each(function(selectedLabel) { | |
- if(!productFallback['option_labels'][selectedLabel]) { | |
- return; | |
- } | |
+ if(typeof(productFallback['option_labels']) != 'undefined') { | |
+ if (!productFallback['option_labels'][selectedLabel]) { | |
+ return; | |
+ } | |
- var optionProducts = productFallback['option_labels'][selectedLabel]['products']; | |
- compatibleProductSets.push(optionProducts); | |
+ var optionProducts = productFallback['option_labels'][selectedLabel]['products']; | |
+ compatibleProductSets.push(optionProducts); | |
- //optimistically push all products | |
- optionProducts.each(function(productId) { | |
- compatibleProducts.push(productId); | |
- }); | |
+ //optimistically push all products | |
+ optionProducts.each(function (productId) { | |
+ compatibleProducts.push(productId); | |
+ }); | |
+ } | |
}); | |
//intersect compatible products | |
@@ -88,10 +90,12 @@ var ConfigurableMediaImages = { | |
} | |
//first, try to get label-matching image on config product for this option's label | |
- var currentLabelImage = fallback['option_labels'][optionLabel]; | |
- if(currentLabelImage && fallback['option_labels'][optionLabel]['configurable_product'][ConfigurableMediaImages.imageType]) { | |
- //found label image on configurable product | |
- return fallback['option_labels'][optionLabel]['configurable_product'][ConfigurableMediaImages.imageType]; | |
+ if(typeof(fallback['option_labels']) != 'undefined') { | |
+ var currentLabelImage = fallback['option_labels'][optionLabel]; | |
+ if (currentLabelImage && fallback['option_labels'][optionLabel]['configurable_product'][ConfigurableMediaImages.imageType]) { | |
+ //found label image on configurable product | |
+ return fallback['option_labels'][optionLabel]['configurable_product'][ConfigurableMediaImages.imageType]; | |
+ } | |
} | |
var compatibleProducts = ConfigurableMediaImages.getCompatibleProductImages(fallback, selectedLabels); | |
diff --git a/skin/frontend/rwd/default/js/configurableswatches/swatches-list.js b/skin/frontend/rwd/default/js/configurableswatches/swatches-list.js | |
index bd48586..f71d3d1 100644 | |
--- a/skin/frontend/rwd/default/js/configurableswatches/swatches-list.js | |
+++ b/skin/frontend/rwd/default/js/configurableswatches/swatches-list.js | |
@@ -43,15 +43,26 @@ var ConfigurableSwatchesList = { | |
var that = this; | |
var $swatch = $j(swatch); | |
var productId; | |
+ $j($swatch).hover(function() { | |
+ /** | |
+ * | |
+ * - Preview the stock status | |
+ **/ | |
+ var swatchUl = $swatch.parent(); | |
+ swatchUl.find('.x').each(function(){ | |
+ $j(this).show(); | |
+ $j(this).closest('li').addClass('not-available'); | |
+ }); | |
+ }); | |
if (productId = $swatch.data('product-id')) { | |
if (typeof(this.swatchesByProduct[productId]) == 'undefined') { | |
this.swatchesByProduct[productId] = []; | |
} | |
this.swatchesByProduct[productId].push($swatch); | |
- $swatch.find('a').on('click', function() { | |
+ $swatch.find('a').on('click', function(e) { | |
+ e.preventDefault(); | |
that.handleSwatchSelect($swatch); | |
- return false; | |
}); | |
} | |
}, | |
@@ -70,7 +81,7 @@ var ConfigurableSwatchesList = { | |
$swatch.addClass('selected'); | |
} | |
-} | |
+}; | |
$j(document).on('configurable-media-images-init', function(){ | |
ConfigurableSwatchesList.init(); | |
diff --git a/skin/frontend/rwd/default/js/configurableswatches/swatches-product.js b/skin/frontend/rwd/default/js/configurableswatches/swatches-product.js | |
index 7d7db0e..15d7e3a 100644 | |
--- a/skin/frontend/rwd/default/js/configurableswatches/swatches-product.js | |
+++ b/skin/frontend/rwd/default/js/configurableswatches/swatches-product.js | |
@@ -46,7 +46,7 @@ Product.Config.prototype.initialize = function(config) | |
this.origInitialize(config); | |
this.configureObservers = []; | |
this.loadOptions(); | |
-} | |
+}; | |
Product.Config.prototype.handleSelectChange = function(element) { | |
this.configureElement(element); | |
@@ -207,7 +207,7 @@ Product.ConfigurableSwatches.prototype = { | |
this.selectOption(opt); | |
throw $break2; | |
}; | |
- }.bind(this)) | |
+ }.bind(this)); | |
} catch(e) {}; | |
}.bind(this)); | |
this._F.presetValuesSelected = true; | |
@@ -506,9 +506,8 @@ Product.ConfigurableSwatches.prototype = { | |
// run setAvailable before previewAvailable and reset last label if | |
// 1) the timeout has not been run (which means lastOpt != false) and | |
// 2) the last hover swatch's attribute is different than this hover swatch's | |
+ this.setAvailableOptions(); | |
if(lastOpt && lastOpt.attr.id != opt.attr.id) { | |
- this.setAvailableOptions(); | |
- | |
// reset last hover swatch's attribute | |
lastOpt.attr._e.attrLabel.innerHTML = lastOpt.attr._e.selectedOption ? this.getOptionLabel(lastOpt.attr._e.selectedOption) : ''; | |
} | |
@@ -800,4 +799,4 @@ Product.ConfigurableSwatches.prototype = { | |
return result; | |
} | |
} | |
-} | |
+}; | |
diff --git a/skin/frontend/rwd/default/js/minicart.js b/skin/frontend/rwd/default/js/minicart.js | |
index c2d6771..1580f97 100644 | |
--- a/skin/frontend/rwd/default/js/minicart.js | |
+++ b/skin/frontend/rwd/default/js/minicart.js | |
@@ -64,7 +64,7 @@ Minicart.prototype = { | |
.unbind('focus.minicart') | |
.bind('focus.minicart', function() { | |
cart.previousVal = $j(this).val(); | |
- cart.displayQuantityButton($j(this)) | |
+ cart.displayQuantityButton($j(this)); | |
}) | |
.bind('blur.minicart', function() { | |
cart.revertInvalidValue(this); | |
@@ -143,7 +143,14 @@ Minicart.prototype = { | |
updateItem: function(el) { | |
var cart = this; | |
var input = $j(this.selectors.quantityInputPrefix + $j(el).data('item-id')); | |
- var quantity = parseInt(input.val(), 10); | |
+ | |
+ if (!$j.isNumeric(input.val())) { | |
+ cart.hideOverlay(); | |
+ cart.showError(cart.defaultErrorMessage); | |
+ return false; | |
+ } | |
+ | |
+ var quantity = input.val(); | |
cart.hideMessage(); | |
cart.showOverlay(); | |
$j.ajax({ | |
diff --git a/skin/frontend/rwd/default/js/opcheckout_rwd.js b/skin/frontend/rwd/default/js/opcheckout_rwd.js | |
index bc25d93..17cdca4 100644 | |
--- a/skin/frontend/rwd/default/js/opcheckout_rwd.js | |
+++ b/skin/frontend/rwd/default/js/opcheckout_rwd.js | |
@@ -45,4 +45,4 @@ Checkout.prototype.gotoSection = function (section, reloadProgressBlock) { | |
if (!reloadProgressBlock) { | |
this.resetPreviousSteps(); | |
} | |
-} | |
+}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment