diff --git a/app/Mage.php b/app/Mage.php index 2ad4636712..9753d8b692 100644 --- a/app/Mage.php +++ b/app/Mage.php @@ -82,7 +82,7 @@ final class Mage { public static function getVersion() { - return '1.1.7'; + return '1.1.8'; } /** diff --git a/app/code/core/Mage/AdminNotification/etc/config.xml b/app/code/core/Mage/AdminNotification/etc/config.xml index f23727661f..ee678e73d0 100644 --- a/app/code/core/Mage/AdminNotification/etc/config.xml +++ b/app/code/core/Mage/AdminNotification/etc/config.xml @@ -87,7 +87,7 @@ - Notification + Notifications 10 diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Edit.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Edit.php index f0d4990698..341620b00f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Edit.php @@ -45,7 +45,8 @@ public function __construct() protected function _prepareLayout() { - if (Mage::app()->getConfig()->getModuleConfig('Mage_GoogleOptimizer')->is('active', true)) { + if (Mage::app()->getConfig()->getModuleConfig('Mage_GoogleOptimizer')->is('active', true) + && Mage::helper('googleoptimizer')->isOptimizerActive()) { $this->setChild('googleoptimizer_js', $this->getLayout()->createBlock('googleoptimizer/js')->setTemplate('googleoptimizer/js.phtml') ); diff --git a/app/code/core/Mage/Adminhtml/controllers/Cms/PageController.php b/app/code/core/Mage/Adminhtml/controllers/Cms/PageController.php index 890aabe73a..7ada91ae66 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Cms/PageController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Cms/PageController.php @@ -104,7 +104,8 @@ public function editAction() ->_addContent($this->getLayout()->createBlock('adminhtml/cms_page_edit')->setData('action', $this->getUrl('*/cms_page/save'))) ->_addLeft($this->getLayout()->createBlock('adminhtml/cms_page_edit_tabs')); - if (Mage::app()->getConfig()->getModuleConfig('Mage_GoogleOptimizer')->is('active', true)) { + if (Mage::app()->getConfig()->getModuleConfig('Mage_GoogleOptimizer')->is('active', true) + && Mage::helper('googleoptimizer')->isOptimizerActive()) { $this->_addJs($this->getLayout()->createBlock('googleoptimizer/js')->setTemplate('googleoptimizer/js.phtml')); } diff --git a/app/code/core/Mage/Adminhtml/etc/config.xml b/app/code/core/Mage/Adminhtml/etc/config.xml index eb5a7a8747..b129dd0c01 100644 --- a/app/code/core/Mage/Adminhtml/etc/config.xml +++ b/app/code/core/Mage/Adminhtml/etc/config.xml @@ -269,7 +269,7 @@ - Stores + Manage Stores Design @@ -339,10 +339,6 @@ Currency Setup Section 120 - - Allowed Settings - 130 - Rss Feeds Section 135 @@ -358,7 +354,7 @@ - Manage Currency + Manage Currency Rates 30 @@ -382,26 +378,10 @@ Import/Export - GUI Profiles - - - Create/Edit/Delete profiles - - - Run profiles - - + Profiles Advanced Profiles - - - Create/Edit/Delete profiles - - - Run profiles - - @@ -413,16 +393,12 @@ Magento Connect Manager + 0 - - Available Remote - Package Extensions + 5 - - PEAR Configuration - diff --git a/app/code/core/Mage/Catalog/Model/Product/Url.php b/app/code/core/Mage/Catalog/Model/Product/Url.php index 9759bf9e2b..00e23cd357 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Url.php +++ b/app/code/core/Mage/Catalog/Model/Product/Url.php @@ -84,6 +84,9 @@ public function getProductUrl($product) $url = $product->getData($cacheUrlKey); if (is_null($url)) { + if ($product->getStoreId()) { + $this->getUrlInstance()->setStore($product->getStoreId()); + } if ($product->hasData('request_path') && $product->getRequestPath() != '') { $this->setData($cacheUrlKey, $this->getUrlInstance()->getDirectUrl($product->getRequestPath())); return $this->getData($cacheUrlKey); @@ -102,7 +105,7 @@ public function getProductUrl($product) } $rewrite->loadByIdPath($idPath); - +//echo $this->getUrlInstance()->getBaseUrl(); if ($rewrite->getId()) { $this->setData($cacheUrlKey, $this->getUrlInstance()->getDirectUrl($rewrite->getRequestPath())); Varien_Profiler::stop('REWRITE: '.__METHOD__); diff --git a/app/code/core/Mage/CatalogInventory/Model/Mysql4/Stock/Item.php b/app/code/core/Mage/CatalogInventory/Model/Mysql4/Stock/Item.php index 4e3361480f..0e8fdf03a4 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Mysql4/Stock/Item.php +++ b/app/code/core/Mage/CatalogInventory/Model/Mysql4/Stock/Item.php @@ -78,7 +78,7 @@ protected function _getLoadSelect($field, $value, $object) */ public function addCatalogInventoryToProductCollection($productCollection) { - $isStockManagedInConfig = Mage::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_MANAGE_STOCK); + $isStockManagedInConfig = (int) Mage::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_MANAGE_STOCK); $productCollection->joinTable('cataloginventory/stock_item', 'product_id=entity_id', array( @@ -86,7 +86,6 @@ public function addCatalogInventoryToProductCollection($productCollection) 'inventory_in_stock' => 'is_in_stock' ), null, 'left'); - return $this; } } \ No newline at end of file diff --git a/app/code/core/Mage/Checkout/Model/Type/Onepage.php b/app/code/core/Mage/Checkout/Model/Type/Onepage.php index 9f614592c7..ccb4ff279f 100644 --- a/app/code/core/Mage/Checkout/Model/Type/Onepage.php +++ b/app/code/core/Mage/Checkout/Model/Type/Onepage.php @@ -225,7 +225,7 @@ protected function _processValidateCustomer(Mage_Sales_Model_Quote_Address $addr } // invoke customer model, if it is registering - if ($address->getCustomerPassword()) { + if ('register' == $this->getQuote()->getCheckoutMethod()) { // set customer password hash for further usage $customer = Mage::getModel('customer/customer'); $this->getQuote()->setPasswordHash($customer->encryptPassword($address->getCustomerPassword())); @@ -251,6 +251,14 @@ protected function _processValidateCustomer(Mage_Sales_Model_Quote_Address $addr 'message' => implode(', ', $validationResult) ); } + } elseif('guest' == $this->getQuote()->getCheckoutMethod()) { + $email = $address->getData('email'); + if (!Zend_Validate::is($email, 'EmailAddress')) { + return array( + 'error' => -1, + 'message' => Mage::helper('checkout')->__('Invalid email address "%s"', $email) + ); + } } return true; diff --git a/app/code/core/Mage/Core/Model/Abstract.php b/app/code/core/Mage/Core/Model/Abstract.php index ac8339a485..2b0cd44429 100644 --- a/app/code/core/Mage/Core/Model/Abstract.php +++ b/app/code/core/Mage/Core/Model/Abstract.php @@ -80,6 +80,15 @@ abstract class Mage_Core_Model_Abstract extends Varien_Object */ protected $_cacheTag = false; + /** + * Flag which can stop data saving after before save + * Can be used for next sequence: we check data in _beforeSave, if data are + * not valid - we can set this flag to false value and save process will be stopped + * + * @var bool + */ + protected $_dataSaveAllowed = true; + /** * Standard model initialization * @@ -238,9 +247,10 @@ public function save() $this->_getResource()->beginTransaction(); try { $this->_beforeSave(); - $this->_getResource()->save($this); - $this->_afterSave(); - + if ($this->_dataSaveAllowed) { + $this->_getResource()->save($this); + $this->_afterSave(); + } $this->_getResource()->commit(); } catch (Exception $e){ diff --git a/app/code/core/Mage/Core/etc/config.xml b/app/code/core/Mage/Core/etc/config.xml index a5904a7c9a..284eed18b2 100644 --- a/app/code/core/Mage/Core/etc/config.xml +++ b/app/code/core/Mage/Core/etc/config.xml @@ -76,6 +76,7 @@ Shockwave Flash + Adobe Flash Player 9 Adobe Flash Player 10 diff --git a/app/code/core/Mage/GoogleBase/Model/Item.php b/app/code/core/Mage/GoogleBase/Model/Item.php index c9408f577b..529378e267 100644 --- a/app/code/core/Mage/GoogleBase/Model/Item.php +++ b/app/code/core/Mage/GoogleBase/Model/Item.php @@ -49,7 +49,7 @@ protected function _construct() */ public function getServiceItem() { - return Mage::getModel('googlebase/service_item'); + return Mage::getModel('googlebase/service_item')->setStoreId($this->getStoreId()); } /** @@ -185,7 +185,7 @@ protected function _checkProduct() protected function _prepareProductObject() { $product = clone $this->getProduct(); - + /* @var $product Mage_Catalog_Model_Product */ $url = $product->getProductUrl(); if (!Mage::getStoreConfigFlag('web/url/use_store')) { $urlInfo = parse_url($url); diff --git a/app/code/core/Mage/GoogleBase/Model/Observer.php b/app/code/core/Mage/GoogleBase/Model/Observer.php index cd49c53b10..f69866b416 100644 --- a/app/code/core/Mage/GoogleBase/Model/Observer.php +++ b/app/code/core/Mage/GoogleBase/Model/Observer.php @@ -41,9 +41,8 @@ class Mage_GoogleBase_Model_Observer */ public function saveProductItem($observer) { - if (Mage::getStoreConfigFlag('google/googlebase/observed')) { - $product = $observer->getEvent()->getProduct(); - + $product = $observer->getEvent()->getProduct(); + if (Mage::getStoreConfigFlag('google/googlebase/observed', $product->getStoreId())) { $collection = Mage::getResourceModel('googlebase/item_collection') ->addProductFilterId($product->getId()) ->load(); @@ -65,9 +64,8 @@ public function saveProductItem($observer) */ public function deleteProductItem($observer) { - if (Mage::getStoreConfigFlag('google/googlebase/observed')) { - $product = $observer->getEvent()->getProduct(); - + $product = $observer->getEvent()->getProduct(); + if (Mage::getStoreConfigFlag('google/googlebase/observed', $product->getStoreId())) { $collection = Mage::getResourceModel('googlebase/item_collection') ->addProductFilterId($product->getId()) ->load(); diff --git a/app/code/core/Mage/GoogleBase/Model/Service.php b/app/code/core/Mage/GoogleBase/Model/Service.php index 042f0448fa..17c522f333 100644 --- a/app/code/core/Mage/GoogleBase/Model/Service.php +++ b/app/code/core/Mage/GoogleBase/Model/Service.php @@ -38,10 +38,10 @@ class Mage_GoogleBase_Model_Service extends Varien_Object * * @return Zend_Http_Client */ - public function getClient() + public function getClient($storeId = null) { - $user = Mage::getStoreConfig('google/googlebase/login'); - $pass = Mage::getStoreConfig('google/googlebase/password'); + $user = Mage::getStoreConfig('google/googlebase/login', $storeId); + $pass = Mage::getStoreConfig('google/googlebase/password', $storeId); // Create an authenticated HTTP client $errorMsg = Mage::helper('googlebase')->__('Unable to connect to Google Base. Please, check Account settings in configuration.'); @@ -63,10 +63,10 @@ public function getClient() * * @return Zend_Gdata_Gbase */ - public function getService() + public function getService($storeId = null) { if (!$this->_service) { - $service = $this->_connect(); + $service = $this->_connect($storeId); $this->_service = $service; } return $this->_service; @@ -77,9 +77,9 @@ public function getService() * * @return Zend_Gdata_Gbase */ - protected function _connect() + protected function _connect($storeId = null) { - $client = $this->getClient(); + $client = $this->getClient($storeId); $service = new Zend_Gdata_Gbase($client); return $service; } diff --git a/app/code/core/Mage/GoogleBase/Model/Service/Feed.php b/app/code/core/Mage/GoogleBase/Model/Service/Feed.php index 8c3bef836c..27bc423b63 100644 --- a/app/code/core/Mage/GoogleBase/Model/Service/Feed.php +++ b/app/code/core/Mage/GoogleBase/Model/Service/Feed.php @@ -42,10 +42,10 @@ class Mage_GoogleBase_Model_Service_Feed extends Mage_GoogleBase_Model_Service * @param string $location * @return Zend_Gdata_Feed */ - public function getFeed($location = null) + public function getFeed($location = null, $storeId = null) { $query = new Zend_Gdata_Query($location); - return $this->getService()->getFeed($query); + return $this->getService($storeId)->getFeed($query); } /** @@ -53,9 +53,9 @@ public function getFeed($location = null) * * @return array */ - public function getItemsStatsArray() + public function getItemsStatsArray($storeId = null) { - $feed = $this->getFeed(self::ITEMS_LOCATION); + $feed = $this->getFeed(self::ITEMS_LOCATION, $storeId); $result = array(); foreach ($feed as $entry) { $draft = 'no'; @@ -88,13 +88,13 @@ public function getItemsStatsArray() * * @return array */ - public function getItemTypes() + public function getItemTypes($storeId = null) { if (is_array($this->_itemTypes)) { return $this->_itemTypes; } $location = self::ITEM_TYPES_LOCATION . '/' . Mage::app()->getLocale()->getLocale(); - $feed = $this->getFeed($location); + $feed = $this->getFeed($location, $storeId); $itemTypes = array(); foreach ($feed->entries as $entry) { @@ -132,9 +132,9 @@ public function getItemTypes() * @param string $type Google Base Item Type * @return array */ - public function getAttributes($type) + public function getAttributes($type, $storeId = null) { - $itemTypes = $this->getItemTypes(); + $itemTypes = $this->getItemTypes($storeId); if (isset($itemTypes[$type]) && $itemTypes[$type] instanceof Varien_Object) { return $itemTypes[$type]->getAttributes(); } diff --git a/app/code/core/Mage/GoogleBase/Model/Service/Item.php b/app/code/core/Mage/GoogleBase/Model/Service/Item.php index 1ff0d26295..729032097a 100644 --- a/app/code/core/Mage/GoogleBase/Model/Service/Item.php +++ b/app/code/core/Mage/GoogleBase/Model/Service/Item.php @@ -94,6 +94,19 @@ public function getItem() return $this->_item; } + /** + * Return Store level Service Instance + * + * @return Zend_Gdata_Gbase + */ + public function getService($storeId = null) + { + if ($storeId === null) { + $storeId = $this->getStoreId(); + } + return parent::getService($storeId); + } + /** * Insert Item into Google Base * @@ -262,10 +275,15 @@ protected function _setUniversalData() $quantity = $object->getQuantity() ? max(1, (int)$object->getQuantity()) : 1; $this->_setAttribute('quantity', $quantity, 'int'); } + if ($object->getImageUrl()) { $this->_setAttribute('image_link', $object->getImageUrl(), 'url'); } + if ($country = Mage::getStoreConfig('google/googlebase/target_country', $this->getStoreId())) { + $this->_setAttribute('target_country', $country, 'text'); + } + return $this; } diff --git a/app/code/core/Mage/GoogleBase/Model/Source/Country.php b/app/code/core/Mage/GoogleBase/Model/Source/Country.php new file mode 100644 index 0000000000..585aa196ab --- /dev/null +++ b/app/code/core/Mage/GoogleBase/Model/Source/Country.php @@ -0,0 +1,44 @@ + + */ +class Mage_GoogleBase_Model_Source_Country +{ + public function toOptionArray() + { + return array( + array('value' => 'US', 'label' => Mage::helper('googlebase')->__('United States')), + array('value' => 'GB', 'label' => Mage::helper('googlebase')->__('United Kingdom')), + array('value' => 'DE', 'label' => Mage::helper('googlebase')->__('Germany')), + ); + } +} \ No newline at end of file diff --git a/app/code/core/Mage/GoogleBase/controllers/ItemsController.php b/app/code/core/Mage/GoogleBase/controllers/ItemsController.php index 98b8e464e0..b7c77053f2 100644 --- a/app/code/core/Mage/GoogleBase/controllers/ItemsController.php +++ b/app/code/core/Mage/GoogleBase/controllers/ItemsController.php @@ -207,7 +207,7 @@ public function refreshAction() ); } - $stats = Mage::getModel('googlebase/service_feed')->getItemsStatsArray(); + $stats = Mage::getModel('googlebase/service_feed')->getItemsStatsArray($storeId); foreach ($existing as $entryId => $itemInfo) { @@ -248,4 +248,9 @@ public function _getStore() } return Mage::app()->getStore($storeId); } + + protected function _isAllowed() + { + return Mage::getSingleton('admin/session')->isAllowed('catalog/googlebase/items'); + } } \ No newline at end of file diff --git a/app/code/core/Mage/GoogleBase/controllers/TypesController.php b/app/code/core/Mage/GoogleBase/controllers/TypesController.php index 8dc21dcb75..6101d449da 100644 --- a/app/code/core/Mage/GoogleBase/controllers/TypesController.php +++ b/app/code/core/Mage/GoogleBase/controllers/TypesController.php @@ -188,4 +188,9 @@ public function loadAttributesAction () $this->_getSession()->addError($e->getMessage()); } } + + protected function _isAllowed() + { + return Mage::getSingleton('admin/session')->isAllowed('catalog/googlebase/types'); + } } \ No newline at end of file diff --git a/app/code/core/Mage/GoogleBase/etc/config.xml b/app/code/core/Mage/GoogleBase/etc/config.xml index da51fbeb57..81a9b797d4 100644 --- a/app/code/core/Mage/GoogleBase/etc/config.xml +++ b/app/code/core/Mage/GoogleBase/etc/config.xml @@ -81,16 +81,18 @@ Mage_GoogleBase_Block - + - standard + admin Mage_GoogleBase googlebase + + @@ -146,6 +148,32 @@ + + + + + + + + Google Base + 500 + + + Manage Attributes + 0 + + + Manage Items + 5 + + + + + + + + + @@ -163,6 +191,9 @@ 0 + + US + diff --git a/app/code/core/Mage/GoogleBase/etc/system.xml b/app/code/core/Mage/GoogleBase/etc/system.xml index 993a8874da..f5401c2ab7 100644 --- a/app/code/core/Mage/GoogleBase/etc/system.xml +++ b/app/code/core/Mage/GoogleBase/etc/system.xml @@ -34,33 +34,42 @@ text 20 1 - 0 - 0 + 1 + 1 - + text 1 1 - 0 - 0 + 1 + 1 password 2 1 - 0 - 0 + 1 + 1 + + + select + googlebase/source_country + 3 + 1 + 1 + 1 + select adminhtml/system_config_source_yesno 100 1 - 0 - 0 + 1 + 1 diff --git a/app/code/core/Mage/GoogleCheckout/Block/Adminhtml/Shipping/Applicable/Countries.php b/app/code/core/Mage/GoogleCheckout/Block/Adminhtml/Shipping/Applicable/Countries.php new file mode 100644 index 0000000000..a1a65d6e7e --- /dev/null +++ b/app/code/core/Mage/GoogleCheckout/Block/Adminhtml/Shipping/Applicable/Countries.php @@ -0,0 +1,65 @@ +_appendJs($element); + return $html; + } + + protected function _appendJs($element) + { + $elId = $element->getHtmlId(); + $childId = str_replace('sallowspecific', 'specificcountry', $elId); + $html = ""; + return $html; + } +} diff --git a/app/code/core/Mage/GoogleCheckout/etc/system.xml b/app/code/core/Mage/GoogleCheckout/etc/system.xml index 02d4c2c428..ff120c0255 100644 --- a/app/code/core/Mage/GoogleCheckout/etc/system.xml +++ b/app/code/core/Mage/GoogleCheckout/etc/system.xml @@ -332,8 +332,8 @@ select 24 - shipping-applicable-country adminhtml/system_config_source_shipping_allspecificcountries + googlecheckout/adminhtml_shipping_applicable_countries 1 1 0 @@ -370,8 +370,8 @@ select 34 - shipping-applicable-country-2 adminhtml/system_config_source_shipping_allspecificcountries + googlecheckout/adminhtml_shipping_applicable_countries 1 1 0 @@ -407,8 +407,8 @@ select 44 - shipping-applicable-country-3 adminhtml/system_config_source_shipping_allspecificcountries + googlecheckout/adminhtml_shipping_applicable_countries 1 1 0 diff --git a/app/code/core/Mage/GoogleOptimizer/Block/Js.php b/app/code/core/Mage/GoogleOptimizer/Block/Js.php index c9eb9482a8..a2ee0ff01c 100644 --- a/app/code/core/Mage/GoogleOptimizer/Block/Js.php +++ b/app/code/core/Mage/GoogleOptimizer/Block/Js.php @@ -45,7 +45,7 @@ public function getMaxCountOfAttributes() public function getExportUrl() { - return Mage::getUrl('googleoptimizer/index/codes'); + return $this->getUrl('googleoptimizer/index/codes'); } public function getControlFieldKey () diff --git a/app/code/core/Mage/Log/etc/config.xml b/app/code/core/Mage/Log/etc/config.xml index e0b34639f7..296d849792 100644 --- a/app/code/core/Mage/Log/etc/config.xml +++ b/app/code/core/Mage/Log/etc/config.xml @@ -178,7 +178,7 @@ - 1 + 180 0 D diff --git a/app/code/core/Mage/Log/etc/system.xml b/app/code/core/Mage/Log/etc/system.xml index fb11d6a1ca..8b685a09b6 100644 --- a/app/code/core/Mage/Log/etc/system.xml +++ b/app/code/core/Mage/Log/etc/system.xml @@ -26,27 +26,27 @@ */ --> - - - - - - text + + + + + + text 200 - 1 - 0 + 1 + 0 0 - - - + + + text - 1 + 1 1 0 0 - - - + + + select adminhtml/system_config_source_yesno 2 @@ -54,7 +54,7 @@ 0 0 - - - - - + + + + + \ No newline at end of file diff --git a/app/code/core/Mage/Newsletter/Model/Template.php b/app/code/core/Mage/Newsletter/Model/Template.php index bc6451436d..9749127572 100644 --- a/app/code/core/Mage/Newsletter/Model/Template.php +++ b/app/code/core/Mage/Newsletter/Model/Template.php @@ -142,7 +142,7 @@ public function getTemplateTextPreprocessed() public function getProcessedTemplate(array $variables = array(), $usePreprocess=false) { - $processor = new Varien_Filter_Template(); + $processor = Mage::getModel('core/email_template_filter'); if(!$this->_preprocessFlag) { $variables['this'] = $this; diff --git a/app/code/core/Mage/Page/Block/Html/Footer.php b/app/code/core/Mage/Page/Block/Html/Footer.php index cad2e6f340..0a5c9bb79b 100644 --- a/app/code/core/Mage/Page/Block/Html/Footer.php +++ b/app/code/core/Mage/Page/Block/Html/Footer.php @@ -46,7 +46,7 @@ protected function _construct() public function getCacheKey() { - return 'PAGE_FOOTER_'.Mage::app()->getStore()->getId(); + return 'PAGE_FOOTER_' . Mage::app()->getStore()->getId() . '_' . (int)Mage::app()->getStore()->isCurrentlySecure(); } public function setCopyright($copyright) diff --git a/app/code/core/Mage/PaypalUk/etc/config.xml b/app/code/core/Mage/PaypalUk/etc/config.xml index 92a3f031f3..33c44c2aab 100644 --- a/app/code/core/Mage/PaypalUk/etc/config.xml +++ b/app/code/core/Mage/PaypalUk/etc/config.xml @@ -125,25 +125,6 @@ - - - - - - - - - - PayPal Uk Section - - - - - - - - - diff --git a/app/code/core/Mage/Review/Block/Customer/View.php b/app/code/core/Mage/Review/Block/Customer/View.php index f9e5b846c7..c3a462b276 100644 --- a/app/code/core/Mage/Review/Block/Customer/View.php +++ b/app/code/core/Mage/Review/Block/Customer/View.php @@ -45,7 +45,10 @@ public function __construct() public function getProductData() { if( $this->getReviewId() && !$this->getProductCacheData() ) { - $this->setProductCacheData(Mage::getModel('catalog/product')->load($this->getReviewData()->getEntityPkValue())); + $product = Mage::getModel('catalog/product') + ->setStoreId(Mage::app()->getStore()->getId()) + ->load($this->getReviewData()->getEntityPkValue()); + $this->setProductCacheData($product); } return $this->getProductCacheData(); } diff --git a/app/code/core/Mage/Sales/Model/Quote/Address.php b/app/code/core/Mage/Sales/Model/Quote/Address.php index 7bfc09f597..f62db7c659 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address.php @@ -62,7 +62,13 @@ protected function _beforeSave() { parent::_beforeSave(); if ($this->getQuote()) { - $this->setQuoteId($this->getQuote()->getId()); + $quoteId = $this->getQuote()->getId(); + if ($quoteId) { + $this->setQuoteId($quoteId); + } + else { + $this->_dataSaveAllowed = false; + } } return $this; } diff --git a/app/code/core/Mage/Shipping/Model/Mysql4/Carrier/Tablerate.php b/app/code/core/Mage/Shipping/Model/Mysql4/Carrier/Tablerate.php index 2261561cb2..1f85b4cf1a 100644 --- a/app/code/core/Mage/Shipping/Model/Mysql4/Carrier/Tablerate.php +++ b/app/code/core/Mage/Shipping/Model/Mysql4/Carrier/Tablerate.php @@ -120,6 +120,7 @@ public function getRate(Mage_Shipping_Model_Rate_Request $request) return $row; } + public function uploadAndImport(Varien_Object $object) { $csvFile = $_FILES["groups"]["tmp_name"]["tablerate"]["fields"]["import"]["value"]; @@ -174,16 +175,22 @@ public function uploadAndImport(Varien_Object $object) $data = array(); $countryCodesToIds = array(); $regionCodesToIds = array(); + $countryCodesIso2 = array(); $countryCollection = Mage::getResourceModel('directory/country_collection')->addCountryCodeFilter($countryCodes)->load(); foreach ($countryCollection->getItems() as $country) { $countryCodesToIds[$country->getData('iso3_code')] = $country->getData('country_id'); $countryCodesToIds[$country->getData('iso2_code')] = $country->getData('country_id'); + $countryCodesIso2[] = $country->getData('iso2_code'); } - $regionCollection = Mage::getResourceModel('directory/region_collection')->addRegionCodeFilter($regionCodes)->load(); + $regionCollection = Mage::getResourceModel('directory/region_collection') + ->addRegionCodeFilter($regionCodes) + ->addCountryFilter($countryCodesIso2) + ->load(); + foreach ($regionCollection->getItems() as $region) { - $regionCodesToIds[$region->getData('code')] = $region->getData('region_id'); + $regionCodesToIds[$countryCodesToIds[$region->getData('country_id')]][$region->getData('code')] = $region->getData('region_id'); } foreach ($csvLines as $k=>$csvLine) { @@ -198,13 +205,14 @@ public function uploadAndImport(Varien_Object $object) $countryId = $countryCodesToIds[$csvLine[0]]; } - if (empty($regionCodesToIds) || !array_key_exists($csvLine[1], $regionCodesToIds)) { + if (empty($regionCodesToIds[$countryCodesToIds[$csvLine[0]]]) + || !array_key_exists($csvLine[1], $regionCodesToIds[$countryCodesToIds[$csvLine[0]]])) { $regionId = '0'; if ($csvLine[1] != '*' && $csvLine[1] != '') { $exceptions[] = Mage::helper('shipping')->__('Invalid Region/State "%s" in the Row #%s', $csvLine[1], ($k+1)); } } else { - $regionId = $regionCodesToIds[$csvLine[1]]; + $regionId = $regionCodesToIds[$countryCodesToIds[$csvLine[0]]][$csvLine[1]]; } if ($csvLine[2] == '*' || $csvLine[2] == '') { @@ -246,6 +254,7 @@ public function uploadAndImport(Varien_Object $object) } } } + if (!empty($exceptions)) { throw new Exception( "\n" . implode("\n", $exceptions) ); } @@ -253,7 +262,7 @@ public function uploadAndImport(Varien_Object $object) } } - private function _getCsvValues($string, $separator=",") + protected function _getCsvValues($string, $separator=",") { $elements = explode($separator, trim($string)); for ($i = 0; $i < count($elements); $i++) { @@ -279,7 +288,7 @@ private function _getCsvValues($string, $separator=",") return $elements; } - private function _isPositiveDecimalNumber($n) + protected function _isPositiveDecimalNumber($n) { return preg_match ("/^[0-9]+(\.[0-9]*)?$/", $n); } diff --git a/app/code/core/Mage/Shipping/etc/config.xml b/app/code/core/Mage/Shipping/etc/config.xml index f40a39ce57..8dac63a69a 100644 --- a/app/code/core/Mage/Shipping/etc/config.xml +++ b/app/code/core/Mage/Shipping/etc/config.xml @@ -111,7 +111,7 @@ - Shipping Section + Shipping Settings Section 0 diff --git a/app/code/core/Mage/Tag/controllers/CustomerController.php b/app/code/core/Mage/Tag/controllers/CustomerController.php index 978838ced4..461052437a 100644 --- a/app/code/core/Mage/Tag/controllers/CustomerController.php +++ b/app/code/core/Mage/Tag/controllers/CustomerController.php @@ -148,7 +148,7 @@ public function saveAction() $tagId = (int) $this->getRequest()->getParam('tagId'); $customerId = Mage::getSingleton('customer/session')->getCustomerId(); - $tagName = (string) $this->getRequest()->getPost('tagName'); + $tagName = (string) $this->getRequest()->getPost('productTagName'); if (strlen($tagName) === 0) { Mage::getSingleton('tag/session')->addError(Mage::helper('tag')->__('Tag can\'t be empty.')); diff --git a/app/code/core/Mage/Tax/etc/config.xml b/app/code/core/Mage/Tax/etc/config.xml index 72ba9eea8b..995419f8d7 100644 --- a/app/code/core/Mage/Tax/etc/config.xml +++ b/app/code/core/Mage/Tax/etc/config.xml @@ -167,7 +167,7 @@ 20 - Manage Tax Rates + Manage Tax Zones & Rates 30 diff --git a/app/design/adminhtml/default/default/template/catalog/category/edit/form.phtml b/app/design/adminhtml/default/default/template/catalog/category/edit/form.phtml index 763eb17402..e61f3b188b 100644 --- a/app/design/adminhtml/default/default/template/catalog/category/edit/form.phtml +++ b/app/design/adminhtml/default/default/template/catalog/category/edit/form.phtml @@ -46,7 +46,7 @@ __('Set root category for this store in the configuration', $this->getStoreConfigurationUrl()) ?> - +
diff --git a/app/design/adminhtml/default/default/template/catalog/product/edit/options/type/select.phtml b/app/design/adminhtml/default/default/template/catalog/product/edit/options/type/select.phtml index 1741ebfde7..b7348fdd22 100644 --- a/app/design/adminhtml/default/default/template/catalog/product/edit/options/type/select.phtml +++ b/app/design/adminhtml/default/default/template/catalog/product/edit/options/type/select.phtml @@ -48,10 +48,11 @@ OptionTemplateSelect = ''+ ''+ '
'; -OptionTemplateSelectRow = ''+ +OptionTemplateSelectRow = ''+ + ''+ + ''+ ''+ - ''+ - '{{checkboxScopeTitle}}'+ + '{{checkboxScopeTitle}}'+ ''+ 'getPriceTypeSelectHtml() ?>{{checkboxScopePrice}}'+ ''+ @@ -82,7 +83,7 @@ selectOptionType = { data.id = optionId; - Element.insert($(this.div+'_'+data.id), {'bottom':this.template.evaluate(data)}); + Element.insert($(this.div+'_'+data.id), {'bottom':this.template.evaluate(data)}); if (data.checkboxScopeTitle) { //set disabled diff --git a/app/design/frontend/default/default/template/tag/customer/edit.phtml b/app/design/frontend/default/default/template/tag/customer/edit.phtml index 99edf65cd8..fc39c586a9 100644 --- a/app/design/frontend/default/default/template/tag/customer/edit.phtml +++ b/app/design/frontend/default/default/template/tag/customer/edit.phtml @@ -34,7 +34,7 @@
  • - +