From 68996d193ffd4728dbb17a245210811dcd64f85f Mon Sep 17 00:00:00 2001 From: "J.F. Larente" Date: Thu, 21 Jun 2018 06:49:48 -0400 Subject: [PATCH] Committing latest 9.0.1.9 changes --- HabitatHome.Commerce.sln | 10 + .../Commerce/Feature.Cart.config | 9 +- .../habitathome.feature.cart.billing.model.js | 627 ++++++++++++++++++ ...re.HabitatHome.Feature.Cart.Website.csproj | 1 + .../Feature/Commerce/Feature.Catalog.config | 2 +- .../Feature.Catalog.config | 10 + .../Repositories/BreadcrumbRepository.cs | 109 +++ .../Repositories/FakeBreadcrumbRepository.cs | 21 + .../RegisterCatalogServices.cs | 31 + ...HabitatHome.Feature.Catalog.Website.csproj | 21 + .../Views/NearestStore/NearestStore.cshtml | 71 +- .../website/Views/Orders/OrderReview.cshtml | 81 +-- .../ProductBundle/AddBundleToCart.cshtml | 197 +++--- .../Views/ProductBundle/ProductBundle.cshtml | 84 +-- .../engine/Commands/SampleCommand.cs | 61 -- .../engine/Components/SampleComponent.cs | 27 - .../engine/Controllers/CommandsController.cs | 51 -- .../engine/Controllers/SampleController.cs | 64 -- .../engine/Entities/SampleEntity.cs | 51 -- .../ProductKit/engine/Models/SampleModel.cs | 35 - .../Pipelines/Arguments/SampleArgument.cs | 40 -- .../engine/Pipelines/Blocks/SampleBlock.cs | 48 -- .../engine/Pipelines/ISamplePipeline.cs | 27 - .../engine/Pipelines/SamplePipeline.cs | 40 -- .../engine/Policies/SamplePolicy.cs | 26 - .../Views/ProductKit/ProductKit.cshtml | 67 +- .../Renderings/Product Related Content.yml | 14 + .../Product Related Content.yml | 24 + ...ProductRelatedContent.Serialization.config | 18 + .../Feature.ProductRelatedContent.config | 22 + .../ProductRelatedContentController.cs | 67 ++ .../Models/ProductDocumentJsonResult.cs | 16 + .../Models/RelatedProductJsonResult.cs | 16 + .../website/Properties/AssemblyInfo.cs | 35 + .../IProductRelatedContentRepository.cs | 21 + .../ProductRelatedContentRepository.cs | 128 ++++ ...bitathome.feature.productrelatedcontent.js | 208 ++++++ ...ature.ProductRelatedContent.Website.csproj | 194 ++++++ .../ProductRelatedContent.cshtml | 93 +++ .../website/Web.Debug.config | 30 + .../website/Web.Release.config | 31 + .../ProductRelatedContent/website/Web.config | 39 ++ .../website/packages.config | 12 + .../Commerce/Foundation.Catalog.config | 9 + .../Managers/IProductRelatedContentManager.cs | 14 + .../Managers/ProductRelatedContentManager.cs | 74 +++ ...itatHome.Foundation.Catalog.Website.csproj | 13 +- .../engine/wwwroot/bootstrap/Global.json | 2 +- .../Promo Body.yml | 15 +- .../child safety.yml | 2 +- .../energy-efficiency.yml | 2 +- .../over-clocking.yml | 2 +- .../Data/Hero.yml | 18 + .../Text Wrapper/Summary.yml | 15 +- .../Text Wrapper/Summary/Content.yml | 7 +- .../phones-tablets.yml | 2 +- .../tv-audio.yml | 2 +- .../serialization/Content/Habitat Home.yml | 7 +- .../Content/Habitat Home/Data/Commerce.yml | 13 + .../Health Page - Fitness Personalized.yml | 6 +- .../Data/Commerce/Product Related Content.yml | 14 + .../Product Related Content/6042183.yml | 14 + .../6042183/How To Video.yml | 38 ++ .../6042183/Installation Guide.yml | 38 ++ .../Contact Identification/Default/Phone.yml | 21 + ... Soon.yml => Fitness Tech Coming Soon.yml} | 17 +- .../Data/Promos/Guides Promos.yml | 11 + .../Promo - 10 Stretches To Use At Home.yml | 21 +- .../Promo - 6 Steps for Gaming.yml | 13 +- .../Promo - Appliance Trends.yml | 15 +- .../Promo - Are Laptops Obsolete.yml | 13 +- .../Promo - Best Wearable in Fitness Tech.yml | 43 ++ .../Promo - Ultimate Smart Home Checklist.yml | 15 +- .../Data/Promos/Promo - Trainer Finder.yml} | 18 +- .../Content/Habitat Home/Data/Snippets.yml | 40 ++ .../Data/Snippets/Full Width CTA - Left.yml | 64 ++ .../Snippets/Full Width CTA - Left/Data.yml | 29 + .../Data/Full CTA Promo.yml | 39 ++ .../Data/Snippets/Full Width CTA - Right.yml | 53 ++ .../Snippets/Full Width CTA - Right/Data.yml | 29 + .../Data/Full CTA Promo.yml | 39 ++ .../Data/Snippets/Newsletter Signup.yml | 29 + .../Snippets/Three Column Fitness Teasers.yml | 88 +++ .../Snippets/Two Column Fitness Teasers.yml | 70 ++ .../Data/Snippets/Two Column Promos.yml | 78 +++ .../Data/Snippets/Two Column Promos/Data.yml | 29 + .../Two Column Promos/Data/Left Promo.yml | 46 ++ .../Two Column Promos/Data/Right Promo.yml | 46 ++ .../Available Renderings/Composites.yml | 1 + .../Hero/Default/Hero Wrapper.yml | 4 + .../Default/Hero Wrapper/Text Wrapper.yml | 4 + .../Styles/Container/Clear Floats.yml | 95 +++ .../Content/Habitat Home/home.yml | 326 +++++++++ .../Content/Habitat Home/home/Data.yml | 11 + .../Default Image Carousel - Connect Home.yml | 11 + .../Slide1.yml | 11 + .../Slide2.yml | 11 + .../Slide3.yml | 11 + .../home/Data/Fitness Products.yml | 25 + .../Promo - Start Over Content Finder.yml | 11 + .../home/Data/Trainer Finder Promo.yml | 43 ++ .../Content/Habitat Home/home/Shop/_.yml | 18 +- .../Content/Habitat Home/home/Shop/_/_.yml | 39 +- .../Data/Home Installation CTA.yml | 2 +- .../register-fitness-tracker.yml | 108 ++- .../home/habitat-health/trainer-finder.yml | 74 +-- .../trainer-finder/recommendations.yml | 288 ++++---- .../Habitat Home/home/landing-pages.yml | 21 +- .../landing-pages/habitat-home-health.yml | 2 +- .../landing-pages/new-fitness-tracker.yml | 270 ++++++++ .../new-fitness-tracker/Data.yml | 29 + .../Data/Trainer Finder for mobile.yml | 39 ++ .../Data/Trainer Finder.yml | 39 ++ .../new-fitness-tracker/Data/Transparent.yml | 25 + .../home/landing-pages/sample-with-form.yml | 107 +++ .../landing-pages/sample-with-form/Data.yml | 34 + .../sample-with-form/Data/Page Hero.yml | 37 ++ .../home/landing-pages/sample.yml | 89 +++ .../home/landing-pages/sample/Data.yml | 29 + .../landing-pages/sample/Data/Page Hero.yml | 29 + .../sample/Data/Two Column Promos.yml | 67 ++ .../sample/Data/Two Column Promos/Data.yml | 29 + .../Two Column Promos/Data/Left Promo.yml | 46 ++ .../Two Column Promos/Data/Right Promo.yml | 46 ++ .../home/landing-pages/striva-is-here.yml | 2 +- .../Content/Habitat Home/home/product/_.yml | 9 + .../services/home-installation/Data/Hero.yml | 24 +- .../Data/Promo - Experts.yml | 2 +- .../Data/Promo- Schedule CTA.yml | 4 +- ...ome-installation-schedule-request-form.yml | 34 +- .../Forms/Lead Generation Form Template.yml | 72 ++ .../Lead Generation Form Template/Page.yml | 50 ++ .../Page/Email.yml | 90 +++ .../Page/FirstName.yml | 94 +++ .../Page/LastName.yml | 73 ++ .../Page/Submit Button.yml | 65 ++ .../Page/Submit Button/SubmitActions.yml | 29 + .../SubmitActions/Trigger Goal.yml | 55 ++ .../Page/Telephone.yml | 94 +++ .../Forms/Sample Lead Generation Form.yml | 72 ++ .../Sample Lead Generation Form/Page.yml | 50 ++ .../Page/Email.yml | 90 +++ .../Page/FirstName.yml | 94 +++ .../Page/LastName.yml | 73 ++ .../Page/Submit Button.yml | 65 ++ .../Page/Submit Button/SubmitActions.yml | 29 + .../SubmitActions/Identify Contact.yml | 40 ++ .../SubmitActions/Redirect to Page.yml | 55 ++ .../SubmitActions/Trigger Goal.yml | 55 ++ .../Page/Telephone.yml | 94 +++ .../Page/Section.yml | 2 +- .../Page/Section/Email.yml | 8 +- .../Page/Section/FirstName.yml | 62 ++ .../Page/Section/LastName.yml | 62 ++ .../Page/Section/Text.yml | 2 +- .../Text/SubmitActions/Identify Contact.yml} | 12 +- .../Section/Text/SubmitActions/Save Data.yml | 2 +- .../Identify Contact.yml | 40 ++ .../Redirect to Page.yml | 55 ++ .../Marketing.TestLab/Test Lab.yml | 63 ++ .../Marketing.TestLab/Test Lab/2018.yml | 14 + .../Marketing.TestLab/Test Lab/2018/06.yml | 14 + .../Marketing.TestLab/Test Lab/2018/06/06.yml | 14 + .../Test Lab/2018/06/06/19.yml | 14 + .../Test Lab/2018/06/06/19/03.yml | 14 + ...tracker F5DCC292AAEC4467AD477F2C72179F.yml | 65 ++ .../Test Lab/Emails.yml} | 31 +- .../Catalog Item Container.yml | 25 + .../Catalog Item Container/Blue.yml | 28 + .../Catalog Item Container/Green.yml | 28 + .../Catalog Item Container/Original.yml | 28 + .../Catalog Item Container/Purple.yml | 28 + .../Catalog Item Container/White.yml | 28 + .../Images/Health/Sydney Hero.yml | 48 -- .../Media/Habitat Home/Product Media.yml | 18 + .../Habitat Home/Product Media/7042066.yml | 18 + .../7042066/Unlocking-the-Smart-Home.yml | 37 ++ .../rfid-journal-article-smart-home.yml | 37 ++ .../Product Media/bundle_0000001.yml | 18 + .../Unlocking-the-Smart-Home.yml | 37 ++ .../Habitat Home Workflow.yml | 18 - .../Habitat Home Workflow/Approved.yml | 52 -- .../Approved/Auto Publish.yml | 40 -- .../Awaiting Approval.yml | 48 -- .../Awaiting Approval/Approve with Test.yml | 50 -- .../Approve with Test/Validation Action.yml | 52 -- .../Awaiting Approval/Approve.yml | 44 -- .../Approve/Validation Action.yml | 49 -- .../Awaiting Approval/Reject.yml | 44 -- .../Habitat Home Workflow/Draft/Submit.yml | 48 -- .../Habitat Home Workflow/Draft/__OnSave.yml | 51 -- .../Draft/__OnSave/Auto Submit Action.yml | 47 -- .../Templates.Branches/Habitat Home.yml | 11 + .../Habitat Home/Landing Page With Form.yml | 29 + .../Landing Page With Form/_name.yml | 83 +++ .../Landing Page With Form/_name/Data.yml | 34 + .../_name/Data/Page Hero.yml | 37 ++ .../Habitat Home/Landing Page.yml | 29 + .../Habitat Home/Landing Page/_name.yml | 64 ++ .../Habitat Home/Landing Page/_name/Data.yml | 29 + .../Landing Page/_name/Data/Page Hero.yml | 29 + .../_name/Data/Two Column Promos.yml | 63 ++ .../_name/Data/Two Column Promos/Data.yml | 29 + .../Two Column Promos/Data/Left Promo.yml | 46 ++ .../Two Column Promos/Data/Right Promo.yml | 46 ++ .../__Standard Values.yml | 23 + .../Product Related Content Item.yml | 18 + .../Product Related Content Item/Link.yml | 21 + .../Product Related Content Item/Tags.yml | 21 + .../Product Related Content Item/Title.yml | 21 + .../Store/Product Related Content.yml | 18 + .../Product Related Content Folder.yml | 29 + .../Product Related Content Item.yml | 26 + .../Product Related Content Repository.yml | 29 + .../__Standard Values.yml | 23 + .../ContentType.yml | 25 + .../Description.yml | 21 + .../Thumbnail.yml | 21 + .../commerce/product-bundle-component.yml | 6 +- .../commerce/product-list-pager-component.yml | 8 +- .../product-related-content-component.yml | 53 ++ .../components/sxa/bread-crumb-component.yml | 6 +- .../sass/pages/product-details-page.yml | 6 +- .../styles/bread-crumb-component.yml | 6 +- .../commerce/add-to-cart-component.yml | 2 +- .../commerce/add-to-wishlist-component.yml | 8 +- .../commerce/address-editor-component.yml | 2 +- .../commerce/address-list-component.yml | 2 +- .../commerce/cart-promo-code-component.yml | 2 +- .../catalog-item-container-component.yml | 2 +- .../commerce/change-password-component.yml | 2 +- .../commerce/checkout-billing-component.yml | 2 +- .../commerce/checkout-confirm-component.yml | 2 +- .../commerce/checkout-delivery-component.yml | 2 +- .../checkout-order-review-component.yml | 4 +- .../commerce/forgot-password-component.yml | 2 +- .../commerce/language-selector-component.yml | 2 +- .../components/commerce/login-component.yml | 2 +- .../commerce/messages-component.yml | 2 +- .../commerce/minicart-component.yml | 2 +- .../commerce/navigation-component.yml | 2 +- .../order-details-header-component.yml | 2 +- .../commerce/order-history-component.yml | 2 +- .../commerce/order-lines-component.yml | 2 +- .../commerce/order-totals-component.yml | 2 +- .../commerce/product-bundle-component.yml | 6 +- .../commerce/product-facet-component.yml | 2 +- .../commerce/product-image-component.yml | 2 +- .../commerce/product-info-component.yml | 2 +- .../commerce/product-inventory-component.yml | 2 +- .../commerce/product-kit-component.yml | 2 +- .../commerce/product-list-component.yml | 2 +- .../product-list-itemsonpage-component.yml | 2 +- .../commerce/product-list-pager-component.yml | 17 +- .../product-list-sorting-component.yml | 2 +- .../commerce/product-price-component.yml | 2 +- .../product-related-content-component.yml | 53 ++ .../commerce/product-variant-component.yml | 2 +- .../productlistpageinfo-component.yml | 2 +- .../commerce/profile-edit-component.yml | 2 +- .../commerce/profile-view-component.yml | 2 +- .../components/commerce/promoted-products.yml | 2 +- .../commerce/recent-orders-component.yml | 2 +- .../commerce/register-component.yml | 2 +- .../components/commerce/search-component.yml | 2 +- .../shopping-cart-lines-component.yml | 2 +- .../shopping-cart-total-component.yml | 2 +- .../commerce/step-indicator-component.yml | 2 +- .../subcategory-navigation-component.yml | 2 +- .../commerce/top-bar-links-component.yml | 2 +- .../styles/components/common/body.yml | 2 +- .../styles/components/common/forms.yml | 2 +- .../styles/components/common/input.yml | 2 +- .../components/common/reusable-styles.yml | 11 +- .../styles/components/common/tables.yml | 2 +- .../styles/components/common/validations.yml | 2 +- .../components/sxa/bread-crumb-component.yml | 6 +- .../components/sxa/carousel-component.yml | 2 +- .../sxa/component-rendering-variants.yml | 2 +- .../components/sxa/container-component.yml | 2 +- .../components/sxa/divider-component.yml | 2 +- .../components/sxa/footer-partial-design.yml | 2 +- .../components/sxa/header-partial-design.yml | 2 +- .../styles/components/sxa/link-component.yml | 2 +- .../components/sxa/link-list-component.yml | 2 +- .../components/sxa/rich-text-component.yml | 2 +- .../sxa/splitter-columns-component.yml | 2 +- .../Theme/Habitat Home Store/styles/fonts.yml | 2 +- .../styles/optimized-min.yml | 33 +- ...n_5208faf4-cd91-4085-83d3-7bfd1b05a1ce.yml | 74 --- .../styles/pages/account-management-page.yml | 2 +- .../styles/pages/account-profile-page.yml | 2 +- .../styles/pages/category-page.yml | 2 +- .../styles/pages/change-password-page.yml | 2 +- .../styles/pages/home-page.yml | 2 +- .../styles/pages/my-order-page.yml | 2 +- .../styles/pages/order-confirmation-page.yml | 2 +- .../styles/pages/product-details-page.yml | 2 +- .../styles/pages/register-page.yml | 2 +- .../styles/pages/shopping-cart-page.yml | 2 +- .../styles/product-details-page.yml | 4 +- .../styles/product-list-pager-component.yml | 53 ++ .../product-related-content-component.yml | 53 ++ .../HabitatHome.Website.Serialization.config | 3 +- 304 files changed, 8269 insertions(+), 1892 deletions(-) create mode 100644 src/Feature/Cart/website/Scripts/Commerce/Feature/Cart/habitathome.feature.cart.billing.model.js create mode 100644 src/Feature/Catalog/website/App_Config/Include/z.Feature.Overrides/Feature.Catalog.config create mode 100644 src/Feature/Catalog/website/Repositories/BreadcrumbRepository.cs create mode 100644 src/Feature/Catalog/website/Repositories/FakeBreadcrumbRepository.cs create mode 100644 src/Feature/Catalog/website/ServiceCollection/RegisterCatalogServices.cs delete mode 100644 src/Feature/ProductKit/engine/Commands/SampleCommand.cs delete mode 100644 src/Feature/ProductKit/engine/Components/SampleComponent.cs delete mode 100644 src/Feature/ProductKit/engine/Controllers/CommandsController.cs delete mode 100644 src/Feature/ProductKit/engine/Controllers/SampleController.cs delete mode 100644 src/Feature/ProductKit/engine/Entities/SampleEntity.cs delete mode 100644 src/Feature/ProductKit/engine/Models/SampleModel.cs delete mode 100644 src/Feature/ProductKit/engine/Pipelines/Arguments/SampleArgument.cs delete mode 100644 src/Feature/ProductKit/engine/Pipelines/Blocks/SampleBlock.cs delete mode 100644 src/Feature/ProductKit/engine/Pipelines/ISamplePipeline.cs delete mode 100644 src/Feature/ProductKit/engine/Pipelines/SamplePipeline.cs delete mode 100644 src/Feature/ProductKit/engine/Policies/SamplePolicy.cs create mode 100644 src/Feature/ProductRelatedContent/serialization/Renderings/Product Related Content.yml create mode 100644 src/Feature/ProductRelatedContent/serialization/Renderings/Product Related Content/Product Related Content.yml create mode 100644 src/Feature/ProductRelatedContent/website/App_Config/Include/Feature/Commerce/Feature.ProductRelatedContent.Serialization.config create mode 100644 src/Feature/ProductRelatedContent/website/App_Config/Include/Feature/Commerce/Feature.ProductRelatedContent.config create mode 100644 src/Feature/ProductRelatedContent/website/Controllers/ProductRelatedContentController.cs create mode 100644 src/Feature/ProductRelatedContent/website/Models/ProductDocumentJsonResult.cs create mode 100644 src/Feature/ProductRelatedContent/website/Models/RelatedProductJsonResult.cs create mode 100644 src/Feature/ProductRelatedContent/website/Properties/AssemblyInfo.cs create mode 100644 src/Feature/ProductRelatedContent/website/Repositories/IProductRelatedContentRepository.cs create mode 100644 src/Feature/ProductRelatedContent/website/Repositories/ProductRelatedContentRepository.cs create mode 100644 src/Feature/ProductRelatedContent/website/Scripts/Commerce/Feature/ProductRelatedContent/habitathome.feature.productrelatedcontent.js create mode 100644 src/Feature/ProductRelatedContent/website/Sitecore.HabitatHome.Feature.ProductRelatedContent.Website.csproj create mode 100644 src/Feature/ProductRelatedContent/website/Views/ProductRelatedContent/ProductRelatedContent.cshtml create mode 100644 src/Feature/ProductRelatedContent/website/Web.Debug.config create mode 100644 src/Feature/ProductRelatedContent/website/Web.Release.config create mode 100644 src/Feature/ProductRelatedContent/website/Web.config create mode 100644 src/Feature/ProductRelatedContent/website/packages.config create mode 100644 src/Foundation/Catalog/website/App_Config/Include/Foundation/Commerce/Foundation.Catalog.config create mode 100644 src/Foundation/Catalog/website/Managers/IProductRelatedContentManager.cs create mode 100644 src/Foundation/Catalog/website/Managers/ProductRelatedContentManager.cs create mode 100644 src/Project/HabitatHome/serialization/Content/10293b8d-ee06-41a8-b8f6-0a7b22e9488e/Data/Hero.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/Data/Commerce/Product Related Content.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/Data/Commerce/Product Related Content/6042183.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/Data/Commerce/Product Related Content/6042183/How To Video.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/Data/Commerce/Product Related Content/6042183/Installation Guide.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/Data/Form Actions Settings/Contact Identification/Default/Phone.yml rename src/Project/HabitatHome/serialization/Content/Habitat Home/Data/Heros/Product Launch Heros/{Striva 4 Coming Soon.yml => Fitness Tech Coming Soon.yml} (64%) create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/Data/Promos/Guides Promos/Promo - Best Wearable in Fitness Tech.yml rename src/Project/HabitatHome/serialization/{System.Workflows/Habitat Home Workflow/Awaiting Approval/Approve with Test/Launch Create Test Dialog.yml => Content/Habitat Home/Data/Promos/Promo - Trainer Finder.yml} (50%) create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/Data/Snippets.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/Data/Snippets/Full Width CTA - Left.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/Data/Snippets/Full Width CTA - Left/Data.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/Data/Snippets/Full Width CTA - Left/Data/Full CTA Promo.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/Data/Snippets/Full Width CTA - Right.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/Data/Snippets/Full Width CTA - Right/Data.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/Data/Snippets/Full Width CTA - Right/Data/Full CTA Promo.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/Data/Snippets/Newsletter Signup.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/Data/Snippets/Three Column Fitness Teasers.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/Data/Snippets/Two Column Fitness Teasers.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/Data/Snippets/Two Column Promos.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/Data/Snippets/Two Column Promos/Data.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/Data/Snippets/Two Column Promos/Data/Left Promo.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/Data/Snippets/Two Column Promos/Data/Right Promo.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/Presentation/Styles/Container/Clear Floats.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/home/Data/Fitness Products.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/home/Data/Trainer Finder Promo.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/home/landing-pages/new-fitness-tracker.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/home/landing-pages/new-fitness-tracker/Data.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/home/landing-pages/new-fitness-tracker/Data/Trainer Finder for mobile.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/home/landing-pages/new-fitness-tracker/Data/Trainer Finder.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/home/landing-pages/new-fitness-tracker/Data/Transparent.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/home/landing-pages/sample-with-form.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/home/landing-pages/sample-with-form/Data.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/home/landing-pages/sample-with-form/Data/Page Hero.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/home/landing-pages/sample.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/home/landing-pages/sample/Data.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/home/landing-pages/sample/Data/Page Hero.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/home/landing-pages/sample/Data/Two Column Promos.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/home/landing-pages/sample/Data/Two Column Promos/Data.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/home/landing-pages/sample/Data/Two Column Promos/Data/Left Promo.yml create mode 100644 src/Project/HabitatHome/serialization/Content/Habitat Home/home/landing-pages/sample/Data/Two Column Promos/Data/Right Promo.yml create mode 100644 src/Project/HabitatHome/serialization/Forms/Forms/Lead Generation Form Template.yml create mode 100644 src/Project/HabitatHome/serialization/Forms/Forms/Lead Generation Form Template/Page.yml create mode 100644 src/Project/HabitatHome/serialization/Forms/Forms/Lead Generation Form Template/Page/Email.yml create mode 100644 src/Project/HabitatHome/serialization/Forms/Forms/Lead Generation Form Template/Page/FirstName.yml create mode 100644 src/Project/HabitatHome/serialization/Forms/Forms/Lead Generation Form Template/Page/LastName.yml create mode 100644 src/Project/HabitatHome/serialization/Forms/Forms/Lead Generation Form Template/Page/Submit Button.yml create mode 100644 src/Project/HabitatHome/serialization/Forms/Forms/Lead Generation Form Template/Page/Submit Button/SubmitActions.yml create mode 100644 src/Project/HabitatHome/serialization/Forms/Forms/Lead Generation Form Template/Page/Submit Button/SubmitActions/Trigger Goal.yml create mode 100644 src/Project/HabitatHome/serialization/Forms/Forms/Lead Generation Form Template/Page/Telephone.yml create mode 100644 src/Project/HabitatHome/serialization/Forms/Forms/Sample Lead Generation Form.yml create mode 100644 src/Project/HabitatHome/serialization/Forms/Forms/Sample Lead Generation Form/Page.yml create mode 100644 src/Project/HabitatHome/serialization/Forms/Forms/Sample Lead Generation Form/Page/Email.yml create mode 100644 src/Project/HabitatHome/serialization/Forms/Forms/Sample Lead Generation Form/Page/FirstName.yml create mode 100644 src/Project/HabitatHome/serialization/Forms/Forms/Sample Lead Generation Form/Page/LastName.yml create mode 100644 src/Project/HabitatHome/serialization/Forms/Forms/Sample Lead Generation Form/Page/Submit Button.yml create mode 100644 src/Project/HabitatHome/serialization/Forms/Forms/Sample Lead Generation Form/Page/Submit Button/SubmitActions.yml create mode 100644 src/Project/HabitatHome/serialization/Forms/Forms/Sample Lead Generation Form/Page/Submit Button/SubmitActions/Identify Contact.yml create mode 100644 src/Project/HabitatHome/serialization/Forms/Forms/Sample Lead Generation Form/Page/Submit Button/SubmitActions/Redirect to Page.yml create mode 100644 src/Project/HabitatHome/serialization/Forms/Forms/Sample Lead Generation Form/Page/Submit Button/SubmitActions/Trigger Goal.yml create mode 100644 src/Project/HabitatHome/serialization/Forms/Forms/Sample Lead Generation Form/Page/Telephone.yml create mode 100644 src/Project/HabitatHome/serialization/Forms/Forms/Weekly Fitness Report Signup/Page/Section/FirstName.yml create mode 100644 src/Project/HabitatHome/serialization/Forms/Forms/Weekly Fitness Report Signup/Page/Section/LastName.yml rename src/Project/HabitatHome/serialization/Forms/{1427a26a-56b7-40d5-8870-2ce2e5ecbabd/Trigger Campaign Activity.yml => Forms/Weekly Fitness Report Signup/Page/Section/Text/SubmitActions/Identify Contact.yml} (72%) create mode 100644 src/Project/HabitatHome/serialization/Forms/e56e080c-2cc4-42ff-8b8c-dd26bef3c6d9/Identify Contact.yml create mode 100644 src/Project/HabitatHome/serialization/Forms/e56e080c-2cc4-42ff-8b8c-dd26bef3c6d9/Redirect to Page.yml create mode 100644 src/Project/HabitatHome/serialization/Marketing.TestLab/Test Lab.yml create mode 100644 src/Project/HabitatHome/serialization/Marketing.TestLab/Test Lab/2018.yml create mode 100644 src/Project/HabitatHome/serialization/Marketing.TestLab/Test Lab/2018/06.yml create mode 100644 src/Project/HabitatHome/serialization/Marketing.TestLab/Test Lab/2018/06/06.yml create mode 100644 src/Project/HabitatHome/serialization/Marketing.TestLab/Test Lab/2018/06/06/19.yml create mode 100644 src/Project/HabitatHome/serialization/Marketing.TestLab/Test Lab/2018/06/06/19/03.yml create mode 100644 src/Project/HabitatHome/serialization/Marketing.TestLab/Test Lab/2018/06/06/19/03/new-fitness-tracker F5DCC292AAEC4467AD477F2C72179F.yml rename src/Project/HabitatHome/serialization/{System.Workflows/Habitat Home Workflow/Draft.yml => Marketing.TestLab/Test Lab/Emails.yml} (51%) create mode 100644 src/Project/HabitatHome/serialization/Marketing.TestLab/d12e5b7c-a0a8-4c8f-802d-e6931a364973/Catalog Item Container.yml create mode 100644 src/Project/HabitatHome/serialization/Marketing.TestLab/d12e5b7c-a0a8-4c8f-802d-e6931a364973/Catalog Item Container/Blue.yml create mode 100644 src/Project/HabitatHome/serialization/Marketing.TestLab/d12e5b7c-a0a8-4c8f-802d-e6931a364973/Catalog Item Container/Green.yml create mode 100644 src/Project/HabitatHome/serialization/Marketing.TestLab/d12e5b7c-a0a8-4c8f-802d-e6931a364973/Catalog Item Container/Original.yml create mode 100644 src/Project/HabitatHome/serialization/Marketing.TestLab/d12e5b7c-a0a8-4c8f-802d-e6931a364973/Catalog Item Container/Purple.yml create mode 100644 src/Project/HabitatHome/serialization/Marketing.TestLab/d12e5b7c-a0a8-4c8f-802d-e6931a364973/Catalog Item Container/White.yml delete mode 100644 src/Project/HabitatHome/serialization/Media/Habitat Home/Images/Health/Sydney Hero.yml create mode 100644 src/Project/HabitatHome/serialization/Media/Habitat Home/Product Media.yml create mode 100644 src/Project/HabitatHome/serialization/Media/Habitat Home/Product Media/7042066.yml create mode 100644 src/Project/HabitatHome/serialization/Media/Habitat Home/Product Media/7042066/Unlocking-the-Smart-Home.yml create mode 100644 src/Project/HabitatHome/serialization/Media/Habitat Home/Product Media/7042066/rfid-journal-article-smart-home.yml create mode 100644 src/Project/HabitatHome/serialization/Media/Habitat Home/Product Media/bundle_0000001.yml create mode 100644 src/Project/HabitatHome/serialization/Media/Habitat Home/Product Media/bundle_0000001/Unlocking-the-Smart-Home.yml delete mode 100644 src/Project/HabitatHome/serialization/System.Workflows/Habitat Home Workflow.yml delete mode 100644 src/Project/HabitatHome/serialization/System.Workflows/Habitat Home Workflow/Approved.yml delete mode 100644 src/Project/HabitatHome/serialization/System.Workflows/Habitat Home Workflow/Approved/Auto Publish.yml delete mode 100644 src/Project/HabitatHome/serialization/System.Workflows/Habitat Home Workflow/Awaiting Approval.yml delete mode 100644 src/Project/HabitatHome/serialization/System.Workflows/Habitat Home Workflow/Awaiting Approval/Approve with Test.yml delete mode 100644 src/Project/HabitatHome/serialization/System.Workflows/Habitat Home Workflow/Awaiting Approval/Approve with Test/Validation Action.yml delete mode 100644 src/Project/HabitatHome/serialization/System.Workflows/Habitat Home Workflow/Awaiting Approval/Approve.yml delete mode 100644 src/Project/HabitatHome/serialization/System.Workflows/Habitat Home Workflow/Awaiting Approval/Approve/Validation Action.yml delete mode 100644 src/Project/HabitatHome/serialization/System.Workflows/Habitat Home Workflow/Awaiting Approval/Reject.yml delete mode 100644 src/Project/HabitatHome/serialization/System.Workflows/Habitat Home Workflow/Draft/Submit.yml delete mode 100644 src/Project/HabitatHome/serialization/System.Workflows/Habitat Home Workflow/Draft/__OnSave.yml delete mode 100644 src/Project/HabitatHome/serialization/System.Workflows/Habitat Home Workflow/Draft/__OnSave/Auto Submit Action.yml create mode 100644 src/Project/HabitatHome/serialization/Templates.Branches/Habitat Home/Landing Page With Form.yml create mode 100644 src/Project/HabitatHome/serialization/Templates.Branches/Habitat Home/Landing Page With Form/_name.yml create mode 100644 src/Project/HabitatHome/serialization/Templates.Branches/Habitat Home/Landing Page With Form/_name/Data.yml create mode 100644 src/Project/HabitatHome/serialization/Templates.Branches/Habitat Home/Landing Page With Form/_name/Data/Page Hero.yml create mode 100644 src/Project/HabitatHome/serialization/Templates.Branches/Habitat Home/Landing Page.yml create mode 100644 src/Project/HabitatHome/serialization/Templates.Branches/Habitat Home/Landing Page/_name.yml create mode 100644 src/Project/HabitatHome/serialization/Templates.Branches/Habitat Home/Landing Page/_name/Data.yml create mode 100644 src/Project/HabitatHome/serialization/Templates.Branches/Habitat Home/Landing Page/_name/Data/Page Hero.yml create mode 100644 src/Project/HabitatHome/serialization/Templates.Branches/Habitat Home/Landing Page/_name/Data/Two Column Promos.yml create mode 100644 src/Project/HabitatHome/serialization/Templates.Branches/Habitat Home/Landing Page/_name/Data/Two Column Promos/Data.yml create mode 100644 src/Project/HabitatHome/serialization/Templates.Branches/Habitat Home/Landing Page/_name/Data/Two Column Promos/Data/Left Promo.yml create mode 100644 src/Project/HabitatHome/serialization/Templates.Branches/Habitat Home/Landing Page/_name/Data/Two Column Promos/Data/Right Promo.yml create mode 100644 src/Project/HabitatHome/serialization/Templates/74c56d93-c404-4b0e-8560-214f62e41e72/__Standard Values.yml create mode 100644 src/Project/HabitatHome/serialization/Templates/7a6508ce-5661-4302-95be-7c7d9a837b36/Product Related Content Item.yml create mode 100644 src/Project/HabitatHome/serialization/Templates/7a6508ce-5661-4302-95be-7c7d9a837b36/Product Related Content Item/Link.yml create mode 100644 src/Project/HabitatHome/serialization/Templates/7a6508ce-5661-4302-95be-7c7d9a837b36/Product Related Content Item/Tags.yml create mode 100644 src/Project/HabitatHome/serialization/Templates/7a6508ce-5661-4302-95be-7c7d9a837b36/Product Related Content Item/Title.yml create mode 100644 src/Project/HabitatHome/serialization/Templates/Habitat Home/Store/Product Related Content.yml create mode 100644 src/Project/HabitatHome/serialization/Templates/Habitat Home/Store/Product Related Content/Product Related Content Folder.yml create mode 100644 src/Project/HabitatHome/serialization/Templates/Habitat Home/Store/Product Related Content/Product Related Content Item.yml create mode 100644 src/Project/HabitatHome/serialization/Templates/Habitat Home/Store/Product Related Content/Product Related Content Repository.yml create mode 100644 src/Project/HabitatHome/serialization/Templates/b491d043-fac0-4742-97ea-b8d5aaab19bc/__Standard Values.yml create mode 100644 src/Project/HabitatHome/serialization/Templates/c7778672-5c93-45c9-8805-294468c99360/ContentType.yml create mode 100644 src/Project/HabitatHome/serialization/Templates/c7778672-5c93-45c9-8805-294468c99360/Description.yml create mode 100644 src/Project/HabitatHome/serialization/Templates/c7778672-5c93-45c9-8805-294468c99360/Thumbnail.yml create mode 100644 src/Project/HabitatHome/serialization/Theme/Habitat Home Store/sass/components/commerce/product-related-content-component.yml create mode 100644 src/Project/HabitatHome/serialization/Theme/Habitat Home Store/styles/components/commerce/product-related-content-component.yml delete mode 100644 src/Project/HabitatHome/serialization/Theme/Habitat Home Store/styles/optimized-min_5208faf4-cd91-4085-83d3-7bfd1b05a1ce.yml create mode 100644 src/Project/HabitatHome/serialization/Theme/Habitat Home Store/styles/product-list-pager-component.yml create mode 100644 src/Project/HabitatHome/serialization/Theme/Habitat Home Store/styles/product-related-content-component.yml diff --git a/HabitatHome.Commerce.sln b/HabitatHome.Commerce.sln index bb2c6440e..411f984f1 100644 --- a/HabitatHome.Commerce.sln +++ b/HabitatHome.Commerce.sln @@ -124,6 +124,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Promotions", "Promotions", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sitecore.HabitatHome.Foundation.Promotions.Website", "src\Foundation\Promotions\website\Sitecore.HabitatHome.Foundation.Promotions.Website.csproj", "{A5FE2C5D-8A6F-4ACF-9F4F-03B7F8F7F94F}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ProductRelatedContent", "ProductRelatedContent", "{28FE62EE-EC31-4D80-83B3-ECE2EC62856E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sitecore.HabitatHome.Feature.ProductRelatedContent.Website", "src\Feature\ProductRelatedContent\website\Sitecore.HabitatHome.Feature.ProductRelatedContent.Website.csproj", "{4230C56A-B706-4070-832F-B9E1CADBFDBB}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -236,6 +240,10 @@ Global {A5FE2C5D-8A6F-4ACF-9F4F-03B7F8F7F94F}.Debug|Any CPU.Build.0 = Debug|Any CPU {A5FE2C5D-8A6F-4ACF-9F4F-03B7F8F7F94F}.Release|Any CPU.ActiveCfg = Release|Any CPU {A5FE2C5D-8A6F-4ACF-9F4F-03B7F8F7F94F}.Release|Any CPU.Build.0 = Release|Any CPU + {4230C56A-B706-4070-832F-B9E1CADBFDBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4230C56A-B706-4070-832F-B9E1CADBFDBB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4230C56A-B706-4070-832F-B9E1CADBFDBB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4230C56A-B706-4070-832F-B9E1CADBFDBB}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -294,6 +302,8 @@ Global {EFF50A81-0722-4537-892D-F0522495BFD6} = {054C0EDB-3E7C-4CF6-8B85-7D6F55397147} {F11F18D0-C25F-4130-8320-DDE62AA33EDB} = {1B6FFBEA-35BD-4381-A2BE-4FA54E3940E1} {A5FE2C5D-8A6F-4ACF-9F4F-03B7F8F7F94F} = {F11F18D0-C25F-4130-8320-DDE62AA33EDB} + {28FE62EE-EC31-4D80-83B3-ECE2EC62856E} = {05829E0F-331A-44AF-BEB8-3AD54EE35694} + {4230C56A-B706-4070-832F-B9E1CADBFDBB} = {28FE62EE-EC31-4D80-83B3-ECE2EC62856E} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {092E4BB9-63E2-476F-91D9-389412140FC4} diff --git a/src/Feature/Cart/website/App_Config/Include/Feature.Overrides/Commerce/Feature.Cart.config b/src/Feature/Cart/website/App_Config/Include/Feature.Overrides/Commerce/Feature.Cart.config index e877cc9e0..f4c61d04e 100644 --- a/src/Feature/Cart/website/App_Config/Include/Feature.Overrides/Commerce/Feature.Cart.config +++ b/src/Feature/Cart/website/App_Config/Include/Feature.Overrides/Commerce/Feature.Cart.config @@ -21,11 +21,18 @@ patch:instead="file[@name='CxaCheckoutDeliveryModel']" path="/Scripts/Commerce/Feature/Cart/habitathome.feature.cart.delivery.model.js" order="203"/> - + + + + + diff --git a/src/Feature/Cart/website/Scripts/Commerce/Feature/Cart/habitathome.feature.cart.billing.model.js b/src/Feature/Cart/website/Scripts/Commerce/Feature/Cart/habitathome.feature.cart.billing.model.js new file mode 100644 index 000000000..b202f6ea0 --- /dev/null +++ b/src/Feature/Cart/website/Scripts/Commerce/Feature/Cart/habitathome.feature.cart.billing.model.js @@ -0,0 +1,627 @@ +var mustEqual = function (val, other) { + + if (val) { + return val === other; + } + + return true; +}; + +// -----[GIFT CARD PAYMENT MODEL]----- +function GiftCardPaymentViewModel(billingViewModel, card) { + var self = this; + var populate = card != null; + + self.billingViewModel = billingViewModel; + + self.isAdded = ko.observable(false); + self.balance = ko.observable(0); + self.formattedBalance = ko.observable(""); + self.enableAddCard = ko.observable(false); + + self.giftCardNumber = populate ? ko.validatedObservable(card.PaymentMethodID).extend({ required: true }) : ko.validatedObservable("").extend({ required: true }); + self.giftCardNumber.subscribe(function (cn) { + self.balance(0); + self.formattedBalance(""); + + self.reEnableAddCard(); + //self.enableAddCard(cn.length > 0 && self.giftCardAmount().length > 0 && self.isAdded() === false); + }.bind(this)); + + self.reload = function (data) { + self.giftCardNumber(data.ExternalId); + self.formattedBalance(data.FormattedBalance); + self.balance(data.Balance); + //self.enableAddCard(false); + self.reEnableAddCard(); + } + + self.reEnableAddCard = function (ca) { + if (!ca) { + ca = self.giftCardAmount(); + } + + self.enableAddCard(ca.length > 0 && self.giftCardNumber().length > 0 && self.isAdded() === false && self.giftCardAmount.isValid() && self.balance() > 0); + } + + self.getBalance = function () { + MessageContext.ClearAllMessages(); + var $btn = $('.git-card-payment-get-balance-btn').button('loading'); + var data = {}; + data.GiftCardId = self.giftCardNumber(); + AjaxService.Post('/api/cxa/checkout/getgiftcardbalance', data, function (data, success, sender) { + if (success && data.Success) { + self.reload(data); + } + + $('.git-card-payment-get-balance-btn').button('reset'); + }, this); + }; + + self.applyBalance = function () { + MessageContext.ClearAllMessages(); + var balance = self.balance(); + if (balance <= 0) { + return; + } + + var orderTotal = self.billingViewModel.cart().totalAmount(); + if (balance > orderTotal) { + self.giftCardAmountRawValue(orderTotal); + } + else if (balance <= orderTotal) { + self.giftCardAmountRawValue(balance); + } + + self.enableAddCard(true); + }; + + self.addCard = function () { + MessageContext.ClearAllMessages(); + self.isAdded(true); + self.enableAddCard(false); + self.revalueAmounts(); + }; + + self.removeCard = function () { + MessageContext.ClearAllMessages(); + self.isAdded(false); + self.giftCardNumber(""); + self.formattedBalance(""); + self.giftCardAmountRawValue(0.00); + self.balance(0.00); + }; + + self.revalueAmounts = function () { + if (!self.isAdded()) { + return; + } + + var ccIsAdded = self.billingViewModel.creditCardPayment().isAdded(); + if (!ccIsAdded) { + return; + } + + var ccAmount = parseFloat(self.billingViewModel.creditCardPayment().creditCardAmount()); + var total = parseFloat(self.billingViewModel.cart().totalAmount()); + var aTotal = parseFloat(parseFloat(self.giftCardAmountRawValue()) + ccAmount); + + if (aTotal > total) { + var count = 1; + var diff = (aTotal - total) / count; + ccAmount = ccIsAdded ? ccAmount - diff : 0; + self.billingViewModel.creditCardPayment().creditCardAmount((ccAmount).toFixed(2)); + } + }; + + self.giftCardAmount = ko.validatedObservable(0.00).extend({ required: true, number: true }); + + self.giftCardAmountRawValue = ko.computed({ + read: function () { + value = self.giftCardAmount(); + + if (self.billingViewModel) { + value = value.toString(); + value = value.replace(self.billingViewModel.currencyDecimalSeparator(), "."); + } + + return value; + }, + write: function (value) { + if (self.billingViewModel) { + value = value.toString(); + value = value.replace(".", self.billingViewModel.currencyDecimalSeparator()); + } + + self.giftCardAmount(value); + } + }); + + self.giftCardAmount.subscribe(function (ca) { + self.reEnableAddCard(ca); + self.revalueAmounts(); + }.bind(this)); + + self.addGiftCard = function (cardData) { + self.giftCardNumber(cardData.GiftCardNumber != null ? cardData.GiftCardNumber : ""); + self.giftCardAmountRawValue(cardData.Amount); + self.isAdded(true); + } +} + +// -----[CREDITCARD PAYMENT MODEL]----- +function CreditCardPaymentViewModel(card, checkoutViewModel) { + var self = this; + var populate = card != null; + + self.checkoutViewModel = checkoutViewModel; + + self.isAdded = ko.observable(false); + self.creditCardNumber = ko.validatedObservable().extend({ required: true, number: true }); + self.creditCardNumberMasked = ko.observable(); + self.creditCardNumber.subscribe(function (number) { + self.creditCardNumberMasked("XXXX XXXX XXXX " + number.substr(number.length - 4)); + }); + + self.description = ko.observable(); + + self.existingPaymentAmount = ko.observable(populate ? card.Amount : 0); + + self.paymentMethodID = populate ? ko.validatedObservable(card.PaymentMethodID).extend({ required: true }) : ko.validatedObservable().extend({ required: true }); + self.paymentMethodID.subscribe(function (methodId) { + if (methodId !== "0") { + self.isAdded(true); + + var paymentMethod = ko.utils.arrayFirst(self.checkoutViewModel.paymentMethods(), function (a) { + if (a.ExternalId === methodId) { + return a; + } + + return null; + }); + + self.description(paymentMethod ? paymentMethod.Description : ""); + self.checkoutViewModel.creditCardEnable(true); + self.checkoutViewModel.billingAddressEnable(true); + } else { + self.isAdded(false); + self.checkoutViewModel.creditCardEnable(false); + self.checkoutViewModel.billingAddressEnable(false); + } + }); + + self.changePayment = ko.observable(false); + self.displayExistingPaymentMessage = ko.computed({ + read: function () { + if (self.checkoutViewModel.editMode() && self.existingPaymentAmount() == self.creditCardAmount() && !self.changePayment()) { + return true; + } + else { + return false; + } + }, + write: function () { } + }); + + self.mustRevalidatePaymentMessage = ko.observable(populate ? card.CartAmountDifferentThanPaymentMessage : ""); + self.mustRevalidatePayment = ko.computed({ + read: function () { + if (self.checkoutViewModel.editMode() && self.existingPaymentAmount() != self.creditCardAmount()) { + return true; + } + else { + return false; + } + }, + write: function () { } + }); + + self.creditCardAmount = ko.computed({ + read: function () { + if (!self.isAdded()) { + return 0; + } + + var total = self.checkoutViewModel.cart() ? self.checkoutViewModel.cart().totalAmount() : 0; + var gcAmount = self.checkoutViewModel.giftCardPayment() ? self.checkoutViewModel.giftCardPayment().giftCardAmountRawValue() : 0; + var ccAmount = (parseFloat(total) - parseFloat(gcAmount)).toFixed(2); + + if (ccAmount <= 0) { + self.isAdded(false); + } + + return ccAmount; + }, + write: function () { } + }); + + self.originalExistingPaymentMessage = ko.observable(populate ? card.ExistingPaymentMessage : ""); + self.existingPaymentMessage = ko.computed({ + read: function () { + if (self.creditCardAmount() != null) { + return self.originalExistingPaymentMessage().format(self.creditCardAmount()); + } + else { + return ""; + } + }, + write: function () { } + }); + + self.partyID = populate ? ko.observable(card.PartyID) : ko.observable(); +} + +// -----[BILLING DATA MODEL]----- +function BillingDataViewModel() { + var self = this; + + var PaymentTypes = { + GiftCard: 3, + FederatedPayment: 4, + }; + + self.cart = ko.observable(""); + + self.editMode = ko.observable(false); + + var Country = function (name, code) { + this.country = name; + this.code = code; + }; + self.countries = ko.observableArray(); + + self.isAuthenticated = false; + self.userEmail = ""; + + self.isShipAll = ko.observable(false); + + self.currencyDecimalSeparator = ko.observable(); + self.currencyGroupSeparator = ko.observable(); + + self.userAddresses = ko.observableArray(); + self.hasDigitalProductsInCart = false; + self.userAddresses.push(new AddressViewModel({ "ExternalId": "UseOther", "FullAddress": $("#OtherAddressLabel").val() })); + + self.billingEmail = ko.validatedObservable(self.userEmail).extend({ required: true, email: true }); + self.billingConfirmEmail = ko.validatedObservable(self.userEmail).extend({ required: true, validation: { validator: mustEqual, message: $("#EmailsMustMatchMessage").val(), params: self.billingEmail } }); + + self.payFederatedPayment = ko.observable(false); + self.payGiftCard = ko.observable(false); + self.cardPaymentAcceptPageUrl = ko.observable(''); + self.cardPaymentResultAccessCode = ""; + self.cardPaymentAcceptCardPrefix = ""; + self.CARDPAYMENTACCEPTPAGEHEIGHT = "msax-cc-height"; + self.CARDPAYMENTACCEPTPAGEERROR = "msax-cc-error"; + self.CARDPAYMENTACCEPTPAGERESULT = "msax-cc-result"; + self.CARDPAYMENTACCEPTPAGESUBMIT = "msax-cc-submit"; + self.CARDPAYMENTACCEPTCARDPREFIX = "msax-cc-cardprefix"; + + var PaymentMethod = function (externalId, description) { + this.ExternalId = externalId; + this.Description = description; + }; + + self.paymentMethods = ko.observableArray(); + self.paymentClientToken = ko.observable(""); + + self.giftCardPayment = ko.validatedObservable(new GiftCardPaymentViewModel(self)); + self.creditCardPayment = ko.validatedObservable(new CreditCardPaymentViewModel(null, self)); + self.creditCardEnable = ko.observable(false); + self.billingAddress = ko.validatedObservable(new AddressViewModel({ "ExternalId": "1" })); + self.billingAddressEnable = ko.observable(false); + self.shippingAddress = ko.observable(); + self.selectedBillingAddress = ko.observable("UseOther"); + self.selectedBillingAddress.subscribe(function (id) { + if (id === "UseShipping") { + self.billingAddressEnable(false); + self.billingAddress(self.shippingAddress()); + } else { + var match = self.getAddress(id); + if (match != null) { + self.billingAddressEnable(false); + self.billingAddress(match); + } else { + self.billingAddressEnable(true); + self.billingAddress(new AddressViewModel({ "ExternalId": "1" })); + } + } + + $(".select-billing-address").prop("disabled", false); + }); + + self.paymentTotal = ko.computed({ + read: function () { + var ccIsAdded = self.creditCardPayment().isAdded(); + var gcIsAdded = self.giftCardPayment().isAdded(); + if (!ccIsAdded && !gcIsAdded) { + return 0; + } + + var ccAmount = ccIsAdded ? self.creditCardPayment().creditCardAmount() : 0; + var gcAmount = gcIsAdded ? self.giftCardPayment().giftCardAmountRawValue() : 0; + return (parseFloat(ccAmount) + parseFloat(gcAmount)).toFixed(2); + }, + write: function () { } + }); + + self.enableToConfirm = ko.computed({ + read: function () { + if (self.cart().length == 0) { + return false; + } + + var paymentTotalIsValid = parseFloat(self.paymentTotal()) === parseFloat(self.cart().totalAmount()); + if (!paymentTotalIsValid) { + return false; + } + + var paymentsAreValid = false; + if (self.giftCardPayment().isAdded()) { + paymentsAreValid = self.giftCardPayment.isValid(); + } + + if (self.creditCardPayment().isAdded()) { + if (!self.payFederatedPayment()) { + paymentsAreValid = self.creditCardPayment.isValid() && self.billingAddress.isValid(); + } + else { + paymentsAreValid = !self.creditCardPayment().mustRevalidatePayment() && self.billingAddress.isValid(); + } + } + + if (paymentsAreValid) { + ko.validation.group(self).showAllMessages(true); + } + + return paymentsAreValid && self.billingEmail.isValid() && self.billingConfirmEmail.isValid(); + }, + write: function (value) { + return Boolean(value); + } + }); + + self.setPaymentMethods = function () { + var data = "{"; + + data = data + '"BillingItemPath":"' + $("#BillingItemPath").val() + '",' + data = data + '"UserEmail":' + '"' + self.billingEmail() + '"'; + + if (self.creditCardPayment().isAdded()) { + var cc = self.creditCardPayment(); + if (self.payFederatedPayment) { + var creditCard = { + "CardToken": self.cardPaymentResultAccessCode, + "Amount": cc.creditCardAmount(), + "CardPaymentAcceptCardPrefix": self.cardPaymentAcceptCardPrefix + }; + + if (data.length > 1) { + data += ","; + } + + data += '"FederatedPayment":' + JSON.stringify(creditCard); + if (self.cardPaymentAcceptCardPrefix === "paypal") { + var ba = self.billingAddress(); + var billingAddress = + { + "Name": ba.name(), + "Address1": ba.address1(), + "Country": ba.country(), + "City": ba.city(), + "State": ba.state(), + "ZipPostalCode": ba.zipPostalCode(), + "ExternalId": ba.externalId(), + "PartyId": ba.externalId() + }; + + if (data.length > 1) { + data += ","; + } + + data += '"BillingAddress":' + JSON.stringify(billingAddress); + } + } + } + + if (self.giftCardPayment().isAdded()) { + var giftCard = { + "PaymentMethodID": self.giftCardPayment().giftCardNumber(), + "Amount": self.giftCardPayment().giftCardAmountRawValue() + }; + + if (data.length > 1) { + data += ","; + } + + data += '"GiftCardPayment":' + JSON.stringify(giftCard); + } + + data += "}"; + + $(".to-confirm-button").button('loading'); + MessageContext.ClearAllMessages(); + + AjaxService.Post("/api/cxa/checkout/SetPaymentMethods", JSON.parse(data), function (data, success, sender) { + if (data.Success && success) { + window.location.href = data.NextPageLink + } + $(".to-confirm-button").button('reset'); + }, $(this)); + } + + self.setupPage = function () { + $('.existing-payment-reset-link').on('click', function (event) { + self.creditCardPayment().changePayment(true); + }); + } + + self.goToNextPageClick = function () { + self.setPaymentMethods(); + } + + self.getAddress = function (id) { + var match = ko.utils.arrayFirst(self.userAddresses(), function (a) { + if (a.externalId() === id && id !== "UseOther") { + return a; + } + + return null; + }); + + return match; + }; + + self.load = function () { + AjaxService.Post("/api/cxa/checkout/GetBillingData", null, function (data, success, sender) { + if (success && data.Success) { + console.log(data); + if (data.Countries != null) { + $.each(data.Countries, function (index, value) { + self.countries.push(new Country(value, index)); + }); + } + + self.cart(new CartViewModel(data.Cart)); + + // Set the shipping address. Needed for same as shipping. + if (self.cart().shipments.length == 1) { + var partyId = self.cart().shipments[0].partyId; + var party = ko.utils.arrayFirst(self.cart().parties, function (a) { + if (a.externalId() === partyId) { + return a; + } + + return null; + }); + + if (party != null) { + self.shippingAddress(party); + } + } + + self.paymentClientToken(data.PaymentClientToken); + + if (data.IsUserAuthenticated === true && data.UserAddresses.Addresses != null) { + $.each(data.UserAddresses.Addresses, function () { + self.userAddresses.push(new AddressViewModel(this)); + }); + + self.isAuthenticated = true; + } + + // Checking if the cart contains a digital product "HasDigitalProduct" + // if true then the "Same as shipping address" will not be available + // else it will be added to nilling address list + self.hasDigitalProductsInCart = data.HasDigitalProduct; + if (!self.hasDigitalProductsInCart) { + self.userAddresses.push(new AddressViewModel({ "ExternalId": "UseShipping", "FullAddress": $(".select-billing-address").attr("title") })); + } + + self.userEmail = data.UserEmail; + self.billingEmail(data.UserEmail); + self.billingConfirmEmail(data.UserEmail); + + self.currencyDecimalSeparator(data.CurrencyDecimalSeparator); + self.currencyGroupSeparator(data.CurrencyGroupSeparator) + + //if (self.currencyDecimalSeparator() != ".") { + //} + + currentNumberValidator = ko.validation.rules.number.validator; + ko.validation.rules.number.validator = function (n, t) { + n = n.replace(self.currencyDecimalSeparator(), "."); + + return currentNumberValidator(n, t) && $.isNumeric(n); + } + + if (data.PaymentOptions != null) { + $.each(data.PaymentOptions, function (index, value) { + if (value.PaymentOptionTypeName === "PayFederatedPayment") { + self.payFederatedPayment(true); + } + if (value.PaymentOptionTypeName === "PayGiftCard") { + self.payGiftCard(true); + } + }); + } + + if (data.PaymentMethods != null) { + self.paymentMethods.push(new PaymentMethod("0", $("#PaymentMethods").attr("title"))); + $.each(data.PaymentMethods, function (index, value) { + self.paymentMethods.push(new PaymentMethod(value.ExternalId, value.Description)); + }); + } + + self.isShipAll((data.Cart != null && data.Cart.Shipments != null && data.Cart.Shipments.length == 1 && data.Cart.Shipments[0].ShippingMethodName != "Pickup From Store") ? true : false); + + if (self.paymentClientToken() != null) { + var clientToken = self.paymentClientToken(); + if (clientToken.length > 0) { + braintree.setup(clientToken, 'dropin', { + container: 'dropin-container', + paymentMethodNonceReceived: function (event, nonce) { + if (nonce.length > 0) { + self.cardPaymentResultAccessCode = nonce; + self.cardPaymentAcceptCardPrefix = "paypal"; + + if (self.creditCardPayment() != null && self.editMode()) { + self.creditCardPayment().existingPaymentAmount(self.creditCardPayment().creditCardAmount()); + self.creditCardPayment().changePayment(false); + } + } + } + }); + } + } + + if (data.Cart != null && data.Cart.AccountingParty != null) { + var partyId = data.Cart.AccountingParty.PartyID; + var party = ko.utils.arrayFirst(self.cart().parties, function (a) { + if (a.externalId() === partyId) { + return a; + } + + return null; + }); + + if (party != null) { + self.billingAddress(party); + } + } + + if (data.Cart != null && data.Cart.Payments != null && data.Cart.Payments.length > 0) { + var giftCardAdded = false; + var fedPaymentAdded = false; + $.each(data.Cart.Payments, function (index, Value) { + if (Value.PaymentType == PaymentTypes.FederatedPayment) { + self.creditCardPayment(new CreditCardPaymentViewModel(Value, self)); + self.payFederatedPayment(true); + self.cardPaymentResultAccessCode = Value.CardToken; + self.cardPaymentAcceptCardPrefix = "paypal"; + fedPaymentAdded = true; + } + + if (Value.PaymentType == PaymentTypes.GiftCard) { + self.giftCardPayment().addGiftCard(Value); + self.payGiftCard(true); + giftCardAdded = true; + } + }); + + self.editMode(fedPaymentAdded || giftCardAdded); + + if (fedPaymentAdded) { + $(".ccpayment").trigger("click"); + } + + if (giftCardAdded) { + $(".giftCardPayment").trigger("click"); + } + } + + self.setupPage(); + } + } + ) + }; +} \ No newline at end of file diff --git a/src/Feature/Cart/website/Sitecore.HabitatHome.Feature.Cart.Website.csproj b/src/Feature/Cart/website/Sitecore.HabitatHome.Feature.Cart.Website.csproj index a7e1cae67..9ae93f1d0 100644 --- a/src/Feature/Cart/website/Sitecore.HabitatHome.Feature.Cart.Website.csproj +++ b/src/Feature/Cart/website/Sitecore.HabitatHome.Feature.Cart.Website.csproj @@ -156,6 +156,7 @@ + diff --git a/src/Feature/Catalog/website/App_Config/Include/Feature/Commerce/Feature.Catalog.config b/src/Feature/Catalog/website/App_Config/Include/Feature/Commerce/Feature.Catalog.config index 2c2afcb88..4acb9a465 100644 --- a/src/Feature/Catalog/website/App_Config/Include/Feature/Commerce/Feature.Catalog.config +++ b/src/Feature/Catalog/website/App_Config/Include/Feature/Commerce/Feature.Catalog.config @@ -2,7 +2,7 @@ - + diff --git a/src/Feature/Catalog/website/App_Config/Include/z.Feature.Overrides/Feature.Catalog.config b/src/Feature/Catalog/website/App_Config/Include/z.Feature.Overrides/Feature.Catalog.config new file mode 100644 index 000000000..453153b65 --- /dev/null +++ b/src/Feature/Catalog/website/App_Config/Include/z.Feature.Overrides/Feature.Catalog.config @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/Feature/Catalog/website/Repositories/BreadcrumbRepository.cs b/src/Feature/Catalog/website/Repositories/BreadcrumbRepository.cs new file mode 100644 index 000000000..e450982f3 --- /dev/null +++ b/src/Feature/Catalog/website/Repositories/BreadcrumbRepository.cs @@ -0,0 +1,109 @@ +using Sitecore.Commerce.XA.Foundation.Common.Providers; +using Sitecore.Data.Items; +using Sitecore.XA.Feature.Navigation.Models; +using Sitecore.XA.Foundation.Mvc.Repositories.Base; +using System.Collections.Generic; +using System.Linq; +using Sitecore.Commerce.XA.Foundation.Common; + +namespace Sitecore.HabitatHome.Feature.Catalog.Repositories +{ + public class BreadcrumbRepository : Sitecore.XA.Feature.Navigation.Repositories.Breadcrumb.BreadcrumbRepository + { + + private readonly IItemTypeProvider _itemTypeProvider; + private readonly ISiteContext _siteContext; + private readonly IStorefrontContext _storefrontContext; + + public BreadcrumbRepository(IItemTypeProvider itemTypeProvider, ISiteContext siteContext, IStorefrontContext storefrontContext) : base() + { + _itemTypeProvider = itemTypeProvider; + _siteContext = siteContext; + _storefrontContext = storefrontContext; + } + + public override IEnumerable GetBreadcrumbItems(Item currentItem, Item rootItem) + { + var breadcrumbItems = BuildBreadcrumb(currentItem, rootItem).Where(ShowInBreadcrumb).ToList(); + int count = breadcrumbItems.Count; + + // Null is passed in for the Children parameter as it doesn't seem relevant for commerce catalog + return breadcrumbItems.Select((item, index) => CreateBreadcrumbModel(item, index, count, null, null)); + } + + protected override BreadcrumbRenderingModel CreateBreadcrumbModel(Item item, int index, int count, IEnumerable children, string Name) + { + var cssClasses = new List(); + if (index == 0) + { + cssClasses.Add("home"); + } + + return new BreadcrumbRenderingModel(item) + { + Name = Name, + Children = children, + CssClasses = cssClasses, + VariantFields = VariantFields, + Separator = Rendering.Parameters[Sitecore.XA.Feature.Navigation.Constants.Separator] + }; + } + + protected override bool ShowInBreadcrumb(Item item) + { + var itemType = _itemTypeProvider.GetItemType(item); + if (itemType == Sitecore.Commerce.XA.Foundation.Common.Constants.ItemTypes.Category || + itemType == Sitecore.Commerce.XA.Foundation.Common.Constants.ItemTypes.Product) + { + return true; + } + + return base.ShowInBreadcrumb(item); + } + + public override IRenderingModelBase GetModel() + { + IEnumerable breadcrumb; + + Item rootItem = Context.Database.GetItem(Rendering.Parameters[Sitecore.XA.Feature.Navigation.Constants.BreadcrumbRoot] ?? string.Empty); + + Item commerceRootItem = Context.Database.GetItem(_storefrontContext.CurrentStorefront.GetStartNavigationCategory()); + if (_siteContext.IsCategory || _siteContext.IsProduct) + { + // It's a catalog item so we need to concatenate the ancestors for the catalog with the ancestors on the site itself + breadcrumb = GetBreadcrumbItems(CurrentItem, rootItem) + .Concat(GetBreadcrumbItems(_siteContext.CurrentCatalogItem, commerceRootItem)) + .Where(a => a.Item.ID != commerceRootItem.ID); + } + else + { + breadcrumb = GetBreadcrumbItems(CurrentItem, rootItem); + } + + BreadcrumbRenderingModel model = new BreadcrumbRenderingModel + { + Separator = Rendering.Parameters[Sitecore.XA.Feature.Navigation.Constants.Separator] + }; + + FillBaseProperties(model); + + var breadcrumbModels = breadcrumb as BreadcrumbRenderingModel[] ?? breadcrumb.ToArray(); + if (!breadcrumbModels.Any()) + { + var fakeNav = Enumerable.Empty(); + if (Context.PageMode.IsExperienceEditor) + { + fakeNav = new FakeBreadcrumbRepository().GetBreadcrumbItems(null, null); + } + model.IsFake = true; + model.Children = fakeNav; + } + else + { + model.Children = breadcrumbModels; + } + + return model; + } + } +} \ No newline at end of file diff --git a/src/Feature/Catalog/website/Repositories/FakeBreadcrumbRepository.cs b/src/Feature/Catalog/website/Repositories/FakeBreadcrumbRepository.cs new file mode 100644 index 000000000..845cc484f --- /dev/null +++ b/src/Feature/Catalog/website/Repositories/FakeBreadcrumbRepository.cs @@ -0,0 +1,21 @@ +using System.Collections.Generic; +using Sitecore.Data.Items; +using Sitecore.XA.Feature.Navigation.Models; + +namespace Sitecore.HabitatHome.Feature.Catalog.Repositories +{ + public class FakeBreadcrumbRepository : Sitecore.XA.Feature.Navigation.Repositories.Breadcrumb.BreadcrumbRepository + { + public override IEnumerable GetBreadcrumbItems(Item currentItem, Item rootItem) + { + var fakeBreadcrumb = new List(); + for (int i = 0; i < 3; i++) + { + BreadcrumbRenderingModel fakeModel = CreateBreadcrumbModel(null, i, 2, null, $"Tag Level {i}"); + fakeBreadcrumb.Add(fakeModel); + } + + return fakeBreadcrumb; + } + } +} \ No newline at end of file diff --git a/src/Feature/Catalog/website/ServiceCollection/RegisterCatalogServices.cs b/src/Feature/Catalog/website/ServiceCollection/RegisterCatalogServices.cs new file mode 100644 index 000000000..1be437857 --- /dev/null +++ b/src/Feature/Catalog/website/ServiceCollection/RegisterCatalogServices.cs @@ -0,0 +1,31 @@ +using System.Linq; +using Microsoft.Extensions.DependencyInjection; +using Sitecore.DependencyInjection; +using Sitecore.HabitatHome.Feature.Catalog.Repositories; + +namespace Sitecore.HabitatHome.Feature.Catalog.ServiceCollection +{ + public class RegisterCatalogServices : IServicesConfigurator + { + public void Configure(IServiceCollection serviceCollection) + { + Replace(serviceCollection, ServiceLifetime.Transient); + } + + public IServiceCollection Replace( + IServiceCollection services, + ServiceLifetime lifetime) + where TService : class + where TImplementation : class, TService + { + + var descriptorToRemove = services.FirstOrDefault(d => d.ServiceType == typeof(TService)); + services.Remove(descriptorToRemove); + + var descriptorToAdd = new ServiceDescriptor(typeof(TService), typeof(TImplementation), lifetime); + services.Add(descriptorToAdd); + + return services; + } + } +} \ No newline at end of file diff --git a/src/Feature/Catalog/website/Sitecore.HabitatHome.Feature.Catalog.Website.csproj b/src/Feature/Catalog/website/Sitecore.HabitatHome.Feature.Catalog.Website.csproj index 9fcebed7c..1e8f4fc35 100644 --- a/src/Feature/Catalog/website/Sitecore.HabitatHome.Feature.Catalog.Website.csproj +++ b/src/Feature/Catalog/website/Sitecore.HabitatHome.Feature.Catalog.Website.csproj @@ -95,15 +95,32 @@ ..\..\..\..\packages\Sitecore.Mvc.NoReferences.9.0.171219\lib\NET462\Sitecore.Mvc.dll + + ..\..\..\..\lib\Modules\SXA\Sitecore.XA.Feature.Navigation.dll + + + False + ..\..\..\..\lib\Modules\SXA\Sitecore.XA.Foundation.IoC.dll + ..\..\..\..\lib\Modules\SXA\Sitecore.XA.Foundation.MarkupDecorator.dll + + False + ..\..\..\..\lib\Modules\SXA\Sitecore.XA.Foundation.Multisite.dll + ..\..\..\..\lib\Modules\SXA\Sitecore.XA.Foundation.Mvc.dll + + ..\..\..\..\lib\Modules\SXA\Sitecore.XA.Foundation.RenderingVariants.dll + ..\..\..\..\lib\Modules\SXA\Sitecore.XA.Foundation.SitecoreExtensions.dll + + ..\..\..\..\lib\Modules\SXA\Sitecore.XA.Foundation.Variants.Abstractions.dll + @@ -141,6 +158,7 @@ + @@ -161,8 +179,11 @@ + + + diff --git a/src/Feature/NearestStore/website/Views/NearestStore/NearestStore.cshtml b/src/Feature/NearestStore/website/Views/NearestStore/NearestStore.cshtml index 723483c29..6cf5d064f 100644 --- a/src/Feature/NearestStore/website/Views/NearestStore/NearestStore.cshtml +++ b/src/Feature/NearestStore/website/Views/NearestStore/NearestStore.cshtml @@ -5,48 +5,65 @@ @using Sitecore.Data.Items; @using Sitecore.Mvc -@{ +@if (!Sitecore.Context.PageMode.IsExperienceEditor) +{ + var currentItem = Html.Sitecore().CurrentItem; Item relatedProduct = Model.CatalogItem; bool isKitOrBundle = relatedProduct["Tags"] != null && !String.IsNullOrEmpty(relatedProduct["Tags"]) ? relatedProduct["Tags"].Split('|').Any(t => t.ToLower() == "kit" || t.ToLower() == "bundle") : false; -} -@if (isKitOrBundle) -{ -
-
-
+ + if (isKitOrBundle) + { +
+
+
+
-
+ } + else + { +
+
+ +
+
+
+ +
+ + +
+ + + + +
+ + + +
+
+
+ +
+
+ } } else { -
+
-
- -
- - -
- - - - -
- - - + +
+
+
- -
- -
} \ No newline at end of file diff --git a/src/Feature/Orders/website/Views/Orders/OrderReview.cshtml b/src/Feature/Orders/website/Views/Orders/OrderReview.cshtml index c82661f68..84575870a 100644 --- a/src/Feature/Orders/website/Views/Orders/OrderReview.cshtml +++ b/src/Feature/Orders/website/Views/Orders/OrderReview.cshtml @@ -63,86 +63,7 @@ var deliveryPageLocation = Model.DeliveryPageLocation; var billingPageLocation = Model.BillingPageLocation; -
- -
+

