From 7db64f3f14c15b440d3d887f1e0fab01a0dd0c39 Mon Sep 17 00:00:00 2001 From: Stanislav Idolov Date: Fri, 19 Dec 2014 16:30:40 +0200 Subject: [PATCH 01/90] MAGETWO-31960: Introduce Checkout Api interfaces --- .../Api/BillingAddressManagementInterface.php | 30 +++ .../Api/CartItemRepositoryInterface.php | 57 ++++++ .../Checkout/Api/CartManagementInterface.php | 79 ++++++++ .../Checkout/Api/CartRepositoryInterface.php | 27 +++ .../Api/CartTotalRepositoryInterface.php | 18 ++ .../Checkout/Api/Data/AddressInterface.php | 131 +++++++++++++ .../Checkout/Api/Data/CartInterface.php | 139 ++++++++++++++ .../Checkout/Api/Data/CartItemInterface.php | 61 +++++++ .../Api/Data/CartSearchResultsInterface.php | 15 ++ .../Checkout/Api/Data/CurrencyInterface.php | 67 +++++++ .../Checkout/Api/Data/CustomerInterface.php | 117 ++++++++++++ .../Api/Data/PaymentMethodInterface.php | 67 +++++++ .../Api/Data/ShippingMethodInterface.php | 60 ++++++ .../Checkout/Api/Data/TotalsInterface.php | 172 ++++++++++++++++++ .../Checkout/Api/Data/TotalsItemInterface.php | 123 +++++++++++++ .../Api/PaymentMethodManagementInterface.php | 40 ++++ .../ShippingAddressManagementInterface.php | 30 +++ .../Api/ShippingMethodManagementInterface.php | 45 +++++ .../Address/Billing/ReadServiceInterface.php | 2 + .../Address/Billing/WriteServiceInterface.php | 2 + .../Address/Shipping/ReadServiceInterface.php | 2 + .../Shipping/WriteServiceInterface.php | 2 + .../Service/V1/Cart/ReadServiceInterface.php | 6 + .../V1/Cart/TotalsServiceInterface.php | 2 + .../Service/V1/Cart/WriteServiceInterface.php | 5 + .../V1/Coupon/ReadServiceInterface.php | 2 + .../V1/Coupon/WriteServiceInterface.php | 3 + .../Checkout/Service/V1/Data/Cart/Coupon.php | 2 + .../Checkout/Service/V1/Data/Cart/Item.php | 1 + .../Checkout/Service/V1/Data/Cart/Totals.php | 2 + .../Service/V1/Data/Cart/Totals/Item.php | 2 + .../Service/V1/Item/ReadServiceInterface.php | 1 + .../Service/V1/Item/WriteServiceInterface.php | 3 + .../V1/PaymentMethod/ReadServiceInterface.php | 4 + .../PaymentMethod/WriteServiceInterface.php | 2 + .../ShippingMethod/ReadServiceInterface.php | 4 + .../ShippingMethod/WriteServiceInterface.php | 2 + 37 files changed, 1327 insertions(+) create mode 100644 app/code/Magento/Checkout/Api/BillingAddressManagementInterface.php create mode 100644 app/code/Magento/Checkout/Api/CartItemRepositoryInterface.php create mode 100644 app/code/Magento/Checkout/Api/CartManagementInterface.php create mode 100644 app/code/Magento/Checkout/Api/CartRepositoryInterface.php create mode 100644 app/code/Magento/Checkout/Api/CartTotalRepositoryInterface.php create mode 100644 app/code/Magento/Checkout/Api/Data/AddressInterface.php create mode 100644 app/code/Magento/Checkout/Api/Data/CartInterface.php create mode 100644 app/code/Magento/Checkout/Api/Data/CartItemInterface.php create mode 100644 app/code/Magento/Checkout/Api/Data/CartSearchResultsInterface.php create mode 100644 app/code/Magento/Checkout/Api/Data/CurrencyInterface.php create mode 100644 app/code/Magento/Checkout/Api/Data/CustomerInterface.php create mode 100644 app/code/Magento/Checkout/Api/Data/PaymentMethodInterface.php create mode 100644 app/code/Magento/Checkout/Api/Data/ShippingMethodInterface.php create mode 100644 app/code/Magento/Checkout/Api/Data/TotalsInterface.php create mode 100644 app/code/Magento/Checkout/Api/Data/TotalsItemInterface.php create mode 100644 app/code/Magento/Checkout/Api/PaymentMethodManagementInterface.php create mode 100644 app/code/Magento/Checkout/Api/ShippingAddressManagementInterface.php create mode 100644 app/code/Magento/Checkout/Api/ShippingMethodManagementInterface.php diff --git a/app/code/Magento/Checkout/Api/BillingAddressManagementInterface.php b/app/code/Magento/Checkout/Api/BillingAddressManagementInterface.php new file mode 100644 index 0000000000000..e8fa596345fd4 --- /dev/null +++ b/app/code/Magento/Checkout/Api/BillingAddressManagementInterface.php @@ -0,0 +1,30 @@ + Date: Fri, 19 Dec 2014 17:19:31 +0200 Subject: [PATCH 02/90] MAGETWO-31306: Text message 'This is a required field.' is absent for "Terms and Conditions" if it wasn't selected --- .../Catalog/view/frontend/web/product/view/validation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/view/frontend/web/product/view/validation.js b/app/code/Magento/Catalog/view/frontend/web/product/view/validation.js index 751c7ef474fd2..20f0b2050636d 100644 --- a/app/code/Magento/Catalog/view/frontend/web/product/view/validation.js +++ b/app/code/Magento/Catalog/view/frontend/web/product/view/validation.js @@ -16,7 +16,7 @@ $.widget("mage.validation", $.mage.validation, { options: { - radioCheckboxClosest: 'ul', + radioCheckboxClosest: 'ul, ol', errorPlacement: function (error, element) { if (element.attr('data-validate-message-box')) { var messageBox = $(element.attr('data-validate-message-box')); From 68e9af1f2e6727c470276ee40fa34bee6dad3dd6 Mon Sep 17 00:00:00 2001 From: Stanislav Idolov Date: Fri, 19 Dec 2014 18:07:03 +0200 Subject: [PATCH 03/90] MAGETWO-32020: Introduce new API CheckoutAgreements interfaces --- .../CheckoutAgreementsRepositoryInterface.php | 16 +++++ .../Api/Data/CheckoutAgreementsInterface.php | 61 +++++++++++++++++++ .../V1/Agreement/ReadServiceInterface.php | 2 + 3 files changed, 79 insertions(+) create mode 100644 app/code/Magento/CheckoutAgreements/Api/CheckoutAgreementsRepositoryInterface.php create mode 100644 app/code/Magento/CheckoutAgreements/Api/Data/CheckoutAgreementsInterface.php diff --git a/app/code/Magento/CheckoutAgreements/Api/CheckoutAgreementsRepositoryInterface.php b/app/code/Magento/CheckoutAgreements/Api/CheckoutAgreementsRepositoryInterface.php new file mode 100644 index 0000000000000..65f683e321458 --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Api/CheckoutAgreementsRepositoryInterface.php @@ -0,0 +1,16 @@ + Date: Mon, 22 Dec 2014 10:21:20 +0200 Subject: [PATCH 04/90] MAGETWO-32020: Introduce new API CheckoutAgreements interfaces --- .../Api/Data/CheckoutAgreementsInterface.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/CheckoutAgreements/Api/Data/CheckoutAgreementsInterface.php b/app/code/Magento/CheckoutAgreements/Api/Data/CheckoutAgreementsInterface.php index bb114cb46351b..533894d3ff159 100644 --- a/app/code/Magento/CheckoutAgreements/Api/Data/CheckoutAgreementsInterface.php +++ b/app/code/Magento/CheckoutAgreements/Api/Data/CheckoutAgreementsInterface.php @@ -49,7 +49,7 @@ public function getCheckboxText(); * * @return bool Agreement status. */ - public function isActive(); + public function getIsActive(); /** * Returns the agreement content type. @@ -57,5 +57,5 @@ public function isActive(); * @return bool * true - HTML. * * false - plain text. */ - public function isHtml(); + public function getIsHtml(); } From 837d61db4b079b0ce865810d52bd4aae75e5eada Mon Sep 17 00:00:00 2001 From: Ievgen Shakhsuvarov Date: Tue, 23 Dec 2014 09:32:09 +0200 Subject: [PATCH 05/90] MAGETWO-31972: Implement GiftMessage Api interfaces --- .../GiftMessage/Api/Data/MessageInterface.php | 71 +++++++++++++++++++ .../Api/GiftMessageRepositoryInterface.php | 59 +++++++++++++++ .../Service/V1/ReadServiceInterface.php | 4 ++ .../Service/V1/WriteServiceInterface.php | 4 ++ 4 files changed, 138 insertions(+) create mode 100644 app/code/Magento/GiftMessage/Api/Data/MessageInterface.php create mode 100644 app/code/Magento/GiftMessage/Api/GiftMessageRepositoryInterface.php diff --git a/app/code/Magento/GiftMessage/Api/Data/MessageInterface.php b/app/code/Magento/GiftMessage/Api/Data/MessageInterface.php new file mode 100644 index 0000000000000..22bfdd4b64303 --- /dev/null +++ b/app/code/Magento/GiftMessage/Api/Data/MessageInterface.php @@ -0,0 +1,71 @@ + Date: Tue, 23 Dec 2014 17:43:59 +0200 Subject: [PATCH 06/90] MAGETWO-31972: Implement GiftMessage Api interfaces --- .../Api/GiftMessageManagementInterface.php | 50 +++++++++++++++++++ .../Api/GiftMessageRepositoryInterface.php | 42 ---------------- .../Service/V1/ReadServiceInterface.php | 2 +- .../Service/V1/WriteServiceInterface.php | 4 +- 4 files changed, 53 insertions(+), 45 deletions(-) create mode 100644 app/code/Magento/GiftMessage/Api/GiftMessageManagementInterface.php diff --git a/app/code/Magento/GiftMessage/Api/GiftMessageManagementInterface.php b/app/code/Magento/GiftMessage/Api/GiftMessageManagementInterface.php new file mode 100644 index 0000000000000..28a00a03059ce --- /dev/null +++ b/app/code/Magento/GiftMessage/Api/GiftMessageManagementInterface.php @@ -0,0 +1,50 @@ + Date: Tue, 23 Dec 2014 18:40:32 +0200 Subject: [PATCH 07/90] MAGETWO-31972: Implement GiftMessage Api interfaces --- ...=> GiftMessageItemRepositoryInterface.php} | 23 ++++--------------- .../Api/GiftMessageRepositoryInterface.php | 15 ++++++++++++ .../Service/V1/ReadServiceInterface.php | 2 +- .../Service/V1/WriteServiceInterface.php | 4 ++-- 4 files changed, 22 insertions(+), 22 deletions(-) rename app/code/Magento/GiftMessage/Api/{GiftMessageManagementInterface.php => GiftMessageItemRepositoryInterface.php} (54%) diff --git a/app/code/Magento/GiftMessage/Api/GiftMessageManagementInterface.php b/app/code/Magento/GiftMessage/Api/GiftMessageItemRepositoryInterface.php similarity index 54% rename from app/code/Magento/GiftMessage/Api/GiftMessageManagementInterface.php rename to app/code/Magento/GiftMessage/Api/GiftMessageItemRepositoryInterface.php index 28a00a03059ce..42df68610fe6c 100644 --- a/app/code/Magento/GiftMessage/Api/GiftMessageManagementInterface.php +++ b/app/code/Magento/GiftMessage/Api/GiftMessageItemRepositoryInterface.php @@ -4,7 +4,7 @@ */ namespace Magento\GiftMessage\Api; -interface GiftMessageManagementInterface +interface GiftMessageItemRepositoryInterface { /** * Returns the gift message for a specified item in a specified shopping cart. @@ -15,25 +15,10 @@ interface GiftMessageManagementInterface * @throws \Magento\Framework\Exception\NoSuchEntityException The specified item does not exist in the cart. * @see \Magento\GiftMessage\Service\V1\ReadServiceInterface::getItemMessage */ - public function getItemMessage($cartId, $itemId); + public function get($cartId, $itemId); /** - * Sets the gift message for an entire order. - * - * @param int $cartId The cart ID. - * @param \Magento\GiftMessage\Service\V1\Data\Message $giftMessage The gift message. - * @return bool - * @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart does not exist. - * @throws \Magento\Framework\Exception\InputException You cannot add gift messages to empty carts. - * @throws \Magento\Framework\Exception\State\InvalidTransitionException You cannot add gift messages to - * virtual products. - * @throws \Magento\Framework\Exception\CouldNotSaveException The specified gift message could not be saved. - * @see \Magento\GiftMessage\Service\V1\WriteServiceInterface::setForQuote - */ - public function assignToCart($cartId, \Magento\GiftMessage\Service\V1\Data\Message $giftMessage); - - /** - * Sets the gift message for a specified item. + * Sets the gift message for a specified item in a specified shopping cart. * * @param int $cartId The cart ID. * @param \Magento\GiftMessage\Service\V1\Data\Message $giftMessage The gift message. @@ -46,5 +31,5 @@ public function assignToCart($cartId, \Magento\GiftMessage\Service\V1\Data\Messa * @throws \Magento\Framework\Exception\CouldNotSaveException The specified gift message could not be saved. * @see \Magento\GiftMessage\Service\V1\WriteServiceInterface::setForItem */ - public function assignToItem($cartId, \Magento\GiftMessage\Service\V1\Data\Message $giftMessage, $itemId); + public function save($cartId, \Magento\GiftMessage\Service\V1\Data\Message $giftMessage, $itemId); } diff --git a/app/code/Magento/GiftMessage/Api/GiftMessageRepositoryInterface.php b/app/code/Magento/GiftMessage/Api/GiftMessageRepositoryInterface.php index e25410b2cbce9..02bd9d870f783 100644 --- a/app/code/Magento/GiftMessage/Api/GiftMessageRepositoryInterface.php +++ b/app/code/Magento/GiftMessage/Api/GiftMessageRepositoryInterface.php @@ -14,4 +14,19 @@ interface GiftMessageRepositoryInterface * @see \Magento\GiftMessage\Service\V1\ReadServiceInterface::get */ public function get($cartId); + + /** + * Sets the gift message for an entire order. + * + * @param int $cartId The cart ID. + * @param \Magento\GiftMessage\Service\V1\Data\Message $giftMessage The gift message. + * @return bool + * @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart does not exist. + * @throws \Magento\Framework\Exception\InputException You cannot add gift messages to empty carts. + * @throws \Magento\Framework\Exception\State\InvalidTransitionException You cannot add gift messages to + * virtual products. + * @throws \Magento\Framework\Exception\CouldNotSaveException The specified gift message could not be saved. + * @see \Magento\GiftMessage\Service\V1\WriteServiceInterface::setForQuote + */ + public function save($cartId, \Magento\GiftMessage\Service\V1\Data\Message $giftMessage); } diff --git a/app/code/Magento/GiftMessage/Service/V1/ReadServiceInterface.php b/app/code/Magento/GiftMessage/Service/V1/ReadServiceInterface.php index 23a8a746d4c3b..aa8fe675f084f 100644 --- a/app/code/Magento/GiftMessage/Service/V1/ReadServiceInterface.php +++ b/app/code/Magento/GiftMessage/Service/V1/ReadServiceInterface.php @@ -27,7 +27,7 @@ public function get($cartId); * @return \Magento\GiftMessage\Service\V1\Data\Message Gift message. * @throws \Magento\Framework\Exception\NoSuchEntityException The specified item does not exist in the cart. * @deprecated - * @see \Magento\GiftMessage\Api\GiftMessageManagementInterface::getItemMessage + * @see \Magento\GiftMessage\Api\GiftMessageItemRepositoryInterface::get */ public function getItemMessage($cartId, $itemId); } diff --git a/app/code/Magento/GiftMessage/Service/V1/WriteServiceInterface.php b/app/code/Magento/GiftMessage/Service/V1/WriteServiceInterface.php index 5878dc96e356e..23b884729aa87 100644 --- a/app/code/Magento/GiftMessage/Service/V1/WriteServiceInterface.php +++ b/app/code/Magento/GiftMessage/Service/V1/WriteServiceInterface.php @@ -21,7 +21,7 @@ interface WriteServiceInterface * virtual products. * @throws \Magento\Framework\Exception\CouldNotSaveException The specified gift message could not be saved. * @deprecated - * @see \Magento\GiftMessage\Api\GiftMessageManagementInterface::assignToQuote + * @see \Magento\GiftMessage\Api\GiftMessageRepositoryInterface::save */ public function setForQuote($cartId, \Magento\GiftMessage\Service\V1\Data\Message $giftMessage); @@ -38,7 +38,7 @@ public function setForQuote($cartId, \Magento\GiftMessage\Service\V1\Data\Messag * virtual products. * @throws \Magento\Framework\Exception\CouldNotSaveException The specified gift message could not be saved. * @deprecated - * @see \Magento\GiftMessage\Api\GiftMessageManagementInterface::assignToItem + * @see \Magento\GiftMessage\Api\GiftMessageItemRepositoryInterface::save */ public function setForItem($cartId, \Magento\GiftMessage\Service\V1\Data\Message $giftMessage, $itemId); } From c5ab8263b5b51b59518e4b6eb5e50a70be3f4c17 Mon Sep 17 00:00:00 2001 From: Stanislav Idolov Date: Wed, 24 Dec 2014 15:54:51 +0200 Subject: [PATCH 08/90] MAGETWO-32020: Introduce new API CheckoutAgreements interfaces -fixes after CR --- .../Api/CheckoutAgreementsRepositoryInterface.php | 2 +- .../{CheckoutAgreementsInterface.php => AgreementInterface.php} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename app/code/Magento/CheckoutAgreements/Api/Data/{CheckoutAgreementsInterface.php => AgreementInterface.php} (97%) diff --git a/app/code/Magento/CheckoutAgreements/Api/CheckoutAgreementsRepositoryInterface.php b/app/code/Magento/CheckoutAgreements/Api/CheckoutAgreementsRepositoryInterface.php index 65f683e321458..0e596daa5e916 100644 --- a/app/code/Magento/CheckoutAgreements/Api/CheckoutAgreementsRepositoryInterface.php +++ b/app/code/Magento/CheckoutAgreements/Api/CheckoutAgreementsRepositoryInterface.php @@ -9,7 +9,7 @@ interface CheckoutAgreementsRepositoryInterface /** * Lists active checkout agreements. * - * @return \Magento\CheckoutAgreements\Api\Data\CheckoutAgreementsInterface[] + * @return \Magento\CheckoutAgreements\Api\Data\AgreementInterface[] * @see \Magento\CheckoutAgreements\Service\V1\Agreement\ReadServiceInterface::getList */ public function getList(); diff --git a/app/code/Magento/CheckoutAgreements/Api/Data/CheckoutAgreementsInterface.php b/app/code/Magento/CheckoutAgreements/Api/Data/AgreementInterface.php similarity index 97% rename from app/code/Magento/CheckoutAgreements/Api/Data/CheckoutAgreementsInterface.php rename to app/code/Magento/CheckoutAgreements/Api/Data/AgreementInterface.php index 533894d3ff159..3b603d0a39a83 100644 --- a/app/code/Magento/CheckoutAgreements/Api/Data/CheckoutAgreementsInterface.php +++ b/app/code/Magento/CheckoutAgreements/Api/Data/AgreementInterface.php @@ -7,7 +7,7 @@ /** * @see \Magento\CheckoutAgreements\Service\V1\Data\Agreement */ -interface CheckoutAgreementsInterface +interface AgreementInterface { /** * Returns the agreement ID. From ddb7ee45ce092b2a30ae9b3991dfb9de29ee492d Mon Sep 17 00:00:00 2001 From: Stanislav Idolov Date: Wed, 24 Dec 2014 16:40:06 +0200 Subject: [PATCH 09/90] MAGETWO-31960: Introduce Checkout Api interfaces -fixes after CR --- app/code/Magento/Checkout/Api/CartManagementInterface.php | 6 ++++-- app/code/Magento/Checkout/Api/Data/CartInterface.php | 7 ------- app/code/Magento/Checkout/Service/V1/Cart/WriteService.php | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/app/code/Magento/Checkout/Api/CartManagementInterface.php b/app/code/Magento/Checkout/Api/CartManagementInterface.php index 5629fb0f0bd03..0a58fd204f006 100644 --- a/app/code/Magento/Checkout/Api/CartManagementInterface.php +++ b/app/code/Magento/Checkout/Api/CartManagementInterface.php @@ -9,11 +9,12 @@ interface CartManagementInterface /** * Enables an administrative or guest user to create an empty cart and quote for an anonymous customer. * + * @param int $storeId * @throws \Magento\Framework\Exception\CouldNotSaveException The empty cart and quote could not be created. * @return int Cart ID. * @see \Magento\Checkout\Service\V1\Cart\WriteServiceInterface::create */ - public function createEmptyCart(); + public function createEmptyCart($storeId); /** * Returns information for the cart for a specified customer. @@ -30,10 +31,11 @@ public function getCartForCustomer($customerId); * * @param int $cartId The cart ID. * @param int $customerId The customer ID. + * @param int $storeId * @return boolean * @see \Magento\Checkout\Service\V1\Cart\WriteServiceInterface::assignCustomer */ - public function assignCustomer($cartId, $customerId); + public function assignCustomer($cartId, $customerId, $storeId); /** * Returns information for a coupon in a specified cart. diff --git a/app/code/Magento/Checkout/Api/Data/CartInterface.php b/app/code/Magento/Checkout/Api/Data/CartInterface.php index db54707d1422e..3d17775da42c2 100644 --- a/app/code/Magento/Checkout/Api/Data/CartInterface.php +++ b/app/code/Magento/Checkout/Api/Data/CartInterface.php @@ -16,13 +16,6 @@ interface CartInterface extends \Magento\Framework\Api\ExtensibleDataInterface */ public function getId(); - /** - * Returns the store ID for the store where the cart was created. - * - * @return int|null Store ID. Otherwise, null. - */ - public function getStoreId(); - /** * Returns the cart creation date and time. * diff --git a/app/code/Magento/Checkout/Service/V1/Cart/WriteService.php b/app/code/Magento/Checkout/Service/V1/Cart/WriteService.php index 9fbaebf61f266..112be792f3e7f 100644 --- a/app/code/Magento/Checkout/Service/V1/Cart/WriteService.php +++ b/app/code/Magento/Checkout/Service/V1/Cart/WriteService.php @@ -127,8 +127,8 @@ protected function createCustomerCart() try { $this->quoteRepository->getActiveForCustomer($this->userContext->getUserId()); - throw new CouldNotSaveException('Cannot create quote'); } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { + throw new CouldNotSaveException('Cannot create quote'); } /** @var \Magento\Sales\Model\Quote $quote */ From 3ffc38008e8266b4e003293ca8eb260619d01eb3 Mon Sep 17 00:00:00 2001 From: Ievgen Shakhsuvarov Date: Mon, 29 Dec 2014 18:22:11 +0200 Subject: [PATCH 10/90] MAGETWO-32078: Validation for Terms and Conditions should be the same for OnePage Checkout and Multishipping Flow --- .../Checkout/view/frontend/web/js/overview.js | 13 +++++-------- .../view/frontend/templates/checkout/overview.phtml | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/js/overview.js b/app/code/Magento/Checkout/view/frontend/web/js/overview.js index 37456a0153f46..43819efb7bb01 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/overview.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/overview.js @@ -10,13 +10,12 @@ define([ "mage/translate" ], function($){ "use strict"; - + $.widget('mage.orderOverview', { options: { opacity: 0.5, // CSS opacity for the 'Place Order' button when it's clicked and then disabled. pleaseWaitLoader: 'span.please-wait', // 'Submitting order information...' Ajax loader. - placeOrderSubmit: 'button[type="submit"]', // The 'Place Order' button. - agreements: '#checkout-agreements' // Container for all of the checkout agreements and terms/conditions + placeOrderSubmit: 'button[type="submit"]' // The 'Place Order' button. }, /** @@ -28,14 +27,12 @@ define([ }, /** - * Verify that all agreements and terms/conditions are checked. Show the Ajax loader. Disable - * the submit button (i.e. Place Order). + * Show the Ajax loader. Disable the submit button (i.e. Place Order). * @return {Boolean} * @private */ _showLoader: function() { - if ($(this.options.agreements).find('input[type="checkbox"]:not(:checked)').length > 0) { - alert($.mage.__('Please agree to all Terms and Conditions before placing the orders.')); + if (!this.element.validation('isValid')) { return false; } this.element.find(this.options.pleaseWaitLoader).show().end() @@ -43,6 +40,6 @@ define([ return true; } }); - + return $.mage.orderOverview; }); \ No newline at end of file diff --git a/app/code/Magento/Multishipping/view/frontend/templates/checkout/overview.phtml b/app/code/Magento/Multishipping/view/frontend/templates/checkout/overview.phtml index e0b908a5a0ed1..756bae9c4d625 100644 --- a/app/code/Magento/Multishipping/view/frontend/templates/checkout/overview.phtml +++ b/app/code/Magento/Multishipping/view/frontend/templates/checkout/overview.phtml @@ -3,7 +3,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ ?> -
+ getBlockHtml('formkey'); ?>
From 47bad3e08fe18c8c02d5b1ef0db37a635e10d79b Mon Sep 17 00:00:00 2001 From: Ievgen Shakhsuvarov Date: Thu, 8 Jan 2015 15:52:42 +0200 Subject: [PATCH 11/90] MAGETWO-32078: Validation for Terms and Conditions should be the same for OnePage Checkout and Multishipping Flow --- .../view/frontend/templates/product/view/addtocart.phtml | 3 ++- .../Catalog/view/frontend/templates/product/view/form.phtml | 3 ++- .../Magento/Checkout/view/frontend/web/js/opc-order-review.js | 3 +-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/view/addtocart.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/view/addtocart.phtml index 3968a9a1bee6e..d1b437b7b6dc3 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/view/addtocart.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/view/addtocart.phtml @@ -44,7 +44,8 @@