@evershop/evershop 1.1.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (391) hide show
  1. package/bin/build/index.js +24 -0
  2. package/bin/extension/index.js +2 -2
  3. package/bin/lib/addDefaultMiddlewareFuncs.js +7 -2
  4. package/bin/lib/buildEntry.js +20 -2
  5. package/bin/lib/onListening.js +7 -4
  6. package/bin/lib/startUp.js +6 -0
  7. package/package.json +9 -1
  8. package/src/components/admin/catalog/productEdit/category/CategoryItem.jsx +2 -7
  9. package/src/components/admin/catalog/productEdit/category/CategoryTree.jsx +14 -7
  10. package/src/components/admin/catalog/productEdit/category/CategoryTree.scss +10 -0
  11. package/src/components/admin/catalog/productEdit/variants/CreateVariant.jsx +2 -2
  12. package/src/components/admin/catalog/productEdit/variants/CreateVariantGroup.jsx +1 -1
  13. package/src/components/admin/catalog/productEdit/variants/EditVariant.jsx +1 -1
  14. package/src/components/admin/catalog/productEdit/variants/New.jsx +2 -2
  15. package/src/components/admin/catalog/productEdit/variants/Search.jsx +1 -1
  16. package/src/components/admin/catalog/productEdit/variants/SearchModal.jsx +1 -1
  17. package/src/components/admin/catalog/productEdit/variants/VariantModal.jsx +6 -6
  18. package/src/components/admin/catalog/productGrid/rows/ThumbnailRow.jsx +1 -1
  19. package/src/components/admin/checkout/shippingSetting/Method.jsx +6 -6
  20. package/src/components/admin/checkout/shippingSetting/MethodForm.jsx +4 -4
  21. package/src/components/admin/checkout/shippingSetting/Methods.jsx +3 -3
  22. package/src/components/admin/checkout/shippingSetting/PriceBasedPrice.jsx +2 -2
  23. package/src/components/admin/checkout/shippingSetting/WeightBasedPrice.jsx +2 -2
  24. package/src/components/admin/checkout/shippingSetting/Zone.jsx +7 -7
  25. package/src/components/admin/checkout/shippingSetting/ZoneForm.jsx +1 -1
  26. package/src/components/admin/cms/Card.jsx +3 -3
  27. package/src/components/admin/cms/PageHeading.jsx +3 -3
  28. package/src/components/admin/cms/widget/WidgetTypes.jsx +28 -0
  29. package/src/components/admin/cms/widget/grid/WidgetTypeRow.jsx +29 -0
  30. package/src/components/admin/oms/orderEdit/items/ItemVariantOptions.jsx +1 -1
  31. package/src/components/admin/oms/orderEdit/items/Name.jsx +1 -1
  32. package/src/components/admin/oms/orderGrid/headers/OrderDateColumnHeader.jsx +1 -1
  33. package/src/components/admin/promotion/couponEdit/AttributeGroupSelector.jsx +3 -3
  34. package/src/components/admin/promotion/couponEdit/BuyXGetY.jsx +2 -2
  35. package/src/components/admin/promotion/couponEdit/CategorySelector.jsx +6 -6
  36. package/src/components/admin/promotion/couponEdit/CollectionSelector.jsx +3 -3
  37. package/src/components/admin/promotion/couponEdit/ProductSkuSelector.jsx +4 -4
  38. package/src/components/admin/promotion/couponEdit/RequireProducts.jsx +2 -2
  39. package/src/components/admin/promotion/couponEdit/Setting.jsx +1 -1
  40. package/src/components/admin/promotion/couponEdit/TargetProducts.jsx +4 -4
  41. package/src/components/admin/tax/taxSetting/Rate.jsx +6 -6
  42. package/src/components/admin/tax/taxSetting/RateForm.jsx +5 -5
  43. package/src/components/admin/tax/taxSetting/Rates.jsx +6 -6
  44. package/src/components/admin/tax/taxSetting/TaxClass.jsx +3 -3
  45. package/src/components/admin/tax/taxSetting/TaxClassForm.jsx +1 -1
  46. package/src/components/admin/widgets/BasicMenuSetting.jsx +614 -0
  47. package/src/components/admin/widgets/BasicMenuSetting.scss +19 -0
  48. package/src/components/admin/widgets/CollectionProductsSetting.jsx +203 -0
  49. package/src/components/admin/widgets/TextBlockSetting.jsx +70 -0
  50. package/src/components/common/Area.jsx +31 -8
  51. package/src/components/common/Badge.jsx +1 -1
  52. package/src/components/common/Editor.jsx +193 -0
  53. package/src/components/common/Notification.scss +1 -0
  54. package/src/components/common/SimplePagination.jsx +2 -2
  55. package/src/components/common/form/Form.jsx +1 -1
  56. package/src/components/common/form/fields/Checkbox.jsx +1 -1
  57. package/src/components/common/form/fields/Ckeditor.jsx +11 -11
  58. package/src/components/common/form/fields/Editor.jsx +326 -0
  59. package/src/components/common/form/fields/Editor.scss +33 -0
  60. package/src/components/common/form/fields/Radio.jsx +1 -1
  61. package/src/components/common/form/fields/editor/FileBrowser.jsx +419 -0
  62. package/src/components/common/form/fields/editor/FileBrowser.scss +37 -0
  63. package/src/components/common/form/fields/editor/GetColumnClasses.jsx +14 -0
  64. package/src/components/common/form/fields/editor/GetRowClasses.jsx +18 -0
  65. package/src/components/common/form/fields/editor/RowTemplates.jsx +154 -0
  66. package/src/components/common/grid/Pagination.jsx +4 -4
  67. package/src/components/common/grid/headers/FromTo.jsx +1 -1
  68. package/src/components/common/grid/headers/Sortable.jsx +1 -1
  69. package/src/components/common/grid/rows/ThumbnailRow.jsx +1 -1
  70. package/src/components/common/list/Filter.jsx +1 -1
  71. package/src/components/common/modal/Alert.jsx +1 -1
  72. package/src/components/common/modal/Modal.jsx +1 -1
  73. package/src/components/frontStore/catalog/categoryView/filter/AttributeFilter.jsx +2 -2
  74. package/src/components/frontStore/catalog/categoryView/filter/CategoryFilter.jsx +3 -2
  75. package/src/components/frontStore/catalog/categoryView/filter/CategoryFilter.scss +5 -0
  76. package/src/components/frontStore/catalog/product/list/List.jsx +4 -4
  77. package/src/components/frontStore/catalog/product/list/Pagination.jsx +1 -1
  78. package/src/components/frontStore/catalog/product/list/Sorting.jsx +2 -2
  79. package/src/components/frontStore/catalog/product/list/item/Name.jsx +1 -1
  80. package/src/components/frontStore/checkout/cart/Empty.jsx +3 -3
  81. package/src/components/frontStore/checkout/cart/items/ItemOptions.jsx +1 -1
  82. package/src/components/frontStore/checkout/cart/items/ItemVariantOptions.jsx +1 -1
  83. package/src/components/frontStore/checkout/cart/items/Items.jsx +20 -21
  84. package/src/components/frontStore/checkout/cart/items/Items.scss +47 -0
  85. package/src/components/frontStore/checkout/cart/items/Quantity.jsx +154 -0
  86. package/src/components/frontStore/checkout/checkout/StepTitle.jsx +1 -1
  87. package/src/components/frontStore/checkout/checkout/payment/paymentStep/StepContent.jsx +5 -5
  88. package/src/components/frontStore/checkout/checkout/shipment/StepContent.jsx +1 -1
  89. package/src/components/frontStore/checkout/checkout/summary/Cart.jsx +10 -12
  90. package/src/components/frontStore/checkout/checkout/summary/Items.jsx +9 -9
  91. package/src/components/frontStore/checkout/checkout/summary/cart/Total.jsx +6 -6
  92. package/src/components/frontStore/checkout/success/summary/items/ItemOptions.jsx +1 -1
  93. package/src/components/frontStore/checkout/success/summary/items/Items.jsx +9 -6
  94. package/src/components/frontStore/checkout/success/summary/order/OrderSummary.jsx +9 -13
  95. package/src/components/frontStore/checkout/success/summary/order/Total.jsx +5 -5
  96. package/src/components/frontStore/customer/address/addressForm/AddressFormLoadingSkeleton.jsx +2 -2
  97. package/src/components/frontStore/customer/address/addressForm/NameAndTelephone.jsx +1 -1
  98. package/src/components/frontStore/customer/address/addressForm/ProvinceAndPostcode.jsx +1 -1
  99. package/src/components/frontStore/customer/checkout/Edit.jsx +2 -2
  100. package/src/components/frontStore/customer/detail/Order.jsx +4 -4
  101. package/src/components/frontStore/stripe/checkout/CheckoutForm.jsx +2 -2
  102. package/src/components/frontStore/stripe/checkout/TestCards.jsx +1 -1
  103. package/src/components/frontStore/widgets/BasicMenu.jsx +129 -0
  104. package/src/{modules/catalog/pages/frontStore/homepage/FeaturedProducts.jsx → components/frontStore/widgets/CollectionProducts.jsx} +40 -32
  105. package/src/components/frontStore/widgets/TextBlock.jsx +46 -0
  106. package/src/lib/componee/getComponentsByRoute.js +15 -2
  107. package/src/lib/event/event-manager.js +1 -1
  108. package/src/lib/middleware/tests/app/modules/404page/pages/frontStore/product/route.json +2 -1
  109. package/src/lib/middlewares/static.js +3 -1
  110. package/src/lib/response/render.js +5 -6
  111. package/src/lib/router/Router.js +1 -1
  112. package/src/lib/router/loadModuleRoutes.js +3 -0
  113. package/src/lib/router/registerAdminRoute.js +9 -1
  114. package/src/lib/router/registerFrontStoreRoute.js +2 -0
  115. package/src/lib/router/scanForRoutes.js +1 -0
  116. package/src/lib/router/tests/unit/unit.validateRoute.test.js +7 -1
  117. package/src/lib/util/defaultPaginationFilters.js +19 -17
  118. package/src/lib/util/getEnabledWidgets.js +34 -0
  119. package/src/lib/util/merge.js +67 -14
  120. package/src/lib/util/tests/unit/util.merge.test.js +21 -4
  121. package/src/lib/util/validateConfiguration.js +83 -0
  122. package/src/lib/webpack/createBaseConfig.js +4 -1
  123. package/src/lib/webpack/dev/createConfigClient.js +10 -2
  124. package/src/lib/webpack/loaders/AreaLoader.js +16 -6
  125. package/src/lib/webpack/util/keyGenerator.js +9 -0
  126. package/src/lib/webpack/util/parseGraphql.js +30 -16
  127. package/src/lib/webpack/util/parseGraphqlByFile.js +16 -2
  128. package/src/modules/auth/pages/admin/adminLogin/LoginForm.jsx +54 -21
  129. package/src/modules/auth/pages/admin/all/AdminUser.jsx +3 -3
  130. package/src/modules/base/bootstrap.js +79 -0
  131. package/src/modules/base/graphql/types/Route/Route.admin.graphql +15 -0
  132. package/src/modules/base/graphql/types/Route/Route.admin.resolvers.js +10 -0
  133. package/src/modules/base/pages/global/response[errorHandler].js +25 -1
  134. package/src/modules/catalog/bootstrap.js +125 -5
  135. package/src/modules/catalog/graphql/types/Category/Category.graphql +4 -3
  136. package/src/modules/catalog/graphql/types/Category/Category.resolvers.js +34 -0
  137. package/src/modules/catalog/graphql/types/Collection/Collection.graphql +2 -2
  138. package/src/modules/catalog/graphql/types/Collection/Collection.resolvers.js +34 -0
  139. package/src/modules/catalog/graphql/types/Product/Attribute/ProductAttribute.resolvers.js +1 -0
  140. package/src/modules/catalog/graphql/types/Product/Product.graphql +1 -1
  141. package/src/modules/catalog/graphql/types/Product/Product.resolvers.js +34 -0
  142. package/src/modules/catalog/graphql/types/Widget/CollectionProductsWidget/CollectionProductsWidget.graphql +11 -0
  143. package/src/modules/catalog/graphql/types/Widget/CollectionProductsWidget/CollectionProductsWidget.resolvers.js +8 -0
  144. package/src/modules/catalog/migration/Version-1.0.0.js +1 -0
  145. package/src/modules/catalog/migration/Version-1.0.7.js +10 -0
  146. package/src/modules/catalog/pages/admin/attributeEdit+attributeNew/FormContent.jsx +4 -4
  147. package/src/modules/catalog/pages/admin/attributeEdit+attributeNew/General.jsx +5 -5
  148. package/src/modules/catalog/pages/admin/attributeGrid/Grid.jsx +2 -2
  149. package/src/modules/catalog/pages/admin/categoryEdit/Products.jsx +4 -4
  150. package/src/modules/catalog/pages/admin/categoryEdit+categoryNew/FormContent.jsx +4 -4
  151. package/src/modules/catalog/pages/admin/categoryEdit+categoryNew/General.jsx +16 -18
  152. package/src/modules/catalog/pages/admin/categoryEdit+categoryNew/Image.jsx +1 -2
  153. package/src/modules/catalog/pages/admin/categoryEdit+categoryNew/Status.jsx +16 -1
  154. package/src/modules/catalog/pages/admin/categoryGrid/Grid.jsx +3 -3
  155. package/src/modules/catalog/pages/admin/collectionEdit/Products.jsx +4 -4
  156. package/src/modules/catalog/pages/admin/collectionEdit+collectionNew/FormContent.jsx +2 -2
  157. package/src/modules/catalog/pages/admin/collectionEdit+collectionNew/General.jsx +2 -2
  158. package/src/modules/catalog/pages/admin/collectionGrid/Grid.jsx +3 -3
  159. package/src/modules/catalog/pages/admin/productEdit/Collection.jsx +7 -7
  160. package/src/modules/catalog/pages/admin/productEdit+productNew/Attributes.jsx +8 -3
  161. package/src/modules/catalog/pages/admin/productEdit+productNew/CustomOptions.jsss +4 -4
  162. package/src/modules/catalog/pages/admin/productEdit+productNew/FormContent.jsx +4 -4
  163. package/src/modules/catalog/pages/admin/productEdit+productNew/General.jsx +15 -17
  164. package/src/modules/catalog/pages/admin/productGrid/Grid.jsx +3 -3
  165. package/src/modules/catalog/pages/frontStore/catalogSearch/General.jsx +2 -2
  166. package/src/modules/catalog/pages/frontStore/catalogSearch/Products.jsx +1 -1
  167. package/src/modules/catalog/pages/frontStore/catalogSearch/route.json +2 -1
  168. package/src/modules/catalog/pages/frontStore/categoryView/CategoryView.jsx +19 -2
  169. package/src/modules/catalog/pages/frontStore/categoryView/Filter.scss +1 -0
  170. package/src/modules/catalog/pages/frontStore/categoryView/General.jsx +6 -8
  171. package/src/modules/catalog/pages/frontStore/categoryView/General.scss +0 -2
  172. package/src/modules/catalog/pages/frontStore/categoryView/Pagination.jsx +6 -0
  173. package/src/modules/catalog/pages/frontStore/categoryView/Products.jsx +8 -1
  174. package/src/modules/catalog/pages/frontStore/categoryView/route.json +2 -1
  175. package/src/modules/catalog/pages/frontStore/productView/Description.jsx +15 -4
  176. package/src/modules/catalog/pages/frontStore/productView/Form.jsx +4 -4
  177. package/src/modules/catalog/pages/frontStore/productView/Form.scss +1 -0
  178. package/src/modules/catalog/pages/frontStore/productView/GeneralInfo.jsx +1 -1
  179. package/src/modules/catalog/pages/frontStore/productView/Images.jsx +1 -1
  180. package/src/modules/catalog/pages/frontStore/productView/Layout.jsx +1 -1
  181. package/src/modules/catalog/pages/frontStore/productView/Options.jsx +7 -3
  182. package/src/modules/catalog/pages/frontStore/productView/Variants.jsx +6 -6
  183. package/src/modules/catalog/pages/frontStore/productView/route.json +2 -1
  184. package/src/modules/catalog/services/AttributeCollection.js +10 -10
  185. package/src/modules/catalog/services/AttributeGroupCollection.js +10 -10
  186. package/src/modules/catalog/services/CategoryCollection.js +10 -10
  187. package/src/modules/catalog/services/CollectionCollection.js +10 -10
  188. package/src/modules/catalog/services/registerCartItemProductUrlField.js +35 -0
  189. package/src/modules/catalog/services/registerCartItemVariantOptionsField.js +51 -0
  190. package/src/modules/catalog/services/registerDefaultCategoryCollectionFilters.js +16 -0
  191. package/src/modules/checkout/api/addShippingNote/[context]bodyParser[auth].js +5 -0
  192. package/src/modules/checkout/api/addShippingNote/payloadSchema.json +15 -0
  193. package/src/modules/checkout/api/addShippingNote/route.json +5 -0
  194. package/src/modules/checkout/api/addShippingNote/saveShippingNote.js +50 -0
  195. package/src/modules/checkout/api/createCart/createNewCart.js +28 -3
  196. package/src/modules/checkout/api/updateCartItemQty/[bodyParser]updateQty.js +49 -0
  197. package/src/modules/checkout/api/updateCartItemQty/[context]bodyParser[auth].js +5 -0
  198. package/src/modules/checkout/api/updateCartItemQty/payloadSchema.json +21 -0
  199. package/src/modules/checkout/api/updateCartItemQty/route.json +5 -0
  200. package/src/modules/checkout/api/updateMineCartItemQty/[context]bodyParser[auth].js +5 -0
  201. package/src/modules/checkout/api/updateMineCartItemQty/[detectCurrentCart]updateQty.js +51 -0
  202. package/src/modules/checkout/api/updateMineCartItemQty/[getCurrentCustomer]detectCurrentCart.js +32 -0
  203. package/src/modules/checkout/api/updateMineCartItemQty/payloadSchema.json +21 -0
  204. package/src/modules/checkout/api/updateMineCartItemQty/route.json +5 -0
  205. package/src/modules/checkout/bootstrap.js +27 -0
  206. package/src/modules/checkout/graphql/types/Cart/Cart.graphql +22 -3
  207. package/src/modules/checkout/graphql/types/Cart/Cart.resolvers.js +18 -2
  208. package/src/modules/checkout/graphql/types/CheckoutSetting/CheckoutSetting.graphql +3 -0
  209. package/src/modules/checkout/graphql/types/CheckoutSetting/CheckoutSetting.resolvers.js +7 -0
  210. package/src/modules/checkout/migration/Version-1.0.0.js +14 -0
  211. package/src/modules/checkout/migration/Version-1.0.6.js +201 -0
  212. package/src/modules/checkout/pages/admin/shippingSetting/ShippingSetting.jsx +2 -2
  213. package/src/modules/checkout/pages/frontStore/all/[context]detectCurrentCart[auth].js +5 -0
  214. package/src/modules/checkout/pages/frontStore/cart/ShoppingCart.jsx +20 -12
  215. package/src/modules/checkout/pages/frontStore/cart/Summary.jsx +34 -23
  216. package/src/modules/checkout/pages/frontStore/cart/route.json +2 -1
  217. package/src/modules/checkout/pages/frontStore/checkout/Checkout.jsx +5 -5
  218. package/src/modules/checkout/pages/frontStore/checkout/Checkout.scss +4 -0
  219. package/src/modules/checkout/pages/frontStore/checkout/ShippingMethods.jsx +2 -2
  220. package/src/modules/checkout/pages/frontStore/checkout/ShippingNote.jsx +105 -0
  221. package/src/modules/checkout/pages/frontStore/checkout/Summary.jsx +14 -14
  222. package/src/modules/checkout/pages/frontStore/checkout/SummaryMobile.jsx +12 -15
  223. package/src/modules/checkout/pages/frontStore/checkout/route.json +2 -1
  224. package/src/modules/checkout/pages/frontStore/checkoutSuccess/CheckoutSuccess.jsx +1 -1
  225. package/src/modules/checkout/pages/frontStore/checkoutSuccess/CheckoutSuccess.scss +4 -0
  226. package/src/modules/checkout/pages/frontStore/checkoutSuccess/CustomerInfo.jsx +30 -32
  227. package/src/modules/checkout/pages/frontStore/checkoutSuccess/ShippingNote.jsx +47 -0
  228. package/src/modules/checkout/pages/frontStore/checkoutSuccess/Summary.jsx +12 -15
  229. package/src/modules/checkout/pages/frontStore/checkoutSuccess/route.json +2 -1
  230. package/src/modules/checkout/services/cart/Cart.js +31 -27
  231. package/src/modules/checkout/services/cart/registerCartBaseFields.js +133 -41
  232. package/src/modules/checkout/services/cart/registerCartItemBaseFields.js +300 -374
  233. package/src/modules/checkout/services/toPrice.js +1 -1
  234. package/src/modules/checkout/tests/basicSetup.js +85 -0
  235. package/src/modules/checkout/tests/coupons.js +82 -0
  236. package/src/modules/checkout/tests/products.js +67 -0
  237. package/src/modules/checkout/tests/taxRates.js +3 -0
  238. package/src/modules/checkout/tests/unit/discountAmount.test.js +60 -0
  239. package/src/modules/checkout/tests/unit/grandTotal.test.js +83 -0
  240. package/src/modules/checkout/tests/unit/lineTotal.test.js +92 -0
  241. package/src/modules/checkout/tests/unit/lineTotalWithDiscount.test.js +103 -0
  242. package/src/modules/checkout/tests/unit/productPrice.test.js +69 -0
  243. package/src/modules/checkout/tests/unit/subTotal.test.js +85 -0
  244. package/src/modules/checkout/tests/unit/subTotalWithDiscount.test.js +117 -0
  245. package/src/modules/checkout/tests/unit/taxAmount.test.js +68 -0
  246. package/src/modules/checkout/tests/unit/taxAmountRounding.test.js +277 -0
  247. package/src/modules/cms/api/createWidget/[context]bodyParser[auth].js +5 -0
  248. package/src/modules/cms/api/createWidget/createWidget[finish].js +17 -0
  249. package/src/modules/cms/api/createWidget/finish[apiResponse].js +27 -0
  250. package/src/modules/cms/api/createWidget/payloadSchema.json +18 -0
  251. package/src/modules/cms/api/createWidget/route.json +5 -0
  252. package/src/modules/cms/api/deleteWidget/deleteWidget.js +27 -0
  253. package/src/modules/cms/api/deleteWidget/route.json +5 -0
  254. package/src/modules/cms/api/updateWidget/[context]bodyParser[auth].js +5 -0
  255. package/src/modules/cms/api/updateWidget/finish[apiResponse].js +27 -0
  256. package/src/modules/cms/api/updateWidget/payloadSchema.json +18 -0
  257. package/src/modules/cms/api/updateWidget/route.json +5 -0
  258. package/src/modules/cms/api/updateWidget/updateWidget[finish].js +17 -0
  259. package/src/modules/cms/bootstrap.js +223 -3
  260. package/src/modules/cms/graphql/types/CmsPage/CmsPage.graphql +1 -2
  261. package/src/modules/cms/graphql/types/CmsPage/CmsPage.resolvers.js +35 -1
  262. package/src/modules/cms/graphql/types/Widget/Widget.graphql +91 -0
  263. package/src/modules/cms/graphql/types/Widget/Widget.resolvers.js +142 -0
  264. package/src/modules/cms/migration/Version-1.1.0.js +22 -0
  265. package/src/modules/cms/migration/Version-1.1.1.js +103 -0
  266. package/src/modules/cms/pages/admin/adminNotFound/NotFound.jsx +4 -4
  267. package/src/modules/cms/pages/admin/all/CmsMenuGroup.jsx +12 -4
  268. package/src/modules/cms/pages/admin/all/Notification.scss +1 -1
  269. package/src/modules/cms/pages/admin/all/search/NoResult.jsx +2 -2
  270. package/src/modules/cms/pages/admin/all/search/Results.jsx +3 -3
  271. package/src/modules/cms/pages/admin/cmsPageEdit+cmsPageNew/FormContent.jsx +7 -9
  272. package/src/modules/cms/pages/admin/cmsPageEdit+cmsPageNew/General.jsx +3 -3
  273. package/src/modules/cms/pages/admin/cmsPageEdit+cmsPageNew/Seo.jsx +1 -1
  274. package/src/modules/cms/pages/admin/cmsPageEdit+cmsPageNew/Status.jsx +40 -0
  275. package/src/modules/cms/pages/admin/cmsPageGrid/Grid.jsx +3 -4
  276. package/src/modules/cms/pages/admin/dashboard/Layout.jsx +3 -3
  277. package/src/modules/cms/pages/admin/widgetEdit/WidgetForm.jsx +52 -0
  278. package/src/modules/cms/pages/admin/widgetEdit/index.js +36 -0
  279. package/src/modules/cms/pages/admin/widgetEdit/route.json +4 -0
  280. package/src/modules/cms/pages/admin/widgetEdit+widgetNew/FormContent.jsx +69 -0
  281. package/src/modules/cms/pages/admin/widgetEdit+widgetNew/FormContent.scss +7 -0
  282. package/src/modules/cms/pages/admin/widgetEdit+widgetNew/General.jsx +185 -0
  283. package/src/modules/cms/pages/admin/widgetEdit+widgetNew/PageHeading.jsx +37 -0
  284. package/src/modules/cms/pages/admin/widgetEdit+widgetNew/Setting.jsx +55 -0
  285. package/src/modules/cms/pages/admin/widgetGrid/Grid.jsx +415 -0
  286. package/src/modules/cms/pages/admin/widgetGrid/Heading.jsx +11 -0
  287. package/src/modules/cms/pages/admin/widgetGrid/NewWidgetButton.jsx +52 -0
  288. package/src/modules/cms/pages/admin/widgetGrid/index.js +15 -0
  289. package/src/modules/cms/pages/admin/widgetGrid/route.json +4 -0
  290. package/src/modules/cms/pages/admin/widgetNew/WidgetNewForm.jsx +60 -0
  291. package/src/modules/cms/pages/admin/widgetNew/index.js +11 -0
  292. package/src/modules/cms/pages/admin/widgetNew/route.json +4 -0
  293. package/src/modules/cms/pages/admin/widgetNew/typeValidate.js +21 -0
  294. package/src/modules/cms/pages/frontStore/all/Breadcrumb.jsx +1 -1
  295. package/src/modules/cms/pages/frontStore/all/Footer.jsx +2 -2
  296. package/src/modules/cms/pages/frontStore/all/Layout.jsx +3 -3
  297. package/src/modules/cms/pages/frontStore/all/Layout.scss +13 -0
  298. package/src/modules/cms/pages/frontStore/all/Logo.jsx +2 -2
  299. package/src/modules/cms/pages/frontStore/all/Logo.scss +2 -4
  300. package/src/modules/cms/pages/frontStore/all/Notification.scss +1 -1
  301. package/src/modules/cms/pages/frontStore/cmsPageView/Layout.jsx +2 -2
  302. package/src/modules/cms/pages/frontStore/cmsPageView/View.jsx +5 -3
  303. package/src/modules/cms/pages/frontStore/cmsPageView/index.js +6 -12
  304. package/src/modules/cms/pages/frontStore/cmsPageView/route.json +2 -1
  305. package/src/modules/cms/pages/frontStore/homepage/route.json +2 -1
  306. package/src/modules/cms/pages/frontStore/notFound/NotFound.jsx +4 -4
  307. package/src/modules/cms/pages/frontStore/notFound/route.json +2 -1
  308. package/src/modules/cms/pages/frontStore/staticAsset/[context]staticAssets[auth].js +1 -1
  309. package/src/modules/cms/services/CMSPageCollection.js +10 -10
  310. package/src/modules/cms/services/WidgetCollection.js +62 -0
  311. package/src/modules/cms/services/getWidgetsBaseQuery.js +7 -0
  312. package/src/modules/cms/services/page/createPage.js +1 -2
  313. package/src/modules/cms/services/page/pageDataSchema.json +0 -4
  314. package/src/modules/cms/services/registerDefaultWidgetCollectionFilters.js +62 -0
  315. package/src/modules/cms/services/tailwind.admin.config.js +22 -107
  316. package/src/modules/cms/services/tailwind.frontStore.config.js +23 -108
  317. package/src/modules/cms/services/widget/createWidget.js +73 -0
  318. package/src/modules/cms/services/widget/deleteWidget.js +49 -0
  319. package/src/modules/cms/services/widget/loadWidgetInstances.js +54 -0
  320. package/src/modules/cms/services/widget/updateWidget.js +86 -0
  321. package/src/modules/cms/services/widget/widgetDataSchema.json +29 -0
  322. package/src/modules/cod/pages/admin/paymentSetting/CODSetting.jsx +2 -2
  323. package/src/modules/cod/pages/frontStore/checkout/CashOnDelivery.jsx +1 -1
  324. package/src/modules/customer/bootstrap.js +21 -4
  325. package/src/modules/customer/pages/admin/customerEdit/CustomerEditForm.jsx +3 -3
  326. package/src/modules/customer/pages/admin/customerEdit+customerNew/OrderHistory.jsx +1 -1
  327. package/src/modules/customer/pages/admin/customerGrid/Grid.jsx +3 -3
  328. package/src/modules/customer/pages/frontStore/account/AccountDetails.jsx +3 -3
  329. package/src/modules/customer/pages/frontStore/account/Layout.jsx +3 -3
  330. package/src/modules/customer/pages/frontStore/account/OrderHistory.jsx +1 -1
  331. package/src/modules/customer/pages/frontStore/account/route.json +2 -1
  332. package/src/modules/customer/pages/frontStore/login/LoginForm.jsx +2 -2
  333. package/src/modules/customer/pages/frontStore/login/route.json +2 -1
  334. package/src/modules/customer/pages/frontStore/register/RegisterForm.jsx +2 -2
  335. package/src/modules/customer/pages/frontStore/register/route.json +2 -1
  336. package/src/modules/customer/pages/frontStore/resetPasswordPage/ResetPasswordForm.jsx +2 -2
  337. package/src/modules/customer/pages/frontStore/resetPasswordPage/route.json +2 -1
  338. package/src/modules/customer/pages/frontStore/updatePasswordPage/UpdatePasswordForm.jsx +3 -3
  339. package/src/modules/customer/pages/frontStore/updatePasswordPage/route.json +2 -1
  340. package/src/modules/customer/services/CustomerCollection.js +10 -10
  341. package/src/modules/customer/services/CustomerGroupCollection.js +10 -10
  342. package/src/modules/graphql/pages/global/[bodyParser]buildQuery[graphql].js +241 -6
  343. package/src/modules/graphql/pages/global/[buildQuery]graphql[notification].js +12 -8
  344. package/src/modules/oms/bootstrap.js +87 -3
  345. package/src/modules/oms/graphql/types/Order/Order.graphql +11 -2
  346. package/src/modules/oms/graphql/types/Order/Order.resolvers.js +7 -1
  347. package/src/modules/oms/pages/admin/dashboard/Bestsellers.jsx +2 -2
  348. package/src/modules/oms/pages/admin/dashboard/Lifetimesales.jsx +5 -5
  349. package/src/modules/oms/pages/admin/orderEdit/AddTrackingButton.jsx +1 -1
  350. package/src/modules/oms/pages/admin/orderEdit/Items.jsx +7 -7
  351. package/src/modules/oms/pages/admin/orderEdit/Layout.jsx +3 -3
  352. package/src/modules/oms/pages/admin/orderEdit/Payment.jsx +6 -6
  353. package/src/modules/oms/pages/admin/orderEdit/ShipButton.jsx +1 -1
  354. package/src/modules/oms/pages/admin/orderGrid/Grid.jsx +3 -3
  355. package/src/modules/oms/services/OrderCollection.js +10 -10
  356. package/src/modules/paypal/api/paypalCreateOrder/[bodyParser]createOrder.js +55 -24
  357. package/src/modules/paypal/pages/admin/paymentSetting/PaypalSetting.jsx +6 -6
  358. package/src/modules/paypal/pages/frontStore/checkout/Paypal.jsx +3 -4
  359. package/src/modules/promotion/bootstrap.js +19 -101
  360. package/src/modules/promotion/pages/admin/couponEdit+couponNew/DiscountType.jsx +1 -1
  361. package/src/modules/promotion/pages/admin/couponEdit+couponNew/FormContent.jsx +5 -5
  362. package/src/modules/promotion/pages/admin/couponGrid/Grid.jsx +3 -3
  363. package/src/modules/promotion/pages/frontStore/cart/Coupon.jsx +2 -2
  364. package/src/modules/promotion/services/CouponCollection.js +10 -10
  365. package/src/modules/promotion/services/couponValidator.js +4 -7
  366. package/src/modules/promotion/services/discountCalculator.js +2 -7
  367. package/src/modules/promotion/services/registerCartItemPromotionFields.js +80 -0
  368. package/src/modules/promotion/services/registerCartPromotionFields.js +128 -0
  369. package/src/modules/promotion/services/registerDefaultCalculators.js +48 -20
  370. package/src/modules/promotion/services/registerDefaultValidators.js +16 -4
  371. package/src/modules/setting/pages/admin/paymentSetting/PaymentSetting.jsx +2 -2
  372. package/src/modules/setting/pages/admin/storeSetting/StoreSetting.jsx +98 -35
  373. package/src/modules/stripe/pages/admin/paymentSetting/StripePayment.jsx +5 -5
  374. package/src/modules/stripe/pages/frontStore/checkout/Stripe.jsx +1 -1
  375. package/src/modules/tax/bootstrap.js +40 -5
  376. package/src/modules/tax/graphql/types/Product/Price/ProductPrice.resolvers.js +6 -39
  377. package/src/modules/tax/graphql/types/TaxSetting/TaxSetting.graphql +1 -2
  378. package/src/modules/tax/graphql/types/TaxSetting/TaxSetting.resolvers.js +1 -8
  379. package/src/modules/tax/pages/admin/taxSetting/TaxSetting.jsx +4 -4
  380. package/src/modules/tax/services/TaxClassCollection.js +10 -10
  381. package/src/modules/tax/services/calculateTaxAmount.js +12 -9
  382. package/src/modules/tax/services/registerCartItemTaxPercentField.js +76 -0
  383. package/src/modules/auth/services/adminSessionMiddleware.js +0 -0
  384. package/src/modules/catalog/pages/frontStore/homepage/FeaturedCategories.jsx +0 -58
  385. package/src/modules/cms/pages/admin/cmsPageEdit+cmsPageNew/StatusAndLayout.jsx +0 -61
  386. package/src/modules/cms/pages/frontStore/all/Menu.jsx +0 -46
  387. package/src/modules/cms/pages/frontStore/all/Menu.scss +0 -7
  388. package/src/modules/cms/pages/frontStore/all/MobileMenu.jsx +0 -73
  389. package/src/modules/cms/pages/frontStore/all/MobileMenu.scss +0 -35
  390. package/src/modules/cms/pages/frontStore/homepage/MainBanner.jsx +0 -31
  391. package/src/modules/cms/pages/frontStore/homepage/MainBanner.scss +0 -48