@orderTotalLabel

diff --git a/src/Feature/ProductBundle/website/Views/ProductBundle/AddBundleToCart.cshtml b/src/Feature/ProductBundle/website/Views/ProductBundle/AddBundleToCart.cshtml index 194eef46a..27172eced 100644 --- a/src/Feature/ProductBundle/website/Views/ProductBundle/AddBundleToCart.cshtml +++ b/src/Feature/ProductBundle/website/Views/ProductBundle/AddBundleToCart.cshtml @@ -9,106 +9,133 @@ @using Sitecore.Data.Items @using Sitecore.Commerce.XA.Foundation.Common; @model CatalogItemRenderingModel -@{ + +@if (!Sitecore.Context.PageMode.IsExperienceEditor) +{ Item relatedProduct = Model.CatalogItem; bool isBundle = relatedProduct["Tags"] != null && !String.IsNullOrEmpty(relatedProduct["Tags"]) ? relatedProduct["Tags"].Split('|').Any(t => t.ToLower() == "bundle") : false; -} -@if (isBundle) -{ -
- @if (!String.IsNullOrWhiteSpace(Model.ErrorMessage)) - { -
- @Model.ErrorMessage -
- } - else - { - if (Model == null) + + if (isBundle) + { +
+ @if (!String.IsNullOrWhiteSpace(Model.ErrorMessage)) { - return; +
+ @Model.ErrorMessage +
} + else + { + if (Model == null) + { + return; + } - var quantityLabel = Html.Sitecore().Field("Quantity Label", Html.Sitecore().CurrentItem); - var addToCartLabel = Html.Sitecore().Field("Add to Cart Button Label", Html.Sitecore().CurrentItem); - var addingToCartLabel = Html.Sitecore().CurrentItem["Add to Cart Button In-progress Label"]; + var quantityLabel = Html.Sitecore().Field("Quantity Label", Html.Sitecore().CurrentItem); + var addToCartLabel = Html.Sitecore().Field("Add to Cart Button Label", Html.Sitecore().CurrentItem); + var addingToCartLabel = Html.Sitecore().CurrentItem["Add to Cart Button In-progress Label"]; -
- @using (Ajax.BeginForm("AddBundleCartLine", "AddBundleToCart", null, new AjaxOptions { OnSuccess = "AddToCartForm.OnSuccess", HttpMethod = "Post" }, new { id = "AddBundleForm" })) - { - @Html.ValidationSummary(true) - @Html.Hidden("addtocart_productid", Model.ProductId) - @Html.Hidden("addtocart_variantid", string.Empty) - @Html.Hidden("addtocart_catalogname", Model.CatalogName) - @Html.Hidden("addtocart_relatedvariantids", string.Empty) - @Html.AntiForgeryToken() +
+ @using (Ajax.BeginForm("AddBundleCartLine", "AddBundleToCart", null, new AjaxOptions { OnSuccess = "AddToCartForm.OnSuccess", HttpMethod = "Post" }, new { id = "AddBundleForm" })) + { + @Html.ValidationSummary(true) + @Html.Hidden("addtocart_productid", Model.ProductId) + @Html.Hidden("addtocart_variantid", string.Empty) + @Html.Hidden("addtocart_catalogname", Model.CatalogName) + @Html.Hidden("addtocart_relatedvariantids", string.Empty) + @Html.AntiForgeryToken() -
- -
- - @Html.TextBoxFor(model => model.Quantity, new { @type = "number", @min = "1", @max = "100", @required = "required", @Value = "1", @class = "add-to-cart-qty-input" }) - +
+ +
+ + @Html.TextBoxFor(model => model.Quantity, new { @type = "number", @min = "1", @max = "100", @required = "required", @Value = "1", @class = "add-to-cart-qty-input" }) + +
-
- @Html.ValidationMessageFor(model => model.Quantity) -
- -
- } -
- } -
-} -else -{ - -
- @if (!String.IsNullOrWhiteSpace(Model.ErrorMessage)) - { -
- @Model.ErrorMessage -
- } - else - { - if (Model == null) + @Html.ValidationMessageFor(model => model.Quantity) +
+ +
+ } +
+ } +
+ } + else + { +
+ @if (!String.IsNullOrWhiteSpace(Model.ErrorMessage)) { - return; +
+ @Model.ErrorMessage +
} + else + { + if (Model == null) + { + return; + } - var quantityLabel = Html.Sitecore().Field("Quantity Label", Html.Sitecore().CurrentItem); - var addToCartLabel = Html.Sitecore().Field("Add to Cart Button Label", Html.Sitecore().CurrentItem); - var addingToCartLabel = Html.Sitecore().CurrentItem["Add to Cart Button In-progress Label"]; + var quantityLabel = Html.Sitecore().Field("Quantity Label", Html.Sitecore().CurrentItem); + var addToCartLabel = Html.Sitecore().Field("Add to Cart Button Label", Html.Sitecore().CurrentItem); + var addingToCartLabel = Html.Sitecore().CurrentItem["Add to Cart Button In-progress Label"]; -
- @using (Ajax.BeginForm("AddCartLine", "Cart", null, new AjaxOptions { OnSuccess = "AddToCartForm.OnSuccess", HttpMethod = "Post" })) - { - @Html.ValidationSummary(true) - @Html.Hidden("addtocart_productid", Model.ProductId) - @Html.Hidden("addtocart_variantid", string.Empty) - @Html.Hidden("addtocart_catalogname", Model.CatalogName) - @Html.AntiForgeryToken() +
+ @using (Ajax.BeginForm("AddCartLine", "Cart", null, new AjaxOptions { OnSuccess = "AddToCartForm.OnSuccess", HttpMethod = "Post" })) + { + @Html.ValidationSummary(true) + @Html.Hidden("addtocart_productid", Model.ProductId) + @Html.Hidden("addtocart_variantid", string.Empty) + @Html.Hidden("addtocart_catalogname", Model.CatalogName) + @Html.AntiForgeryToken() -
- -
- - @Html.TextBoxFor(model => model.Quantity, new { @type = "number", @min = "1", @max = "100", @required = "required", @Value = "1", @class = "add-to-cart-qty-input" }) - +
+ +
+ + @Html.TextBoxFor(model => model.Quantity, new { @type = "number", @min = "1", @max = "100", @required = "required", @Value = "1", @class = "add-to-cart-qty-input" }) + +
+ @Html.ValidationMessageFor(model => model.Quantity) +
+ +
+ } +
+ } +
+ } +} +else +{ + var quantityLabel = Html.Sitecore().Field("Quantity Label", Html.Sitecore().CurrentItem); + var addToCartLabel = Html.Sitecore().Field("Add to Cart Button Label", Html.Sitecore().CurrentItem); + var addingToCartLabel = Html.Sitecore().CurrentItem["Add to Cart Button In-progress Label"]; +
+ +
+
+ +
+ + @Html.TextBoxFor(model => model.Quantity, new { @type = "number", @min = "1", @max = "100", @required = "required", @Value = "1", @class = "add-to-cart-qty-input" }) +
- @Html.ValidationMessageFor(model => model.Quantity) -
- -
- } +
+
+ +
- }
-} + } + \ No newline at end of file diff --git a/src/Feature/ProductBundle/website/Views/ProductBundle/ProductBundle.cshtml b/src/Feature/ProductBundle/website/Views/ProductBundle/ProductBundle.cshtml index 6045d817e..ed753e41e 100644 --- a/src/Feature/ProductBundle/website/Views/ProductBundle/ProductBundle.cshtml +++ b/src/Feature/ProductBundle/website/Views/ProductBundle/ProductBundle.cshtml @@ -5,50 +5,53 @@ @using Sitecore.Mvc @using Sitecore.Data.Items @model CatalogItemRenderingModel -@{ + +@if (!Sitecore.Context.PageMode.IsExperienceEditor) +{ + Item currentItem = Html.Sitecore().CurrentItem; Item relatedProduct = Model.CatalogItem; bool hasTag = relatedProduct["Tags"] != null && !String.IsNullOrEmpty(relatedProduct["Tags"]) ? relatedProduct["Tags"].Split('|').Any(t => t.ToLower() == "bundle") : false; -} -@if (hasTag) -{ -
- - -
- - - + if (hasTag) + { +
+ + + +
+ + + + +
+ +