Skip to content
Permalink
Browse files

Merge pull request #15814 from zuk3975/m/orders/create-cart

Implement cart information providing in BO order creation page - part 1
  • Loading branch information
matks committed Oct 9, 2019
2 parents ec4287e + 3910b24 commit 992f212f0951048fdecc0cf7cda448927bf77ae6
Showing with 2,937 additions and 774 deletions.
  1. +1 −1 admin-dev/package.json
  2. +65 −0 admin-dev/themes/new-theme/js/components/router.js
  3. +1 −0 admin-dev/themes/new-theme/js/fos_js_routes.json
  4. +0 −349 admin-dev/themes/new-theme/js/pages/order/create-order-page.js
  5. +6 −3 admin-dev/themes/new-theme/js/pages/order/create.js
  6. +100 −0 admin-dev/themes/new-theme/js/pages/order/create/addresses-renderer.js
  7. +82 −0 admin-dev/themes/new-theme/js/pages/order/create/cart-provider.js
  8. +69 −0 admin-dev/themes/new-theme/js/pages/order/create/carts-renderer.js
  9. +3 −1 admin-dev/themes/new-theme/js/pages/order/{ → create}/create-order-map.js
  10. +252 −0 admin-dev/themes/new-theme/js/pages/order/create/create-order-page.js
  11. +65 −0 admin-dev/themes/new-theme/js/pages/order/create/customer-info-provider.js
  12. +1 −1 admin-dev/themes/new-theme/js/pages/order/{ → create}/customer-searcher-component.js
  13. +64 −0 admin-dev/themes/new-theme/js/pages/order/create/orders-renderer.js
  14. +1 −1 admin-dev/themes/new-theme/js/pages/order/{ → create}/shipping-renderer.js
  15. +68 −0 admin-dev/themes/new-theme/js/pages/order/create/vouchers-renderer.js
  16. +5 −0 admin-dev/themes/new-theme/package-lock.json
  17. +1 −0 admin-dev/themes/new-theme/package.json
  18. +5 −1 admin-dev/themes/new-theme/template/layout.tpl
  19. +1 −0 app/AppKernel.php
  20. +1 −0 composer.json
  21. +111 −9 composer.lock
  22. +16 −2 controllers/admin/AdminLegacyLayoutController.php
  23. +14 −4 src/Adapter/Cart/AbstractCartHandler.php
  24. +1 −1 src/Adapter/Cart/CommandHandler/AddCartRuleToCartHandler.php
  25. +23 −9 src/Adapter/Cart/CommandHandler/CreateEmptyCustomerCartHandler.php
  26. +1 −1 src/Adapter/Cart/CommandHandler/RemoveCartRuleFromCartHandler.php
  27. +1 −1 src/Adapter/Cart/CommandHandler/RemoveProductFromCartHandler.php
  28. +1 −1 src/Adapter/Cart/CommandHandler/SetFreeShippingToCartHandler.php
  29. +2 −29 src/Adapter/Cart/CommandHandler/UpdateCartAddressesHandler.php
  30. +1 −1 src/Adapter/Cart/CommandHandler/UpdateCartCurrencyHandler.php
  31. +1 −1 src/Adapter/Cart/CommandHandler/UpdateCartDeliveryOptionHandler.php
  32. +1 −1 src/Adapter/Cart/CommandHandler/UpdateCartLanguageHandler.php
  33. +1 −1 src/Adapter/Cart/CommandHandler/UpdateProductPriceInCartHandler.php
  34. +1 −1 src/Adapter/Cart/CommandHandler/UpdateProductQuantityInCartHandler.php
  35. +175 −0 src/Adapter/Cart/QueryHandler/GetCartInformationHandler.php
  36. +0 −235 src/Adapter/Cart/QueryHandler/GetCartSummaryHandler.php
  37. +85 −0 src/Adapter/Cart/QueryHandler/GetLastEmptyCustomerCartHandler.php
  38. +98 −0 src/Adapter/Customer/QueryHandler/GetCustomerCartsHandler.php
  39. +105 −0 src/Adapter/Customer/QueryHandler/GetCustomerOrdersHandler.php
  40. +1 −1 src/Adapter/Form/ChoiceProvider/CurrencySymbolByIdChoiceProvider.php
  41. +1 −1 src/Adapter/Form/ChoiceProvider/OrderInvoiceByIdChoiceProvider.php
  42. +4 −2 src/Adapter/LegacyContext.php
  43. +1 −1 src/Adapter/Order/QueryHandler/GetOrderForViewingHandler.php
  44. +1 −17 src/Core/Domain/Cart/Command/CreateEmptyCustomerCartCommand.php
  45. +7 −4 src/Core/Domain/Cart/Query/{GetCartSummary.php → GetCartInformation.php}
  46. +56 −0 src/Core/Domain/Cart/Query/GetLastEmptyCustomerCart.php
  47. +5 −10 ...n/Cart/QueryHandler/{GetCartSummaryHandlerInterface.php → GetCartInformationHandlerInterface.php}
  48. +43 −0 src/Core/Domain/Cart/QueryHandler/GetLastEmptyCustomerCartHandlerInterface.php
  49. +169 −0 src/Core/Domain/Cart/QueryResult/CartInformation.php
  50. +119 −0 src/Core/Domain/Cart/QueryResult/CartInformation/CartAddress.php
  51. +200 −0 src/Core/Domain/Cart/QueryResult/CartInformation/CartProduct.php
  52. +99 −0 src/Core/Domain/Cart/QueryResult/CartInformation/CartRule.php
  53. +56 −0 src/Core/Domain/Customer/Query/GetCustomerCarts.php
  54. +56 −0 src/Core/Domain/Customer/Query/GetCustomerOrders.php
  55. +43 −0 src/Core/Domain/Customer/QueryHandler/GetCustomerCartsHandlerInterface.php
  56. +43 −0 src/Core/Domain/Customer/QueryHandler/GetCustomerOrdersHandlerInterface.php
  57. +1 −1 src/Core/Domain/Customer/QueryHandler/SearchCustomersHandlerInterface.php
  58. +39 −28 src/Core/Domain/{Cart → Customer}/QueryResult/CartSummary.php
  59. +137 −0 src/Core/Domain/Customer/QueryResult/OrderSummary.php
  60. +1 −1 src/Core/Domain/Order/Query/GetOrderForViewing.php
  61. +1 −1 src/Core/Domain/Order/QueryHandler/GetOrderForViewingHandlerInterface.php
  62. +1 −1 src/Core/Domain/Order/QueryResult/OrderCarrierForViewing.php
  63. +1 −1 src/Core/Domain/Order/QueryResult/OrderCustomerForViewing.php
  64. +1 −1 src/Core/Domain/Order/QueryResult/OrderDocumentForViewing.php
  65. +1 −1 src/Core/Domain/Order/QueryResult/OrderDocumentsForViewing.php
  66. +1 −1 src/Core/Domain/Order/QueryResult/OrderForViewing.php
  67. +1 −1 src/Core/Domain/Order/QueryResult/OrderHistoryForViewing.php
  68. +1 −1 src/Core/Domain/Order/QueryResult/OrderInvoiceAddressForViewing.php
  69. +1 −1 src/Core/Domain/Order/QueryResult/OrderMessageForViewing.php
  70. +1 −1 src/Core/Domain/Order/QueryResult/OrderMessagesForViewing.php
  71. +1 −1 src/Core/Domain/Order/QueryResult/OrderPaymentForViewing.php
  72. +1 −1 src/Core/Domain/Order/QueryResult/OrderPaymentsForViewing.php
  73. +1 −1 src/Core/Domain/Order/QueryResult/OrderProductForViewing.php
  74. +1 −1 src/Core/Domain/Order/QueryResult/OrderProductsForViewing.php
  75. +1 −1 src/Core/Domain/Order/QueryResult/OrderReturnForViewing.php
  76. +1 −1 src/Core/Domain/Order/QueryResult/OrderReturnsForViewing.php
  77. +1 −1 src/Core/Domain/Order/QueryResult/OrderShippingAddressForViewing.php
  78. +1 −1 src/Core/Domain/Order/QueryResult/OrderShippingForViewing.php
  79. +1 −1 src/Core/Domain/Order/QueryResult/OrderStatusForViewing.php
  80. +1 −1 src/Core/Form/ChoiceProvider/OrderDiscountTypeChoiceProvider.php
  81. +34 −0 src/PrestaShopBundle/Controller/Admin/Sell/Customer/CustomerController.php
  82. +74 −0 src/PrestaShopBundle/Controller/Admin/Sell/Order/CartController.php
  83. +22 −0 src/PrestaShopBundle/Controller/Admin/Sell/Order/OrderController.php
  84. +1 −1 src/PrestaShopBundle/Form/Admin/Sell/Order/AddOrderCartRuleType.php
  85. +1 −1 src/PrestaShopBundle/Form/Admin/Sell/Order/OrderPaymentType.php
  86. +1 −1 src/PrestaShopBundle/Form/Admin/Sell/Order/UpdateOrderStatusType.php
  87. +24 −0 src/PrestaShopBundle/Resources/config/routing/admin/sell/customer/customers.yml
  88. +31 −0 src/PrestaShopBundle/Resources/config/routing/admin/sell/orders/carts.yml
  89. +10 −0 src/PrestaShopBundle/Resources/config/routing/admin/sell/orders/orders.yml
  90. +15 −6 src/PrestaShopBundle/Resources/config/services/adapter/cart.yml
  91. +18 −0 src/PrestaShopBundle/Resources/config/services/adapter/customer.yml
  92. +9 −0 src/PrestaShopBundle/Resources/config/services/bundle/twig.yml
  93. +1 −1 src/PrestaShopBundle/Resources/views/Admin/Sell/Order/Order/Blocks/Create/addresses.html.twig
  94. +1 −1 src/PrestaShopBundle/Resources/views/Admin/Sell/Order/Order/Blocks/Create/cart.html.twig
  95. +2 −2 src/PrestaShopBundle/Resources/views/Admin/Sell/Order/Order/Blocks/Create/customer.html.twig
  96. +25 −1 src/PrestaShopBundle/Resources/views/Admin/Sell/Order/Order/Blocks/Create/shipping.html.twig
  97. +1 −1 src/PrestaShopBundle/Resources/views/Admin/Sell/Order/Order/Blocks/Create/summary.html.twig
  98. +24 −1 src/PrestaShopBundle/Resources/views/Admin/Sell/Order/Order/Blocks/Create/vouchers.html.twig
  99. +1 −1 ...undle/Resources/views/Admin/Sell/Order/Order/Blocks/View/Modal/add_order_discount_modal.html.twig
  100. +1 −1 src/PrestaShopBundle/Resources/views/Admin/Sell/Order/Order/Blocks/View/customer.html.twig
  101. +1 −1 src/PrestaShopBundle/Resources/views/Admin/Sell/Order/Order/Blocks/View/details.html.twig
  102. +1 −1 src/PrestaShopBundle/Resources/views/Admin/Sell/Order/Order/Blocks/View/documents.html.twig
  103. +1 −1 src/PrestaShopBundle/Resources/views/Admin/Sell/Order/Order/Blocks/View/history.html.twig
  104. +1 −1 ...PrestaShopBundle/Resources/views/Admin/Sell/Order/Order/Blocks/View/merchandise_returns.html.twig
  105. +1 −1 src/PrestaShopBundle/Resources/views/Admin/Sell/Order/Order/Blocks/View/messages.html.twig
  106. +1 −1 src/PrestaShopBundle/Resources/views/Admin/Sell/Order/Order/Blocks/View/order_actions.html.twig
  107. +1 −1 src/PrestaShopBundle/Resources/views/Admin/Sell/Order/Order/Blocks/View/payments.html.twig
  108. +1 −1 src/PrestaShopBundle/Resources/views/Admin/Sell/Order/Order/Blocks/View/products.html.twig
  109. +1 −1 src/PrestaShopBundle/Resources/views/Admin/Sell/Order/Order/Blocks/View/shipping.html.twig
  110. +1 −3 src/PrestaShopBundle/Resources/views/Admin/Sell/Order/Order/create.html.twig
  111. +1 −1 src/PrestaShopBundle/Resources/views/Admin/Sell/Order/Order/view.html.twig
  112. +2 −1 src/PrestaShopBundle/Resources/views/Admin/layout.html.twig
  113. +93 −0 src/PrestaShopBundle/Twig/Extension/JsRouterMetadataExtension.php
  114. +4 −2 src/PrestaShopBundle/Twig/LayoutExtension.php
