diff --git a/app/code/Magento/Checkout/Block/Cart/LayoutProcessor.php b/app/code/Magento/Checkout/Block/Cart/LayoutProcessor.php index c9b60879c9dfe345ebe3cda5bd2c3353c80c3dea..04b0ac10be1a3ce66b808fc3ffee32196287f88d 100644 --- a/app/code/Magento/Checkout/Block/Cart/LayoutProcessor.php +++ b/app/code/Magento/Checkout/Block/Cart/LayoutProcessor.php @@ -85,7 +85,7 @@ class LayoutProcessor implements \Magento\Checkout\Block\Checkout\LayoutProcesso 'visible' => true, 'formElement' => 'select', 'label' => __('Country'), - 'options' => $this->countryCollection->load()->toOptionArray(), + 'options' => $this->countryCollection->loadByStore()->toOptionArray(), 'value' => null ], 'region_id' => [ diff --git a/app/code/Magento/Checkout/Model/ShippingInformationManagement.php b/app/code/Magento/Checkout/Model/ShippingInformationManagement.php index 260e04335a8d2c868cb5bd046c7d7e707642c996..f87be9fc75672394cba39f49c13ad6759e3462a2 100644 --- a/app/code/Magento/Checkout/Model/ShippingInformationManagement.php +++ b/app/code/Magento/Checkout/Model/ShippingInformationManagement.php @@ -117,6 +117,7 @@ class ShippingInformationManagement implements \Magento\Checkout\Api\ShippingInf /** @var \Magento\Quote\Model\Quote $quote */ $quote = $this->quoteRepository->getActive($cartId); $this->validateQuote($quote); + $quote->setIsMultiShipping(false); $saveInAddressBook = $address->getSaveInAddressBook() ? 1 : 0; $sameAsBilling = $address->getSameAsBilling() ? 1 : 0; diff --git a/app/code/Magento/Checkout/Test/Unit/Block/Cart/LayoutProcessorTest.php b/app/code/Magento/Checkout/Test/Unit/Block/Cart/LayoutProcessorTest.php index 774fe8f1a56b4604edd18242b44eaa870d743607..6d79a98183a7d093a15a2a4936018355e266bedc 100644 --- a/app/code/Magento/Checkout/Test/Unit/Block/Cart/LayoutProcessorTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Block/Cart/LayoutProcessorTest.php @@ -66,7 +66,7 @@ class LayoutProcessorTest extends \PHPUnit_Framework_TestCase $layoutPointer = &$layout['components']['block-summary']['children']['block-shipping'] ['children']['address-fieldsets']['children']; - $this->countryCollection->expects($this->once())->method('load')->willReturnSelf(); + $this->countryCollection->expects($this->once())->method('loadByStore')->willReturnSelf(); $this->countryCollection->expects($this->once())->method('toOptionArray')->willReturn($countries); $this->regionCollection->expects($this->once())->method('load')->willReturnSelf(); diff --git a/app/code/Magento/Checkout/Test/Unit/Model/ShippingInformationManagementTest.php b/app/code/Magento/Checkout/Test/Unit/Model/ShippingInformationManagementTest.php index 19fb868580e17ebaa070224509f1b01c7d4e8ac0..606d5c51fe68ea2f1c9a0a3204b7bfd15d4884f1 100644 --- a/app/code/Magento/Checkout/Test/Unit/Model/ShippingInformationManagementTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Model/ShippingInformationManagementTest.php @@ -130,6 +130,7 @@ class ShippingInformationManagementTest extends \PHPUnit_Framework_TestCase 'isVirtual', 'getItemsCount', 'getIsMultiShipping', + 'setIsMultiShipping', 'validateMinimumAmount', 'getStoreId', 'setShippingAddress', @@ -423,6 +424,7 @@ class ShippingInformationManagementTest extends \PHPUnit_Framework_TestCase $this->quoteMock->expects($this->once())->method('isVirtual')->willReturn(false); $this->quoteMock->expects($this->once())->method('getItemsCount')->willReturn(5); $this->quoteMock->expects($this->once())->method('getIsMultiShipping')->willReturn(true); + $this->quoteMock->expects($this->once())->method('setIsMultiShipping')->with(false)->willReturnSelf(); $this->quoteMock->expects($this->once())->method('validateMinimumAmount')->with(true)->willReturn(false); $this->quoteMock->expects($this->once())->method('getStoreId')->willReturn($storeId); @@ -507,6 +509,7 @@ class ShippingInformationManagementTest extends \PHPUnit_Framework_TestCase $this->quoteMock->expects($this->once())->method('isVirtual')->willReturn(false); $this->quoteMock->expects($this->once())->method('getItemsCount')->willReturn(5); $this->quoteMock->expects($this->once())->method('getIsMultiShipping')->willReturn(true); + $this->quoteMock->expects($this->once())->method('setIsMultiShipping')->with(false)->willReturnSelf(); $this->quoteMock->expects($this->once())->method('validateMinimumAmount')->with(true)->willReturn(true); $this->quoteMock->expects($this->once())->method('collectTotals')->willReturnSelf(); @@ -587,6 +590,7 @@ class ShippingInformationManagementTest extends \PHPUnit_Framework_TestCase $this->quoteMock->expects($this->once())->method('isVirtual')->willReturn(false); $this->quoteMock->expects($this->once())->method('getItemsCount')->willReturn(5); $this->quoteMock->expects($this->once())->method('getIsMultiShipping')->willReturn(true); + $this->quoteMock->expects($this->once())->method('setIsMultiShipping')->with(false)->willReturnSelf(); $this->quoteMock->expects($this->once())->method('validateMinimumAmount')->with(true)->willReturn(true); $this->quoteMock->expects($this->once())->method('collectTotals')->willReturnSelf(); diff --git a/app/code/Magento/Checkout/view/frontend/web/js/sidebar.js b/app/code/Magento/Checkout/view/frontend/web/js/sidebar.js index ab0116ee968bcf74262fb88bc1599848c64e76f1..9322100b6417b54d2b9aa7a176204962515556d6 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/sidebar.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/sidebar.js @@ -5,14 +5,15 @@ /*jshint browser:true jquery:true*/ /*global confirm:true*/ define([ - "jquery", + 'jquery', 'Magento_Customer/js/model/authentication-popup', 'Magento_Customer/js/customer-data', 'Magento_Ui/js/modal/alert', 'Magento_Ui/js/modal/confirm', - "jquery/ui", - "mage/decorate" -], function($, authenticationPopup, customerData, alert, confirm){ + 'jquery/ui', + 'mage/decorate', + 'mage/collapsible' +], function ($, authenticationPopup, customerData, alert, confirm) { $.widget('mage.sidebar', { options: { @@ -44,11 +45,11 @@ define([ this.element.decorate('list', this.options.isRecursive); - events['click ' + this.options.button.close] = function(event) { + events['click ' + this.options.button.close] = function (event) { event.stopPropagation(); $(self.options.targetElement).dropdownDialog("close"); }; - events['click ' + this.options.button.checkout] = $.proxy(function() { + events['click ' + this.options.button.checkout] = $.proxy(function () { var cart = customerData.get('cart'), customer = customerData.get('customer'); @@ -109,9 +110,9 @@ define([ } }, - _showItemButton: function(elem) { - var itemId = elem.data('cart-item'); - var itemQty = elem.data('item-qty'); + _showItemButton: function (elem) { + var itemId = elem.data('cart-item'), + itemQty = elem.data('item-qty'); if (this._isValidQty(itemQty, elem.val())) { $('#update-cart-item-' + itemId).show('fade', 300); } else if (elem.val() == 0) { @@ -197,10 +198,10 @@ define([ type: 'post', dataType: 'json', context: this, - beforeSend: function() { + beforeSend: function () { elem.attr('disabled', 'disabled'); }, - complete: function() { + complete: function () { elem.attr('disabled', null); } }) @@ -226,13 +227,14 @@ define([ * * @private */ - _calcHeight: function() { + _calcHeight: function () { var self = this, height = 0, counter = this.options.maxItemsVisible, target = $(this.options.minicart.list); target.children().each(function () { + $(this).collapsible(); var outerHeight = $(this).outerHeight(); if (counter-- > 0) { diff --git a/app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html b/app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html index 9aedd4e7ffeebb46fbf852252537e59aea1bae6d..e140ebf6d82bdec1843ddaf521bd55ce06d34530 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html @@ -41,10 +41,10 @@ <!-- ko foreach: { data: options, as: 'option' } --> <dt class="label"><!-- ko text: option.label --><!-- /ko --></dt> <dd class="values"> - <!-- ko if: Array.isArray(option) --> + <!-- ko if: Array.isArray(option.value) --> <span data-bind="html: option.value.join('<br>')"></span> <!-- /ko --> - <!-- ko ifnot: Array.isArray(option) --> + <!-- ko ifnot: Array.isArray(option.value) --> <span data-bind="html: option.value"></span> <!-- /ko --> </dd>