From 69c3ea0b2c406b728fdca102442faeda2c666c72 Mon Sep 17 00:00:00 2001 From: Lee Saferite Date: Sun, 2 Aug 2009 21:05:11 -0400 Subject: [PATCH] Import Magento Release 1.3.2.3 --- app/Mage.php | 2 +- .../core/Mage/AmazonPayments/etc/system.xml | 4 ++-- .../Resource/Eav/Mysql4/Category/Collection.php | 12 +++++++----- .../core/Mage/Payment/Model/Method/Free.php | 17 ++++++++++++++--- app/code/core/Mage/Paypal/Model/Standard.php | 3 ++- .../core/Mage/Sales/Model/Order/Payment.php | 6 ++++-- .../core/Mage/Sales/Model/Quote/Payment.php | 9 +++++++-- js/mage/adminhtml/tools.js | 4 ++-- 8 files changed, 39 insertions(+), 18 deletions(-) diff --git a/app/Mage.php b/app/Mage.php index a60392aaf8..283a66a4f3 100644 --- a/app/Mage.php +++ b/app/Mage.php @@ -84,7 +84,7 @@ final class Mage { public static function getVersion() { - return '1.3.2.2'; + return '1.3.2.3'; } /** diff --git a/app/code/core/Mage/AmazonPayments/etc/system.xml b/app/code/core/Mage/AmazonPayments/etc/system.xml index cedb72a8a4..7b3e835b67 100644 --- a/app/code/core/Mage/AmazonPayments/etc/system.xml +++ b/app/code/core/Mage/AmazonPayments/etc/system.xml @@ -36,12 +36,12 @@


Signing up with Checkout by Amazon

To configure Checkout by Amazon™ you will need to enter your Checkout by Amazon™ Merchant ID, Access Key ID, and Secret Access Key.

-

If you do not already have a Checkout by Amazon™ account, click here to create one now. Sign-Up

+

If you do not already have a Checkout by Amazon™ account, click here to create one now. Sign-Up

To locate your Merchant ID, sign in to your Seller Central Checkout by Amazon™ account and click Settings > Checkout Pipeline Settings.

To locate your Access Key ID and Secret Access Key, sign in to your Seller Central Checkout by Amazon™ account and click Integration > AWS Key. Click the link to read the Amazon Web Services Customer Agreement, and then click the check box, if you are setting up a new Access Key ID.

To enable XML Order Reports click Settings > Checkout Pipeline Settings, and then clicking Edit under the Order Report Settings section. Select Order Report Type as XML to get XML Order Reports using SOAP APIs. Configure your downloads for hourly.

For additional information on setting up your Checkout by Amazon account, Click Here - FAQ.

-


Signup for Checkout by Amazon

+


Signup for Checkout by Amazon

]]> diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Collection.php index 5a81d4fac9..ae6976d6c7 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Category/Collection.php @@ -168,14 +168,18 @@ public function getProductStoreId() } /** - * Enter description here... + * Load collection * - * @param boolean $printQuery - * @param boolean $logQuery + * @param bool $printQuery + * @param bool $logQuery * @return Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Collection */ public function load($printQuery = false, $logQuery = false) { + if ($this->isLoaded()) { + return $this; + } + if ($this->_loadWithProductCount) { $this->addAttributeToSelect('all_children'); $this->addAttributeToSelect('is_anchor'); @@ -192,8 +196,6 @@ public function load($printQuery = false, $logQuery = false) /** * Load categories product count - * - * @return Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Collection */ protected function _loadProductCount() { diff --git a/app/code/core/Mage/Payment/Model/Method/Free.php b/app/code/core/Mage/Payment/Model/Method/Free.php index b521802584..6a1dc2fee6 100644 --- a/app/code/core/Mage/Payment/Model/Method/Free.php +++ b/app/code/core/Mage/Payment/Model/Method/Free.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com) + * @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -30,12 +30,23 @@ * * @category Mage * @package Mage_Payment - * @author Magento Core Team + * @author Magento Core Team */ class Mage_Payment_Model_Method_Free extends Mage_Payment_Model_Method_Abstract { + /** + * Payment code name + * + * @var string + */ protected $_code = 'free'; + /** + * Check method is available + * + * @param Mage_Sales_Model_Quote $quote + * @return bool + */ public function isAvailable($quote=null) { if (is_null($quote)) { @@ -47,4 +58,4 @@ public function isAvailable($quote=null) } return false; } -} \ No newline at end of file +} diff --git a/app/code/core/Mage/Paypal/Model/Standard.php b/app/code/core/Mage/Paypal/Model/Standard.php index d0aa39870c..e77e3d8453 100644 --- a/app/code/core/Mage/Paypal/Model/Standard.php +++ b/app/code/core/Mage/Paypal/Model/Standard.php @@ -194,6 +194,7 @@ public function getStandardCheckoutFormFields() 'state' => $a->getRegionCode(), 'country' => $a->getCountry(), 'zip' => $a->getPostcode(), + 'bn' => 'Varien_Cart_WPS_US' ); $logoUrl = Mage::getStoreConfig('paypal/wps/logo_url'); @@ -413,7 +414,7 @@ public function ipnPostSubmit() $order->getPayment()->setTransactionId($this->getIpnFormData('txn_id')); //need to convert from order into invoice $invoice = $order->prepareInvoice(); - $invoice->register()->capture(); + $invoice->register()->pay(); Mage::getModel('core/resource_transaction') ->addObject($invoice) ->addObject($invoice->getOrder()) diff --git a/app/code/core/Mage/Sales/Model/Order/Payment.php b/app/code/core/Mage/Sales/Model/Order/Payment.php index 6559d8edad..9c36b06aff 100644 --- a/app/code/core/Mage/Sales/Model/Order/Payment.php +++ b/app/code/core/Mage/Sales/Model/Order/Payment.php @@ -147,7 +147,9 @@ public function place() $this->setAmountAuthorized($this->getOrder()->getTotalDue()); $this->setBaseAmountAuthorized($this->getOrder()->getBaseTotalDue()); - $orderState = Mage_Sales_Model_Order::STATE_PROCESSING; + $orderState = $this->getOrder()->getIsVirtual() + ? Mage_Sales_Model_Order::STATE_COMPLETE + : Mage_Sales_Model_Order::STATE_PROCESSING; break; default: break; @@ -174,7 +176,7 @@ public function place() $orderStatus = $methodInstance->getConfigData('order_status'); } - if (!$orderStatus) { + if (!$orderStatus || $this->getOrder()->getIsVirtual()) { $orderStatus = $this->getOrder()->getConfig()->getStateDefaultStatus($orderState); } } diff --git a/app/code/core/Mage/Sales/Model/Quote/Payment.php b/app/code/core/Mage/Sales/Model/Quote/Payment.php index bc3f41376f..4cd8b95e3d 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Payment.php +++ b/app/code/core/Mage/Sales/Model/Quote/Payment.php @@ -68,8 +68,9 @@ public function getQuote() /** * Import data * - * @param array $data - * @return Mage_Sales_Model_Quote_Payment + * @param array $data + * @throws Mage_Core_Exception + * @return Mage_Sales_Model_Quote_Payment */ public function importData(array $data) { @@ -85,6 +86,10 @@ public function importData(array $data) $this->setMethod($data->getMethod()); $method = $this->getMethodInstance(); + if (!$method->isAvailable($this->getQuote())) { + Mage::throwException(Mage::helper('sales')->__('Requested Payment Method is not available')); + } + $method->assignData($data); /* * validating the payment data diff --git a/js/mage/adminhtml/tools.js b/js/mage/adminhtml/tools.js index c2c6bd0e47..e8f15f9f3b 100644 --- a/js/mage/adminhtml/tools.js +++ b/js/mage/adminhtml/tools.js @@ -211,7 +211,7 @@ if (!navigator.appVersion.match('MSIE 6.')) { header_copy = document.createElement('div'); header_copy.appendChild(header.cloneNode(true)); - document.body.appendChild(header_copy); + document.body.insertBefore(header_copy, document.body.lastChild) $(header_copy).addClassName('content-header-floating'); if ($(header_copy).down('.content-buttons-placeholder')) { $(header_copy).down('.content-buttons-placeholder').remove(); @@ -373,4 +373,4 @@ var Fieldset = { loaderArea: false }); } -}; \ No newline at end of file +};