@@ -25,4 +25,4 @@
"path": "^0.12.7",
"webpack": "^1.12.12"
}
}
}
@@ -0,0 +1,65 @@
/**
* 2007-2019 PrestaShop SA and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/OSL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2019 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/

import Routing from 'fos-routing';
import routes from '../fos_js_routes.json';

const $ = window.$;

/**
* Wraps FOSJsRoutingbundle with exposed routes.
* To expose route add option `expose: true` in .yml routing config
*
* e.g.
*
* `my_route
* path: /my-path
* options:
* expose: true
* `
* And run `bin/console fos:js-routing:dump --format=json --target=admin-dev/themes/new-theme/js/fos_js_routes.json`
*/
export default class Router {
constructor() {
Routing.setData(routes);
Routing.setBaseUrl($(document).find('body').data('base-url'));

return this;
}

/**
* Decorated "generate" method, with predefined security token in params
*
* @param route
* @param params
*
* @returns {String}
*/
generate(route, params = {}) {
const tokenizedParams = Object.assign(params, {_token: $(document).find('body').data('token')});

return Routing.generate(route, tokenizedParams);
}
}
@@ -0,0 +1 @@
{"base_url":"","routes":{"admin_customers_carts":{"tokens":[["text","\/carts"],["variable","\/","\\d+","customerId"],["text","\/sell\/customers"]],"defaults":[],"requirements":{"customerId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_customers_orders":{"tokens":[["text","\/orders"],["variable","\/","\\d+","customerId"],["text","\/sell\/customers"]],"defaults":[],"requirements":{"customerId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_carts_info":{"tokens":[["text","\/info"],["variable","\/","\\d+","cartId"],["text","\/sell\/orders\/carts"]],"defaults":[],"requirements":{"cartId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_carts_create":{"tokens":[["text","\/sell\/orders\/carts\/new"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_edit_address":{"tokens":[["text","\/edit-address"],["variable","\/","\\d+","cartId"],["text","\/sell\/orders\/carts"]],"defaults":[],"requirements":{"cartId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_duplicate_cart":{"tokens":[["text","\/duplicate-cart"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]}},"prefix":"","host":"localhost","port":"","scheme":"http","locale":[]}

0 comments on commit 992f212

Please sign in to comment.
You can’t perform that action at this time.