@@ -21,9 +21,13 @@ module.exports = exports = async (connection) => {
21
21
  "discount_amount" decimal(12,4) DEFAULT NULL,
22
22
  "sub_total" decimal(12,4) NOT NULL,
23
23
  "sub_total_incl_tax" decimal(12,4) NOT NULL,
24
+ "sub_total_with_discount" decimal(12,4) NOT NULL,
25
+ "sub_total_with_discount_incl_tax" decimal(12,4) NOT NULL,
24
26
  "total_qty" INT NOT NULL,
25
27
  "total_weight" decimal(12,4) DEFAULT NULL,
26
28
  "tax_amount" decimal(12,4) NOT NULL,
29
+ "tax_amount_before_discount" decimal(12,4) NOT NULL,
30
+ "shipping_tax_amount" decimal(12,4) NOT NULL,
27
31
  "grand_total" decimal(12,4) NOT NULL,
28
32
  "shipping_method" varchar DEFAULT NULL,
29
33
  "shipping_method_name" varchar DEFAULT NULL,
@@ -75,9 +79,12 @@ module.exports = exports = async (connection) => {
75
79
  "final_price_incl_tax" decimal(12,4) NOT NULL,
76
80
  "tax_percent" decimal(12,4) NOT NULL,
77
81
  "tax_amount" decimal(12,4) NOT NULL,
82
+ "tax_amount_before_discount" decimal(12,4) NOT NULL,
78
83
  "discount_amount" decimal(12,4) NOT NULL,
79
84
  "sub_total" decimal(12,4) NOT NULL,
85
+ "line_total_with_discount" decimal(12,4) NOT NULL,
80
86
  "total" decimal(12,4) NOT NULL,
87
+ "line_total_with_discount_incl_tax" decimal(12,4) NOT NULL,
81
88
  "variant_group_id" INT DEFAULT NULL,
82
89
  "variant_options" text DEFAULT NULL,
83
90
  "product_custom_options" text DEFAULT NULL,
@@ -118,9 +125,13 @@ module.exports = exports = async (connection) => {
118
125
  "discount_amount" decimal(12,4) DEFAULT NULL,
119
126
  "sub_total" decimal(12,4) NOT NULL,
120
127
  "sub_total_incl_tax" decimal(12,4) NOT NULL,
128
+ "sub_total_with_discount" decimal(12,4) NOT NULL,
129
+ "sub_total_with_discount_incl_tax" decimal(12,4) NOT NULL,
121
130
  "total_qty" INT NOT NULL,
122
131
  "total_weight" decimal(12,4) DEFAULT NULL,
123
132
  "tax_amount" decimal(12,4) NOT NULL,
133
+ "tax_amount_before_discount" decimal(12,4) NOT NULL,
134
+ "shipping_tax_amount" decimal(12,4) NOT NULL,
124
135
  "shipping_note" text DEFAULT NULL,
125
136
  "grand_total" decimal(12,4) NOT NULL,
126
137
  "shipping_method" varchar DEFAULT NULL,
@@ -194,9 +205,12 @@ module.exports = exports = async (connection) => {
194
205
  "final_price_incl_tax" decimal(12,4) NOT NULL,
195
206
  "tax_percent" decimal(12,4) NOT NULL,
196
207
  "tax_amount" decimal(12,4) NOT NULL,
208
+ "tax_amount_before_discount" decimal(12,4) NOT NULL,
197
209
  "discount_amount" decimal(12,4) NOT NULL,
198
210
  "sub_total" decimal(12,4) NOT NULL,
211
+ "line_total_with_discount" decimal(12,4) NOT NULL,
199
212
  "total" decimal(12,4) NOT NULL,
213
+ "line_total_with_discount_incl_tax" decimal(12,4) NOT NULL,
200
214
  "variant_group_id" INT DEFAULT NULL,
201
215
  "variant_options" text DEFAULT NULL,
202
216
  "product_custom_options" text DEFAULT NULL,
@@ -0,0 +1,201 @@
1
+ const { execute } = require('@evershop/postgres-query-builder');
2
+
3
+ // eslint-disable-next-line no-multi-assign
4
+ module.exports = exports = async (connection) => {
5
+ // Rename sub_total column to line_total
6
+ await execute(
7
+ connection,
8
+ `ALTER TABLE "cart_item" RENAME COLUMN sub_total TO line_total`
9
+ );
10
+
11
+ await execute(
12
+ connection,
13
+ `ALTER TABLE "order_item" RENAME COLUMN sub_total TO line_total`
14
+ );
15
+
16
+ // Rename total column to line_total_incl_tax
17
+ await execute(
18
+ connection,
19
+ `ALTER TABLE "cart_item" RENAME COLUMN total TO line_total_incl_tax`
20
+ );
21
+
22
+ await execute(
23
+ connection,
24
+ `ALTER TABLE "order_item" RENAME COLUMN total TO line_total_incl_tax`
25
+ );
26
+
27
+ // Add a column 'tax_amount_before_discount' to the cart item table if it does not exist
28
+ await execute(
29
+ connection,
30
+ 'ALTER TABLE "cart_item" ADD COLUMN IF NOT EXISTS "tax_amount_before_discount" decimal(12,4)'
31
+ );
32
+
33
+ // Add a column 'tax_amount_before_discount' to the order item table if it does not exist
34
+ await execute(
35
+ connection,
36
+ 'ALTER TABLE "order_item" ADD COLUMN IF NOT EXISTS "tax_amount_before_discount" decimal(12,4)'
37
+ );
38
+
39
+ // Add a column 'tax_amount_before_discount' to the cart table if it does not exist
40
+ await execute(
41
+ connection,
42
+ 'ALTER TABLE "cart" ADD COLUMN IF NOT EXISTS "tax_amount_before_discount" decimal(12,4)'
43
+ );
44
+
45
+ // Add a column 'tax_amount_before_discount' to the order table if it does not exist
46
+ await execute(
47
+ connection,
48
+ 'ALTER TABLE "order" ADD COLUMN IF NOT EXISTS "tax_amount_before_discount" decimal(12,4)'
49
+ );
50
+
51
+ // Add a column 'line_total_with_discount' to the cart item table if it does not exist
52
+ await execute(
53
+ connection,
54
+ 'ALTER TABLE "cart_item" ADD COLUMN IF NOT EXISTS "line_total_with_discount" decimal(12,4)'
55
+ );
56
+
57
+ // Add a column 'line_total_with_discount_incl_tax' to the cart item table if it does not exist
58
+ await execute(
59
+ connection,
60
+ 'ALTER TABLE "cart_item" ADD COLUMN IF NOT EXISTS "line_total_with_discount_incl_tax" decimal(12,4)'
61
+ );
62
+
63
+ // Add a column 'line_total_with_discount' to the order item table if it does not exist
64
+ await execute(
65
+ connection,
66
+ 'ALTER TABLE "order_item" ADD COLUMN IF NOT EXISTS "line_total_with_discount" decimal(12,4)'
67
+ );
68
+
69
+ // Add a column 'line_total_with_discount_incl_tax' to the order item table if it does not exist
70
+ await execute(
71
+ connection,
72
+ 'ALTER TABLE "order_item" ADD COLUMN IF NOT EXISTS "line_total_with_discount_incl_tax" decimal(12,4)'
73
+ );
74
+
75
+ // Add a column 'sub_total_with_discount' to the cart table if it does not exist
76
+ await execute(
77
+ connection,
78
+ 'ALTER TABLE "cart" ADD COLUMN IF NOT EXISTS "sub_total_with_discount" decimal(12,4)'
79
+ );
80
+
81
+ // Add a column 'sub_total_with_discount' to the order table if it does not exist
82
+ await execute(
83
+ connection,
84
+ 'ALTER TABLE "order" ADD COLUMN IF NOT EXISTS "sub_total_with_discount" decimal(12,4)'
85
+ );
86
+
87
+ // Add a column 'sub_total_with_discount_incl_tax' to the cart table if it does not exist
88
+ await execute(
89
+ connection,
90
+ 'ALTER TABLE "cart" ADD COLUMN IF NOT EXISTS "sub_total_with_discount_incl_tax" decimal(12,4)'
91
+ );
92
+
93
+ // Add a column 'sub_total_with_discount_incl_tax' to the order table if it does not exist
94
+ await execute(
95
+ connection,
96
+ 'ALTER TABLE "order" ADD COLUMN IF NOT EXISTS "sub_total_with_discount_incl_tax" decimal(12,4)'
97
+ );
98
+
99
+ // Add a column 'shipping_tax_amount' to the cart table if it does not exist
100
+ await execute(
101
+ connection,
102
+ 'ALTER TABLE "cart" ADD COLUMN IF NOT EXISTS "shipping_tax_amount" decimal(12,4)'
103
+ );
104
+
105
+ // Add a column 'shipping_tax_amount' to the order table if it does not exist
106
+ await execute(
107
+ connection,
108
+ 'ALTER TABLE "order" ADD COLUMN IF NOT EXISTS "shipping_tax_amount" decimal(12,4)'
109
+ );
110
+
111
+ // Calculate the value for the new columns 'tax_amount_before_discount', 'line_total_with_discount', 'line_total_with_discount_incl_tax', 'sub_total'
112
+
113
+ await execute(
114
+ connection,
115
+ `UPDATE "cart_item" SET tax_amount_before_discount = ROUND(COALESCE(final_price, 0) * (COALESCE(tax_percent, 0) / 100), 2) * qty`
116
+ );
117
+
118
+ await execute(
119
+ connection,
120
+ `UPDATE "order_item" SET tax_amount_before_discount = ROUND(COALESCE(final_price, 0) * (COALESCE(tax_percent, 0) / 100), 2) * qty`
121
+ );
122
+
123
+ // Calculate the tax_amount_before_discount on cart and order by summing up the tax_amount_before_discount of all items
124
+ await execute(
125
+ connection,
126
+ `UPDATE "cart" SET tax_amount_before_discount = (SELECT SUM(tax_amount_before_discount) FROM cart_item WHERE cart_item.cart_id = cart.cart_id)`
127
+ );
128
+
129
+ await execute(
130
+ connection,
131
+ `UPDATE "order" SET tax_amount_before_discount = (SELECT SUM(tax_amount_before_discount) FROM "order_item" WHERE "order_item".order_item_order_id = "order".order_id)`
132
+ );
133
+
134
+ await execute(
135
+ connection,
136
+ `UPDATE "cart_item" SET line_total_with_discount = line_total`
137
+ );
138
+
139
+ await execute(
140
+ connection,
141
+ `UPDATE "cart_item" SET line_total = COALESCE(final_price, 0) * qty`
142
+ );
143
+
144
+ await execute(
145
+ connection,
146
+ `UPDATE "order_item" SET line_total_with_discount = line_total`
147
+ );
148
+
149
+ await execute(
150
+ connection,
151
+ `UPDATE "order_item" SET line_total = COALESCE(final_price, 0) * qty`
152
+ );
153
+
154
+ await execute(
155
+ connection,
156
+ `UPDATE "cart_item" SET line_total_with_discount_incl_tax = line_total_with_discount + tax_amount`
157
+ );
158
+
159
+ await execute(
160
+ connection,
161
+ `UPDATE "order_item" SET line_total_with_discount_incl_tax = line_total_with_discount + tax_amount`
162
+ );
163
+
164
+ await execute(
165
+ connection,
166
+ `UPDATE "cart" SET sub_total_with_discount = (SELECT SUM(line_total_with_discount) FROM cart_item WHERE cart_item.cart_id = cart.cart_id)`
167
+ );
168
+
169
+ await execute(
170
+ connection,
171
+ `UPDATE "order" SET sub_total_with_discount = (SELECT SUM(line_total_with_discount) FROM "order_item" WHERE "order_item".order_item_order_id = "order".order_id)`
172
+ );
173
+
174
+ await execute(
175
+ connection,
176
+ `UPDATE "cart" SET sub_total_with_discount_incl_tax = sub_total_with_discount + tax_amount`
177
+ );
178
+
179
+ await execute(
180
+ connection,
181
+ `UPDATE "order" SET sub_total_with_discount_incl_tax = sub_total_with_discount + tax_amount`
182
+ );
183
+
184
+ // Add a column 'total_tax_amount' to the cart table if it does not exist
185
+ await execute(
186
+ connection,
187
+ 'ALTER TABLE "cart" ADD COLUMN IF NOT EXISTS "total_tax_amount" decimal(12,4)'
188
+ );
189
+
190
+ // Update the value for the new column 'total_tax_amount' on the cart table get value from the `tax_amount` column
191
+ await execute(connection, `UPDATE "cart" SET total_tax_amount = tax_amount`);
192
+
193
+ // Add a column 'total_tax_amount' to the order table if it does not exist
194
+ await execute(
195
+ connection,
196
+ 'ALTER TABLE "order" ADD COLUMN IF NOT EXISTS "total_tax_amount" decimal(12,4)'
197
+ );
198
+
199
+ // Update the value for the new column 'total_tax_amount' on the cart table get value from the `tax_amount` column
200
+ await execute(connection, `UPDATE "order" SET total_tax_amount = tax_amount`);
201
+ };
@@ -90,14 +90,14 @@ export default function ShippingSetting({ createShippingZoneApi }) {
90
90
 
91
91
  return (
92
92
  <div className="main-content-inner">
93
- <div className="grid grid-cols-6 gap-x-2 grid-flow-row ">
93
+ <div className="grid grid-cols-6 gap-x-8 grid-flow-row ">
94
94
  <div className="col-span-2">
95
95
  <SettingMenu />
96
96
  </div>
97
97
  <div className="col-span-4">
98
98
  {countriesQueryData.fetching || zonesQueryData.fetching ? (
99
99
  <Card.Session title="Shipping">
100
- <div className="flex justify-center p-2">
100
+ <div className="flex justify-center p-8">
101
101
  <Spinner width={25} height={25} />
102
102
  </div>
103
103
  </Card.Session>
@@ -3,6 +3,8 @@ const { pool } = require('@evershop/evershop/src/lib/postgres/connection');
3
3
  const {
4
4
  setContextValue
5
5
  } = require('../../../../graphql/services/contextHelper');
6
+ const { getCartByUUID } = require('../../../services/getCartByUUID');
7
+ const { saveCart } = require('../../../services/saveCart');
6
8
 
7
9
  module.exports = async (request, response, delegate, next) => {
8
10
  // Check if any cart is associated with the session id
@@ -13,6 +15,9 @@ module.exports = async (request, response, delegate, next) => {
13
15
  .load(pool);
14
16
 
15
17
  if (cart) {
18
+ const cartObject = await getCartByUUID(cart.uuid);
19
+ // Save the cart
20
+ await saveCart(cartObject);
16
21
  setContextValue(request, 'cartId', cart.uuid);
17
22
  } else {
18
23
  // Get the customer id from the session
@@ -12,8 +12,8 @@ function Title({ title }) {
12
12
  if (items.length <= 0) return null;
13
13
 
14
14
  return (
15
- <div className="mb-3 text-center shopping-cart-heading">
16
- <h1 className="shopping-cart-title mb-05">{title}</h1>
15
+ <div className="mb-12 text-center shopping-cart-heading">
16
+ <h1 className="shopping-cart-title mb-2">{title}</h1>
17
17
  <a href="/" className="underline">
18
18
  {_('Continue Shopping')}
19
19
  </a>
@@ -25,7 +25,7 @@ Title.propTypes = {
25
25
  title: PropTypes.string.isRequired
26
26
  };
27
27
 
28
- export default function ShoppingCart({ cart, setting, removeUrl }) {
28
+ export default function ShoppingCart({ cart, setting }) {
29
29
  const { totalQty = 0, items = [] } = cart || {};
30
30
  if (totalQty <= 0) {
31
31
  return <Empty />;
@@ -46,14 +46,14 @@ export default function ShoppingCart({ cart, setting, removeUrl }) {
46
46
  ]}
47
47
  />
48
48
  <div className="cart-page-middle">
49
- <div className="grid gap-4 grid-cols-1 md:grid-cols-4">
49
+ <div className="grid gap-16 grid-cols-1 md:grid-cols-4">
50
50
  <Area
51
51
  id="shoppingCartLeft"
52
52
  className="col-span-1 md:col-span-3"
53
53
  coreComponents={[
54
54
  {
55
55
  component: { default: Items },
56
- props: { items, setting, cartId: cart.uuid, removeUrl },
56
+ props: { items, setting },
57
57
  sortOrder: 10,
58
58
  id: 'shoppingCartTitle'
59
59
  }
@@ -77,14 +77,13 @@ ShoppingCart.propTypes = {
77
77
  uuid: PropTypes.string.isRequired
78
78
  }).isRequired,
79
79
  setting: PropTypes.shape({
80
- displayCheckoutPriceIncludeTax: PropTypes.bool
81
- }).isRequired,
82
- removeUrl: PropTypes.string.isRequired
80
+ priceIncludingTax: PropTypes.bool
81
+ }).isRequired
83
82
  };
84
83
 
85
84
  export const layout = {
86
85
  areaId: 'content',
87
- sortOrder: 1
86
+ sortOrder: 10
88
87
  };
89
88
 
90
89
  export const query = `
@@ -116,20 +115,29 @@ export const query = `
116
115
  value
117
116
  text
118
117
  }
119
- subTotal {
118
+ lineTotal {
119
+ value
120
+ text
121
+ }
122
+ lineTotal {
123
+ value
124
+ text
125
+ }
126
+ lineTotalInclTax {
120
127
  value
121
128
  text
122
129
  }
123
- total {
130
+ lineTotalInclTax {
124
131
  value
125
132
  text
126
133
  }
127
134
  removeApi
135
+ updateQtyApi
128
136
  errors
129
137
  }
130
138
  }
131
139
  setting {
132
- displayCheckoutPriceIncludeTax
140
+ priceIncludingTax
133
141
  }
134
142
  }
135
143
  `;
@@ -8,7 +8,7 @@ import { Total } from '@components/frontStore/checkout/checkout/summary/cart/Tot
8
8
 
9
9
  function Subtotal({ subTotal }) {
10
10
  return (
11
- <div className="flex justify-between gap-3">
11
+ <div className="flex justify-between gap-12">
12
12
  <div>{_('Sub total')}</div>
13
13
  <div className="text-right">{subTotal.text}</div>
14
14
  </div>
@@ -16,11 +16,17 @@ function Subtotal({ subTotal }) {
16
16
  }
17
17
 
18
18
  Subtotal.propTypes = {
19
- subTotal: PropTypes.number
19
+ subTotal: PropTypes.shape({
20
+ value: PropTypes.number,
21
+ text: PropTypes.string
22
+ })
20
23
  };
21
24
 
22
25
  Subtotal.defaultProps = {
23
- subTotal: 0
26
+ subTotal: {
27
+ value: 0,
28
+ text: ''
29
+ }
24
30
  };
25
31
 
26
32
  function Discount({ discountAmount, coupon }) {
@@ -28,7 +34,7 @@ function Discount({ discountAmount, coupon }) {
28
34
  return null;
29
35
  }
30
36
  return (
31
- <div className="flex justify-between gap-3">
37
+ <div className="flex justify-between gap-12">
32
38
  <div>{_('Discount(${coupon})', { coupon })}</div>
33
39
  <div className="text-right">{discountAmount.text}</div>
34
40
  </div>
@@ -36,12 +42,18 @@ function Discount({ discountAmount, coupon }) {
36
42
  }
37
43
 
38
44
  Discount.propTypes = {
39
- discountAmount: PropTypes.number,
45
+ discountAmount: PropTypes.shape({
46
+ value: PropTypes.number,
47
+ text: PropTypes.string
48
+ }),
40
49
  coupon: PropTypes.string
41
50
  };
42
51
 
43
52
  Discount.defaultProps = {
44
- discountAmount: 0,
53
+ discountAmount: {
54
+ value: 0,
55
+ text: ''
56
+ },
45
57
  coupon: ''
46
58
  };
47
59
 
@@ -51,19 +63,19 @@ function Summary({
51
63
  totalQty,
52
64
  subTotal,
53
65
  subTotalInclTax,
54
- taxAmount,
66
+ totalTaxAmount,
55
67
  grandTotal,
56
68
  coupon,
57
69
  discountAmount
58
70
  },
59
- setting: { displayCheckoutPriceIncludeTax }
71
+ setting: { priceIncludingTax }
60
72
  }) {
61
73
  if (totalQty === undefined || totalQty <= 0) {
62
74
  return null;
63
75
  }
64
76
  return (
65
77
  <div className="summary">
66
- <div className="grid grid-cols-1 gap-2">
78
+ <div className="grid grid-cols-1 gap-8">
67
79
  <h4>{_('Order summary')}</h4>
68
80
  <Area
69
81
  id="shoppingCartSummary"
@@ -72,9 +84,7 @@ function Summary({
72
84
  {
73
85
  component: { default: Subtotal },
74
86
  props: {
75
- subTotal: displayCheckoutPriceIncludeTax
76
- ? subTotalInclTax
77
- : subTotal
87
+ subTotal: priceIncludingTax ? subTotalInclTax : subTotal
78
88
  },
79
89
  sortOrder: 10,
80
90
  id: 'shoppingCartSubtotal'
@@ -88,10 +98,10 @@ function Summary({
88
98
  {
89
99
  // eslint-disable-next-line react/no-unstable-nested-components
90
100
  component: {
91
- default: displayCheckoutPriceIncludeTax ? () => null : Tax
101
+ default: priceIncludingTax ? () => null : Tax
92
102
  },
93
103
  props: {
94
- amount: taxAmount.text
104
+ amount: totalTaxAmount.text
95
105
  },
96
106
  sortOrder: 30,
97
107
  id: 'tax'
@@ -103,8 +113,8 @@ function Summary({
103
113
  },
104
114
  props: {
105
115
  total: grandTotal.text,
106
- taxAmount: taxAmount.text,
107
- displayCheckoutPriceIncludeTax
116
+ totalTaxAmount: totalTaxAmount.text,
117
+ priceIncludingTax
108
118
  },
109
119
  sortOrder: 30,
110
120
  id: 'tax'
@@ -112,7 +122,7 @@ function Summary({
112
122
  ]}
113
123
  />
114
124
  </div>
115
- <div className="shopping-cart-checkout-btn flex justify-between mt-2">
125
+ <div className="shopping-cart-checkout-btn flex justify-between mt-8">
116
126
  <Button url={checkoutUrl} title={_('CHECKOUT')} variant="primary" />
117
127
  </div>
118
128
  </div>
@@ -131,7 +141,7 @@ Summary.propTypes = {
131
141
  value: PropTypes.number,
132
142
  text: PropTypes.string
133
143
  }),
134
- taxAmount: PropTypes.shape({
144
+ totalTaxAmount: PropTypes.shape({
135
145
  value: PropTypes.number,
136
146
  text: PropTypes.string
137
147
  }),
@@ -146,7 +156,7 @@ Summary.propTypes = {
146
156
  })
147
157
  }).isRequired,
148
158
  setting: PropTypes.shape({
149
- displayCheckoutPriceIncludeTax: PropTypes.bool
159
+ priceIncludingTax: PropTypes.bool
150
160
  }).isRequired
151
161
  };
152
162
 
@@ -165,15 +175,16 @@ export const query = `
165
175
  value
166
176
  text
167
177
  }
168
- grandTotal {
178
+ subTotalInclTax {
169
179
  value
170
180
  text
171
181
  }
172
- subTotalInclTax {
182
+ grandTotal {
173
183
  value
174
184
  text
175
185
  }
176
- taxAmount {
186
+
187
+ totalTaxAmount {
177
188
  value
178
189
  text
179
190
  }
@@ -184,7 +195,7 @@ export const query = `
184
195
  coupon
185
196
  }
186
197
  setting {
187
- displayCheckoutPriceIncludeTax
198
+ priceIncludingTax
188
199
  }
189
200
  checkoutUrl: url(routeId: "checkout")
190
201
  }
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "methods": ["GET"],
3
- "path": "/cart"
3
+ "path": "/cart",
4
+ "name": "Cart page"
4
5
  }
@@ -20,7 +20,7 @@ function Steps() {
20
20
  function Breadcrumb() {
21
21
  const steps = useCheckoutSteps();
22
22
  return (
23
- <div className="mb-2 mt-1 flex checkout-breadcrumb">
23
+ <div className="mb-8 mt-4 flex checkout-breadcrumb">
24
24
  {steps.map((step, index) => {
25
25
  const separator =
26
26
  index < steps.length - 1 ? (
@@ -57,12 +57,12 @@ function CompletedSteps() {
57
57
  }
58
58
 
59
59
  return (
60
- <div className="mt-1">
61
- <div className="checkout-completed-steps border rounded px-2 border-divider divide-y">
60
+ <div className="mt-4">
61
+ <div className="checkout-completed-steps border rounded px-8 border-divider divide-y">
62
62
  {completedSteps.map((step) => (
63
63
  <div
64
64
  key={step.id}
65
- className="grid gap-1 grid-cols-4 py-1 border-divider"
65
+ className="grid gap-4 grid-cols-4 py-4 border-divider"
66
66
  >
67
67
  <div className="col-span-1">
68
68
  <span>{step.previewTitle}</span>
@@ -105,7 +105,7 @@ export default function CheckoutPage({
105
105
  getPaymentMethodAPI={getPaymentMethodAPI}
106
106
  checkoutSuccessUrl={checkoutSuccessUrl}
107
107
  >
108
- <div className="page-width grid grid-cols-1 md:grid-cols-2 gap-3">
108
+ <div className="page-width grid grid-cols-1 md:grid-cols-2 gap-12">
109
109
  <Area
110
110
  id="checkoutPageLeft"
111
111
  coreComponents={[
@@ -38,3 +38,7 @@
38
38
  .checkout-breadcrumb {
39
39
  font-size: 12px;
40
40
  }
41
+
42
+ .breadcrumb {
43
+ display: none;
44
+ }
@@ -172,7 +172,7 @@ export default function ShippingMethods({
172
172
  </svg>
173
173
  </div>
174
174
  )}
175
- <h4 className="mt-3 mb-1">{_('Shipping Method')}</h4>
175
+ <h4 className="mt-12 mb-4">{_('Shipping Method')}</h4>
176
176
  {addressProvided === true && methods.length === 0 && (
177
177
  <div className="text-center p-3 border border-divider rounded text-textSubdued">
178
178
  {_('Sorry, there is no available method for your address')}
@@ -184,7 +184,7 @@ export default function ShippingMethods({
184
184
  </div>
185
185
  )}
186
186
  {methods.length > 0 && (
187
- <div className="divide-y border rounded border-divider p-1 mb-2">
187
+ <div className="divide-y border rounded border-divider p-4 mb-8">
188
188
  <Field
189
189
  type="radio"
190
190
  name="method"