diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index ec77a8a0b3..d9dfccc3c2 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -1,3 +1,148 @@
+==== 1.6.1.0-beta1 ====
+
+=== Major Highlights ===
+Added two-step password reset flow
+
+=== Improvements ===
+Added support for using Shift-Click to select a range of grid rows when clicking check boxes
+Added ability to register during checkout when using PayPal Express
+Updated PayflowLink HSS user interface in checkout
+"Add to Wishlist", "Add to Compare" were added on the Product Details Page for configurable, bundled and downloadable products
+
+=== Changes ===
+TheFind integration was removed
+Google Optimizer was removed (it will be supported as a core extension)
+Improved how discounts are applied to sub products
+
+=== Fixes ===
+Fixed Saved CC form is not displayed, when there are no other available payment methods except Saved CC
+Fixed It's impossible to create Catalog Price Rule
+Fixed Fatal error on Multiple Addresses Checkout
+Fixed Package Types that not available for current Shipping Method displayed in Create Packages pop-up
+Fixed Stock item product getter not correspond to product setter
+- added method getProduct()
+Fixed Admin user interface: mistakes in labels names
+Fixed Typo in Mage_Eav_Model_Resource_Entity_Attribute_Option model
+Fixed Billing Agreement error
+Fixed Payflow Link UI Changes
+Fixed 'Website Payments Pro' impossible to place order during onepage checkout
+Fixed Table rates works incorrect with asterisk
+Fixed Typo in Category Resource Model
+Fixed 3D secure with Saved CC works incorrectly
+- removed unrelated message which told validation failed (even if it has actually succeeded) when trying to re-validate a card
+Fixed Bug in Role Permission
+Fixed Orders placed via Google Checkout were not created on the Magento side
+Fixed When using direct Export, the _super_product_sku and _super_product_option on the configurable product does not match
+Fixed Composite product price in grid is displayed incorrectly with some currencies due to JS regexp problem
+Fixed No error message on Payflow link iframe
+Fixed Flex uploader elements overlaps hovering menu items in backend
+Fixed Unable to upload images in Magento installed on local server
+Fixed Configurable Products - Use Default (attribute name) does not work correctly on IE9
+Fixed Capture failed when Verification Authorization Amount is set to Zero
+Fixed Attribute is sorted like a string even when Input Validation for Store Owner is an Integer Number
+Fixed Void and Cancel Order doesn't work (PayflowLink HSS)
+Fixed Grand Total (Excl Tax) with negative value displays in the printed Credit Memo
+Fixed Resource model of Media module is wrongly declared
+Fixed Constraint violation with core_cache_tag table
+Fixed Misprint in \downloader\lib\Mage\Connect\Validator.php
+Fixed XMLRPC API attribute status changing
+Fixed Typo in Mage_Rss_Block_Catalog_Category::_toHtml() method
+Fixed Incorrect tax summary for partial credit memos/invoices
+Fixed SSL is not used for links in email templates when admin area is configured to use HTTPS
+Fixed Incorrect style on product page
+Fixed Error is displayed by editing product or by creating product on back-end in IE8
+Fixed Catalog price rules for composite products changes
+Fixed Moving modules to the correct place
+Fixed Wishlist shows items per store scope, not website
+Fixed Products in Wishlist disappears, when Store View is changed
+Fixed Wrong Comments History in notification of order creation/cancellation
+Fixed In AJAX popup fields "From" and "To" have behavior as mandatory fields
+Fixed Filter by Allow Countries not working for Customer Address Form in the Backend
+Fixed Product price lower than 0 (after catalog price rule applying)
+Fixed Google Checkout throws error if Zip Range is used for Tax Rate
+- changed part of XML request to Google responsible for postal codes
+- made changes to correctly fetch tax rules for postal code ranges
+Fixed Website config object is not being cached
+Fixed Select groups in grid view doesn't work under IE7
+Fixed No products name in Popular tags report file .csv
+Fixed Qty Increments should work when it was defined in the default scope configuration
+Fixed Products in catalog displays as "out of stock"
+Fixed "Get help for this page" in each tab under System->Configuration links to the same help page
+Fixed Unable to translate submenu
+Fixed Redirect to main page of front-end during deleting Product Tax Class which is used in Tax Rule
+Fixed Redirect to base URL should consider full request URI string
+Fixed Incorrect transparency of PNG image in indexed non-alpha mode
+Fixed Problem of generation URL between different domains
+Fixed There are no server side validation of first character of Attribute Code (it should be letter)
+Fixed Edit Order without creating new one functionality saves invalid changes in non-default customer address attributes
+Fixed Frontend: If second customer logs in and does not select the "Remember Me" then the previous long-term cookie does not removes
+Fixed Admin can Reorder order with status On Hold
+Fixed Frontend: After new customer registration with "Remember Me" and pressing "Logout" the long-term cookie session doesn't apply if in configuration on backend ""Remember Me" Default Value" - No
+Fixed Tax not displaying on PayPal side for Express orders
+Fixed Wishlist: Not configured grouped product has unneeded link "Show Details"
+Fixed Removed the ability to work with customise admin url through the parameter base_url
+Fixed Roles not displaying selected resources
+Fixed Unable to use Import when compiler is enabled
+Fixed Missing Translation Capability in Transactional Email Variable
+Fixed productConfigure is undefined error is occurred during creation Order in Backend in IE8 browser
+Fixed Zend Full Page Cache. Lifetime of the cookie is not equal to specified on "Cookie Lifetime" field
+Fixed Incorrect price values for Bundle Product
+Fixed Link does not pass validation if ends with .html
+Fixed Incorrect Customs Value in Create Packages in case when price value contains decimals
+Fixed Incorrect reports with updated_at filter
+Fixed paypal_payment_transaction_clean job takes credentials form default config instead of website for Payflow Link
+Fixed Wrong schedule time setup for paypal_payment_transaction_clean job for Payflow Link
+Fixed Backend Error message "SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'qwe' for key 2" appears after saving new Email Template with existing name
+Fixed Rule Conditions logic
+Fixed Error appears after Customer Group saving with name length more than 32
+Fixed Category product index run time
+Fixed Sidebar cart is missing composite product options on category page
+Fixed Missed validation for space character at the begin of unique fields
+- improved validation of Attribute Set Name and validation of unique fields in Mage_Core_Model_Resource_Db_Abstract class
+Fixed Ability to input uppercase, space, specials symbols in Order Status Code
+Fixed Filter by Allow Countries not working for Customer Address Form in the Backend
+Fixed No ability to create Shipping Label with "plus-four codes" Zip Code (in case with USPS Domestic)
+Fixed Changing language twice -> Error 404
+Fixed The sort order in products page doesn't work
+Fixed When a grouped product with configured price=0 is added to the wishlist and shared, adding the product to the cart leads to 404 error
+Fixed Media Saves Incorrect Cached Config
+- added options that disallow saving cache
+Fixed Bundle Product items shows randomly instead of according to option
+Fixed Unable to place order with Payflow Link if store credit or reward point applied
+Fixed Ajax loader does not appears after click on Verify Card on Payflow Link
+Fixed "Google Checkout - Carrier" in Magento backend as shipping method rather than the actual shipping method chosen
+Fixed JavaScript error appears in checkout because of PSC after press 'Proceed to Checkout'
+Fixed Admin user interface: mistakes in labels names
+Fixed Problems with grid sorting on edit customer backend page
+Fixed It is possible to change the price of the Bundle product from fixed to the dynamic at my store
+Fixed Set special price via Catalog Product API is not working
+Fixed Price is wrong calculated for bundle product with a zero price for its items on product details page
+- subitem price calculation were fixed
+Fixed Layout issue appears in IE9 on the grids (example Customers)
+Fixed Impossible to press 'Continue' button to place in onepage
+Fixed "Add to Wishlist", "Add to Compare" aren't presented for Configurable, bundle, downloadable, simple products on Product Details Page
+Fixed Register during checkout with PayPal Express Checkout
+Fixed Extension Packager does not read recursive directory if include expression use file mask
+Fixed Newsletter Subscription Confirmation Message
+Fixed Discount is wrong calculated for Shopping Cart Price Rules when some of them created with Coupon and another without Coupon
+Fixed Subtotal (Incl.Tax) on invoices must not include tax applied to shipping amount
+- shippingTax amount were excluded from subTotal value
+Fixed "Maximum shipping amount allowed to refund" message shows amount excl. tax if Display Shipping Amount set to Including Tax
+- adjusted function to include tax into allowed amount for shipping refund
+Fixed Display Out of Stock Products must not be considered during admin order creation
+Fixed Check box is not working correctly under "prices" of the Bundle products.
+Fixed CSS class missing
+Fixed Frontend: JavaScript error appears if user registered on Checkout Page
+Fixed Website config object is not being cached
+- added functionality for memcache backend to split down data that is larger than slab size into chunks
+Fixed Removed the ability to work with base_url
+Fixed Custom design should be updated via import functionality
+Fixed JS error during onepage checkout
+Fixed Unable to translate "First name" and "Last name" fields on "Create an Account" page
+Fixed After upgrading dashboard "Top 5 Search Terms" grid doesn't show search terms
+
+
+
==== 1.6.1.0-alpha1 ====
=== Major Highlights ===
diff --git a/app/Mage.php b/app/Mage.php
index 85baa7b0b3..aecdd9e4d8 100644
--- a/app/Mage.php
+++ b/app/Mage.php
@@ -154,7 +154,7 @@ public static function getVersionInfo()
'minor' => '6',
'revision' => '1',
'patch' => '0',
- 'stability' => 'alpha',
+ 'stability' => 'beta',
'number' => '1',
);
}
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 2870c4d476..d379edd75a 100644
--- a/app/code/core/Mage/Api/Model/Server/Handler/Abstract.php
+++ b/app/code/core/Mage/Api/Model/Server/Handler/Abstract.php
@@ -539,4 +539,4 @@ public function globalFaults($sessionId)
$this->_startSession($sessionId);
return array_values($this->_getConfig()->getFaults());
}
-} // Class Mage_Api_Model_Server_Handler_Abstract End
\ No newline at end of file
+} // Class Mage_Api_Model_Server_Handler_Abstract End
diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category.php b/app/code/core/Mage/Catalog/Model/Resource/Category.php
index 1dc5594415..159d2a1351 100755
--- a/app/code/core/Mage/Catalog/Model/Resource/Category.php
+++ b/app/code/core/Mage/Catalog/Model/Resource/Category.php
@@ -881,7 +881,7 @@ protected function _processPositions($category, $newParent, $afterCategoryId)
$select = $adapter->select()
->from($table,array('position' => new Zend_Db_Expr('MIN(' . $positionField. ')')))
->where('parent_id = :parent_id');
- $position = $adapter->fetchOne($select, array('patent_id' => $newParent->getId()));
+ $position = $adapter->fetchOne($select, array('parent_id' => $newParent->getId()));
}
$position += 1;
diff --git a/app/code/core/Mage/Catalog/etc/system.xml b/app/code/core/Mage/Catalog/etc/system.xml
index a9abce4ebd..4cbacb4a7d 100644
--- a/app/code/core/Mage/Catalog/etc/system.xml
+++ b/app/code/core/Mage/Catalog/etc/system.xml
@@ -243,7 +243,7 @@
1
-
+
selectadminhtml/system_config_source_yesno5
diff --git a/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php b/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php
index f9401062c9..8088314f3a 100644
--- a/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php
+++ b/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php
@@ -840,6 +840,16 @@ public function setProduct($product)
return $this;
}
+ /**
+ * Returns product instance
+ *
+ * @return Mage_Catalog_Model_Product|null
+ */
+ public function getProduct()
+ {
+ return $this->_productInstance ? $this->_productInstance : $this->_getData('product');
+ }
+
/**
* Retrieve stock qty whether product is composite or no
*
diff --git a/app/code/core/Mage/Centinel/Model/State/Visa.php b/app/code/core/Mage/Centinel/Model/State/Visa.php
index 2126ff4138..e4f2b51a0d 100644
--- a/app/code/core/Mage/Centinel/Model/State/Visa.php
+++ b/app/code/core/Mage/Centinel/Model/State/Visa.php
@@ -95,7 +95,7 @@ public function isAuthenticateSuccessful()
}
//Test case 11
- if ($paResStatus == '' && $signatureVerification == '' && $eciFlag == '07' &&
+ if ($paResStatus == 'U' && $signatureVerification == '' && $eciFlag == '07' &&
$xid == '' && $cavv == '' && $errorNo == '1050') {
if ($this->getIsModeStrict()) {
return false;
diff --git a/app/code/core/Mage/Centinel/controllers/Adminhtml/Centinel/IndexController.php b/app/code/core/Mage/Centinel/controllers/Adminhtml/Centinel/IndexController.php
index fcc5769d85..f75f2d2542 100644
--- a/app/code/core/Mage/Centinel/controllers/Adminhtml/Centinel/IndexController.php
+++ b/app/code/core/Mage/Centinel/controllers/Adminhtml/Centinel/IndexController.php
@@ -27,6 +27,9 @@
/**
* Centinel Index Controller
*
+ * @category Mage
+ * @package Mage_Centinel
+ * @author Magento Core Team
*/
class Mage_Centinel_Adminhtml_Centinel_IndexController extends Mage_Adminhtml_Controller_Action
{
@@ -43,12 +46,9 @@ public function validatePaymentDataAction()
if (!$validator) {
throw new Exception('This payment method does not have centinel validation.');
}
+ $validator->reset();
$this->_getPayment()->importData($paymentData);
- if ($validator->shouldAuthenticate()) {
- $result['authenticationUrl'] = $validator->getAuthenticationStartUrl();
- } else {
- Mage::throwException(Mage::helper('centinel')->__('This card has failed validation, but it is possible to place the order.'));
- }
+ $result['authenticationUrl'] = $validator->getAuthenticationStartUrl();
} catch (Mage_Core_Exception $e) {
$result['message'] = $e->getMessage();
} catch (Exception $e) {
diff --git a/app/code/core/Mage/Checkout/Model/Type/Multishipping.php b/app/code/core/Mage/Checkout/Model/Type/Multishipping.php
index eabe75b163..c0e19702c0 100644
--- a/app/code/core/Mage/Checkout/Model/Type/Multishipping.php
+++ b/app/code/core/Mage/Checkout/Model/Type/Multishipping.php
@@ -241,7 +241,10 @@ public function setShippingItemsInformation($info)
* MultishippingQty should be defined for each quote item when it processed with _addShippingItem
*/
foreach ($quote->getAllItems() as $_item) {
- if (!$_item->getProduct()->getIsVirtual() && !$_item->getParentItem() && !$_item->getMultishippingQty()) {
+ if (!$_item->getProduct()->getIsVirtual() &&
+ !$_item->getParentItem() &&
+ !$_item->getMultishippingQty()
+ ) {
$_item->delete();
}
}
@@ -419,6 +422,7 @@ protected function _prepareOrder(Mage_Sales_Model_Quote_Address $address)
$convertQuote = Mage::getSingleton('sales/convert_quote');
$order = $convertQuote->addressToOrder($address);
+ $order->setQuote($quote);
$order->setBillingAddress(
$convertQuote->addressToOrderAddress($quote->getBillingAddress())
);
@@ -435,11 +439,14 @@ protected function _prepareOrder(Mage_Sales_Model_Quote_Address $address)
}
foreach ($address->getAllItems() as $item) {
- if (! $item->getQuoteItem()) {
+ $_quoteItem = $item->getQuoteItem();
+ if (!$_quoteItem) {
throw new Mage_Checkout_Exception(Mage::helper('checkout')->__('Item not found or already ordered'));
}
- $item->setProductType($item->getQuoteItem()->getProductType())
- ->setProductOptions($item->getQuoteItem()->getProduct()->getTypeInstance(true)->getOrderOptions($item->getQuoteItem()->getProduct()));
+ $item->setProductType($_quoteItem->getProductType())
+ ->setProductOptions(
+ $_quoteItem->getProduct()->getTypeInstance(true)->getOrderOptions($_quoteItem->getProduct())
+ );
$orderItem = $convertQuote->itemToOrderItem($item);
if ($item->getParentItem()) {
$orderItem->setParentItem($order->getItemByQuoteItemId($item->getParentItem()->getId()));
diff --git a/app/code/core/Mage/Core/Model/Resource/Store/Group/Collection.php b/app/code/core/Mage/Core/Model/Resource/Store/Group/Collection.php
index 8d76c4672d..d046909fc8 100644
--- a/app/code/core/Mage/Core/Model/Resource/Store/Group/Collection.php
+++ b/app/code/core/Mage/Core/Model/Resource/Store/Group/Collection.php
@@ -98,7 +98,7 @@ public function _beforeLoad()
$this->setWithoutDefaultFilter();
}
$this->addOrder('main_table.name', self::SORT_ORDER_ASC);
- return $this;
+ return parent::_beforeLoad();
}
/**
diff --git a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option.php b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option.php
index 192d1cdd06..114644f621 100755
--- a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option.php
+++ b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option.php
@@ -94,38 +94,31 @@ public function getFlatUpdateSelect(Mage_Eav_Model_Entity_Attribute_Abstract $at
$attributeCode = $attribute->getAttributeCode();
$joinConditionTemplate = "%s.entity_id = %s.entity_id"
- ." AND %s.entity_type_id = ".$attribute->getEntityTypeId()
- ." AND %s.attribute_id = ".$attribute->getId()
- ." AND %s.store_id = %d";
- $joinCondition = sprintf($joinConditionTemplate,
- 'e', 't1', 't1', 't1', 't1',
+ . " AND %s.entity_type_id = " . $attribute->getEntityTypeId()
+ . " AND %s.attribute_id = " . $attribute->getId()
+ . " AND %s.store_id = %d";
+ $joinCondition = sprintf($joinConditionTemplate, 'e', 't1', 't1', 't1', 't1',
Mage_Core_Model_App::ADMIN_STORE_ID);
if ($attribute->getFlatAddChildData()) {
$joinCondition .= ' AND e.child_id = t1.entity_id';
}
- $valueExpr = $adapter->getCheckSql('t2.value_id > 0', 't2.value', 't1.value');
+ $valueExpr = $adapter->getCheckSql('t2.value_id > 0', 't2.value', 't1.value');
/** @var $select Varien_Db_Select */
- $select = $adapter->select()
- ->joinLeft(
- array('t1' => $attributeTable),
- $joinCondition,
- array())
- ->joinLeft(
- array('t2' => $attributeTable),
+ $select = $adapter->select()
+ ->joinLeft(array('t1' => $attributeTable), $joinCondition, array())
+ ->joinLeft(array('t2' => $attributeTable),
sprintf($joinConditionTemplate, 't1', 't2', 't2', 't2', 't2', $store),
array($attributeCode => $valueExpr));
+
if (($attribute->getFrontend()->getInputType() != 'multiselect') && $hasValueField) {
- $valueIdExpr = $adapter->getCheckSql('to2.value_id > 0', 'to1.value', 'to2.value');
- $select->joinLeft(
- array('to1' => $this->getTable('eav/attribute_option_value')),
- "to1.option_id = {$valueExpr} AND to1.store_id = 0",
- array())
- ->joinLeft(
- array('to2' => $this->getTable('eav/attribute_option_value')),
- $adapter->quoteInto("to2.option_id = {$valueExpr} AND to2.store_id = ?", $store),
- array($attributeCode . '_value' => $valueIdExpr)
- );
+ $valueIdExpr = $adapter->getCheckSql('to2.value_id > 0', 'to2.value', 'to1.value');
+ $select
+ ->joinLeft(array('to1' => $this->getTable('eav/attribute_option_value')),
+ "to1.option_id = {$valueExpr} AND to1.store_id = 0", array())
+ ->joinLeft(array('to2' => $this->getTable('eav/attribute_option_value')),
+ $adapter->quoteInto("to2.option_id = {$valueExpr} AND to2.store_id = ?", $store),
+ array($attributeCode . '_value' => $valueIdExpr));
}
if ($attribute->getFlatAddChildData()) {
diff --git a/app/code/core/Mage/Paypal/Model/Payflowlink.php b/app/code/core/Mage/Paypal/Model/Payflowlink.php
index fe6180483b..396796c981 100644
--- a/app/code/core/Mage/Paypal/Model/Payflowlink.php
+++ b/app/code/core/Mage/Paypal/Model/Payflowlink.php
@@ -145,6 +145,20 @@ public function initialize($paymentAction, $stateObject)
return $this;
}
+ /**
+ * Add transaction with correct transaction Id
+ *
+ * @param Varien_Object $payment
+ * @param string $txnId
+ * @return void
+ */
+ protected function _addTransaction($payment, $txnId)
+ {
+ $previousTxnId = $payment->getTransactionId();
+ $payment->setTransactionId($txnId);
+ $payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH);
+ $payment->setTransactionId($previousTxnId);
+ }
/**
* Initialize request
*
@@ -181,6 +195,12 @@ public function authorize(Varien_Object $payment, $amount)
$payment->setIsFraudDetected(true);
}
+ if ($transaction->getId() && $payment->getAdditionalInformation('authorization_amount') !=
+ Mage_Paypal_Model_Config::AUTHORIZATION_AMOUNT_FULL
+ ) {
+ $this->_addTransaction($payment, $txnId);
+ }
+
$this->_authorize($payment, $amount, $transaction, $txnId);
if ($payment->getAdditionalInformation('authorization_amount') !=
Mage_Paypal_Model_Config::AUTHORIZATION_AMOUNT_FULL
@@ -190,7 +210,6 @@ public function authorize(Varien_Object $payment, $amount)
if ($payment->getTransactionId()) {
$payment->setAdditionalInformation('authorization_id', $payment->getTransactionId());
}
-
}
$transaction->delete();
@@ -237,6 +256,9 @@ public function capture(Varien_Object $payment, $amount)
$payment->setTransactionId($txnId);
$payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH);
$this->_authorize($payment, $amount, $transaction, $txnId);
+
+ $this->_addTransaction($payment, $txnId);
+
$payment->setReferenceTransactionId($payment->getAdditionalInformation('authorization_id'));
}
diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/Grid.php b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/Grid.php
index 1d1e06c679..7819615365 100644
--- a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/Grid.php
+++ b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/Grid.php
@@ -133,7 +133,7 @@ protected function _prepareColumns()
$this->addColumn('created_at', array(
'header' => Mage::helper('sales')->__('Created At'),
- 'index' => 'created_at',
+ 'index' => 'agreement_created_at',
'width' => 1,
'type' => 'datetime',
'align' => 'center',
@@ -143,7 +143,7 @@ protected function _prepareColumns()
$this->addColumn('updated_at', array(
'header' => Mage::helper('sales')->__('Updated At'),
- 'index' => 'updated_at',
+ 'index' => 'agreement_updated_at',
'width' => 1,
'type' => 'datetime',
'align' => 'center',
diff --git a/app/code/core/Mage/Sales/Model/Convert/Quote.php b/app/code/core/Mage/Sales/Model/Convert/Quote.php
index c21886522e..414d45f67b 100644
--- a/app/code/core/Mage/Sales/Model/Convert/Quote.php
+++ b/app/code/core/Mage/Sales/Model/Convert/Quote.php
@@ -50,6 +50,7 @@ public function toOrder(Mage_Sales_Model_Quote $quote, $order=null)
$order->setIncrementId($quote->getReservedOrderId())
->setStoreId($quote->getStoreId())
->setQuoteId($quote->getId())
+ ->setQuote($quote)
->setCustomer($quote->getCustomer());
Mage::helper('core')->copyFieldset('sales_convert_quote', 'to_order', $quote, $order);
diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Shipping.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Shipping.php
index 927b9e0415..28a0b9a8c8 100644
--- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Shipping.php
+++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Shipping.php
@@ -33,12 +33,6 @@
*/
class Mage_Sales_Model_Order_Creditmemo_Total_Shipping extends Mage_Sales_Model_Order_Creditmemo_Total_Abstract
{
- /**
- * Collects information about shipping charges
- *
- * @param Mage_Sales_Model_Order_Creditmemo $creditmemo Credit Memo object
- * @return Mage_Sales_Model_Order_Creditmemo_Total_Shipping
- */
public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
{
$order = $creditmemo->getOrder();
@@ -52,12 +46,6 @@ public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
$isShippingInclTax = Mage::getSingleton('tax/config')->displaySalesShippingInclTax($order->getStoreId());
- if ($baseShipping != 0) {
- $baseAllowedTaxAmount = $order->getBaseShippingTaxAmount() - $order->getBaseShippingTaxRefunded();
- $baseShippingInclTax = Mage::app()->getStore()->roundPrice($baseAllowedAmount + $baseAllowedTaxAmount);
- }
- $baseAllowedAmount = $baseShippingInclTax - $order->getBaseShippingRefunded();
-
/**
* Check if shipping amount was specified (from invoice or another source).
* Using has magic method to allow setting 0 as shipping amount.
@@ -100,7 +88,10 @@ public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
} else {
if ($baseShipping != 0) {
$allowedTaxAmount = $order->getShippingTaxAmount() - $order->getShippingTaxRefunded();
+ $baseAllowedTaxAmount = $order->getBaseShippingTaxAmount() - $order->getBaseShippingTaxRefunded();
+
$shippingInclTax = Mage::app()->getStore()->roundPrice($allowedAmount + $allowedTaxAmount);
+ $baseShippingInclTax = Mage::app()->getStore()->roundPrice($baseAllowedAmount + $baseAllowedTaxAmount);
}
$shipping = $allowedAmount;
$baseShipping = $baseAllowedAmount;
diff --git a/app/code/core/Mage/Sales/Model/Resource/Billing/Agreement/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Billing/Agreement/Collection.php
index af10bcdb7a..89b3b107a5 100755
--- a/app/code/core/Mage/Sales/Model/Resource/Billing/Agreement/Collection.php
+++ b/app/code/core/Mage/Sales/Model/Resource/Billing/Agreement/Collection.php
@@ -40,9 +40,11 @@ class Mage_Sales_Model_Resource_Billing_Agreement_Collection extends Mage_Core_M
* @var array
*/
protected $_map = array('fields' => array(
- 'customer_email' => 'ce.email',
- 'customer_firstname' => 'firstname.value',
- 'customer_lastname' => 'lastname.value'
+ 'customer_email' => 'ce.email',
+ 'customer_firstname' => 'firstname.value',
+ 'customer_lastname' => 'lastname.value',
+ 'agreement_created_at' => 'main_table.created_at',
+ 'agreement_updated_at' => 'main_table.updated_at',
));
/**
diff --git a/app/code/core/Mage/Sales/controllers/DownloadController.php b/app/code/core/Mage/Sales/controllers/DownloadController.php
index e99ac342b2..c242a4afd8 100644
--- a/app/code/core/Mage/Sales/controllers/DownloadController.php
+++ b/app/code/core/Mage/Sales/controllers/DownloadController.php
@@ -113,6 +113,12 @@ public function downloadProfileCustomOptionAction()
$orderItemInfo = $recurringProfile->getData('order_item_info');
try {
$request = unserialize($orderItemInfo['info_buyRequest']);
+
+ if ($request['product'] != $orderItemInfo['product_id']) {
+ $this->_forward('noRoute');
+ return;
+ }
+
$optionId = $this->getRequest()->getParam('option_id');
if (!isset($request['options'][$optionId])) {
$this->_forward('noRoute');
diff --git a/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate.php b/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate.php
index 2487df987a..60e78c47d7 100755
--- a/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate.php
+++ b/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate.php
@@ -111,43 +111,49 @@ protected function _construct()
* Return table rate array or false by rate request
*
* @param Mage_Shipping_Model_Rate_Request $request
- * @return array
+ * @return array|boolean
*/
public function getRate(Mage_Shipping_Model_Rate_Request $request)
{
$adapter = $this->_getReadAdapter();
- $bind = array(
- ':website_id' => (int)$request->getWebsiteId(),
- ':country_id' => $request->getDestCountryId(),
- ':region_id' => (int)$request->getDestRegionId(),
- ':postcode' => $request->getDestPostcode()
+ $bind = array(
+ ':website_id' => (int) $request->getWebsiteId(),
+ ':country_id' => $request->getDestCountryId(),
+ ':region_id' => (int) $request->getDestRegionId(),
+ ':postcode' => $request->getDestPostcode()
);
- $select = $adapter->select()
+ $select = $adapter->select()
->from($this->getMainTable())
->where('website_id = :website_id')
->order(array('dest_country_id DESC', 'dest_region_id DESC', 'dest_zip DESC'))
->limit(1);
- // render destination condition
+ // Render destination condition
$orWhere = '(' . implode(') OR (', array(
"dest_country_id = :country_id AND dest_region_id = :region_id AND dest_zip = :postcode",
"dest_country_id = :country_id AND dest_region_id = :region_id AND dest_zip = ''",
+
+ // Handle asterix in dest_zip field
+ "dest_country_id = :country_id AND dest_region_id = :region_id AND dest_zip = '*'",
+ "dest_country_id = :country_id AND dest_region_id = 0 AND dest_zip = '*'",
+ "dest_country_id = '0' AND dest_region_id = :region_id AND dest_zip = '*'",
+ "dest_country_id = '0' AND dest_region_id = 0 AND dest_zip = '*'",
+
"dest_country_id = :country_id AND dest_region_id = 0 AND dest_zip = ''",
"dest_country_id = :country_id AND dest_region_id = 0 AND dest_zip = :postcode",
"dest_country_id = :country_id AND dest_region_id = 0 AND dest_zip = '*'",
- "dest_country_id = '0' AND dest_region_id = 0 AND dest_zip = '*'",
)) . ')';
$select->where($orWhere);
- // render condition by condition name
+ // Render condition by condition name
if (is_array($request->getConditionName())) {
$orWhere = array();
- $i = 0;
+ $i = 0;
foreach ($request->getConditionName() as $conditionName) {
$bindNameKey = sprintf(':condition_name_%d', $i);
$bindValueKey = sprintf(':condition_value_%d', $i);
$orWhere[] = "(condition_name = {$bindNameKey} AND condition_value <= {$bindValueKey})";
- $bind[$bindNameKey] = $conditionName;
+ $bind[$bindNameKey] = $conditionName;
$bind[$bindValueKey] = $request->getData($conditionName);
$i++;
}
@@ -164,7 +170,7 @@ public function getRate(Mage_Shipping_Model_Rate_Request $request)
}
$result = $adapter->fetchRow($select, $bind);
- // normalize destination zip code
+ // Normalize destination zip code
if ($result && $result['dest_zip'] == '*') {
$result['dest_zip'] = '';
}
diff --git a/app/code/core/Mage/Tax/Model/Observer.php b/app/code/core/Mage/Tax/Model/Observer.php
index aa51507e84..572149d2bf 100644
--- a/app/code/core/Mage/Tax/Model/Observer.php
+++ b/app/code/core/Mage/Tax/Model/Observer.php
@@ -102,11 +102,14 @@ public function salesEventOrderAfterSave(Varien_Event_Observer $observer)
$result = Mage::getModel('tax/sales_order_tax')->setData($data)->save();
if (isset($ratesIdQuoteItemId[$id])) {
foreach ($ratesIdQuoteItemId[$id] as $quoteItemId) {
- $data = array(
- 'item_id' => $order->getItemByQuoteItemId($quoteItemId)->getId(),
- 'tax_id' => $result->getTaxId()
- );
- Mage::getModel('tax/sales_order_tax_item')->setData($data)->save();
+ $item = $order->getItemByQuoteItemId($quoteItemId);
+ if ($item) {
+ $data = array(
+ 'item_id' => $item->getId(),
+ 'tax_id' => $result->getTaxId()
+ );
+ Mage::getModel('tax/sales_order_tax_item')->setData($data)->save();
+ }
}
}
}
diff --git a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Tax.php b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Tax.php
index b6292154fe..29e785c99b 100644
--- a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Tax.php
+++ b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Tax.php
@@ -568,7 +568,11 @@ protected function _totalBaseCalculation(Mage_Sales_Model_Quote_Address $address
}
}
+ if ($address->getQuote()->getTaxesForItems()) {
+ $itemTaxGroups += $address->getQuote()->getTaxesForItems();
+ }
$address->getQuote()->setTaxesForItems($itemTaxGroups);
+
foreach ($taxGroups as $rateKey => $data) {
$rate = (float) $rateKey;
$totalTax = $this->_calculator->calcTaxAmount(array_sum($data['totals']), $rate, $inclTax);
diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php
index 8166cb4f9a..2b9dbc73e0 100644
--- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php
+++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php
@@ -704,6 +704,11 @@ public function getCode($type, $code='')
'STANDARD_OVERNIGHT',
'PRIORITY_OVERNIGHT',
'FIRST_OVERNIGHT',
+ 'FEDEX_FREIGHT',
+ 'FEDEX_1_DAY_FREIGHT',
+ 'FEDEX_2_DAY_FREIGHT',
+ 'FEDEX_3_DAY_FREIGHT',
+ 'FEDEX_NATIONAL_FREIGHT',
)
),
'from_us' => array(
@@ -712,6 +717,13 @@ public function getCode($type, $code='')
'INTERNATIONAL_ECONOMY',
'INTERNATIONAL_PRIORITY',
'INTERNATIONAL_GROUND',
+ 'FEDEX_FREIGHT',
+ 'FEDEX_1_DAY_FREIGHT',
+ 'FEDEX_2_DAY_FREIGHT',
+ 'FEDEX_3_DAY_FREIGHT',
+ 'FEDEX_NATIONAL_FREIGHT',
+ 'INTERNATIONAL_ECONOMY_FREIGHT',
+ 'INTERNATIONAL_PRIORITY_FREIGHT',
)
)
)
diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php
index 1f884d9a72..3819a2e6c8 100644
--- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php
+++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php
@@ -739,6 +739,7 @@ public function getCode($type, $code='')
'14', // Next Day Air Early AM
'02', // 2nd Day Air
'59', // 2nd Day Air AM
+ '13', // Next Day Air Saver
)
),
'from_us' => array(
@@ -1696,10 +1697,22 @@ public function getContainerTypes(Varien_Object $params = null)
$containerTypes = $containerTypes + array(
'03' => Mage::helper('usa')->__('UPS Tube'),
'04' => Mage::helper('usa')->__('PAK'),
- '21' => Mage::helper('usa')->__('UPS Express Box'),
+ '2a' => Mage::helper('usa')->__('Small Express Box'),
+ '2b' => Mage::helper('usa')->__('Medium Express Box'),
+ '2c' => Mage::helper('usa')->__('Large Express Box'),
);
}
return array('00' => Mage::helper('usa')->__('Customer Packaging')) + $containerTypes;
+ } elseif ($countryShipper == self::USA_COUNTRY_ID && $countryRecipient == self::PUERTORICO_COUNTRY_ID
+ && ($method == '03' // UPS Ground
+ || $method == '02' // UPS Second Day Air
+ || $method == '01' // UPS Next Day Air
+ )) {
+ // Container types should be the same as for domestic
+ $params->setCountryRecipient(self::USA_COUNTRY_ID);
+ $containerTypes = $this->_getAllowedContainers($params);
+ $params->setCountryRecipient($countryRecipient);
+ return $containerTypes;
}
return $this->_getAllowedContainers($params);
}
diff --git a/app/design/adminhtml/default/default/template/promo/js.phtml b/app/design/adminhtml/default/default/template/promo/js.phtml
index 92551760ca..53fefdb79f 100644
--- a/app/design/adminhtml/default/default/template/promo/js.phtml
+++ b/app/design/adminhtml/default/default/template/promo/js.phtml
@@ -33,9 +33,11 @@ function hideShowSubproductOptions(enabler)
if (enabler.value == 1) {
$('rule_sub_simple_action').parentNode.parentNode.show();
$('rule_sub_discount_amount').parentNode.parentNode.show();
+ $('rule_sub_discount_amount').addClassName('required-entry validate-not-negative-number');
} else {
$('rule_sub_simple_action').parentNode.parentNode.hide();
$('rule_sub_discount_amount').parentNode.parentNode.hide();
+ $('rule_sub_discount_amount').removeClassName('required-entry').removeClassName('validate-not-negative-number');
}
}
//]]>
diff --git a/app/design/frontend/base/default/template/checkout/onepage/payment/methods.phtml b/app/design/frontend/base/default/template/checkout/onepage/payment/methods.phtml
index 97c8063ee2..9cf2e1d693 100644
--- a/app/design/frontend/base/default/template/checkout/onepage/payment/methods.phtml
+++ b/app/design/frontend/base/default/template/checkout/onepage/payment/methods.phtml
@@ -32,12 +32,20 @@
*/
?>