From 484886371322660657dda97045a09fdc0556f395 Mon Sep 17 00:00:00 2001 From: PJaneta Date: Fri, 11 Oct 2024 09:17:36 +0200 Subject: [PATCH] AD-319 Create CMS Components for Express Payment Methods Placeholder on Cart and PDP Pages --- ...artExpressCheckoutComponentController.java | 19 +++++++++++++ ...uctExpressCheckoutComponentController.java | 19 +++++++++++++ ...yenaccexpresscheckoutcartpagecomponent.jsp | 10 +++++++ ...accexpresscheckoutproductpagecomponent.jsp | 8 ++++++ .../adyenv6b2ccheckoutaddon-items.xml | 8 ++++++ .../impex/projectdata-cms-config.impex | 27 ++++++++++++++----- 6 files changed, 84 insertions(+), 7 deletions(-) create mode 100644 adyenv6b2ccheckoutaddon/acceleratoraddon/web/src/com/adyen/v6/controllers/cms/AdyenAccCartExpressCheckoutComponentController.java create mode 100644 adyenv6b2ccheckoutaddon/acceleratoraddon/web/src/com/adyen/v6/controllers/cms/AdyenAccProductExpressCheckoutComponentController.java create mode 100644 adyenv6b2ccheckoutaddon/acceleratoraddon/web/webroot/WEB-INF/views/responsive/cms/adyenaccexpresscheckoutcartpagecomponent.jsp create mode 100644 adyenv6b2ccheckoutaddon/acceleratoraddon/web/webroot/WEB-INF/views/responsive/cms/adyenaccexpresscheckoutproductpagecomponent.jsp diff --git a/adyenv6b2ccheckoutaddon/acceleratoraddon/web/src/com/adyen/v6/controllers/cms/AdyenAccCartExpressCheckoutComponentController.java b/adyenv6b2ccheckoutaddon/acceleratoraddon/web/src/com/adyen/v6/controllers/cms/AdyenAccCartExpressCheckoutComponentController.java new file mode 100644 index 000000000..4a9fc8488 --- /dev/null +++ b/adyenv6b2ccheckoutaddon/acceleratoraddon/web/src/com/adyen/v6/controllers/cms/AdyenAccCartExpressCheckoutComponentController.java @@ -0,0 +1,19 @@ +package com.adyen.v6.controllers.cms; + +import com.adyen.v6.model.contents.components.AdyenAccExpressCheckoutCartPageComponentModel; +import de.hybris.platform.addonsupport.controllers.cms.AbstractCMSAddOnComponentController; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; + +import javax.servlet.http.HttpServletRequest; + +@Controller(AdyenAccExpressCheckoutCartPageComponentModel._TYPECODE + "Controller") +@RequestMapping(value = "/view/" + AdyenAccExpressCheckoutCartPageComponentModel._TYPECODE + "Controller") +public class AdyenAccCartExpressCheckoutComponentController extends AbstractCMSAddOnComponentController { + + @Override + protected void fillModel(final HttpServletRequest request, final Model model, final AdyenAccExpressCheckoutCartPageComponentModel component) { + model.addAttribute("test", "testValue"); + } +} diff --git a/adyenv6b2ccheckoutaddon/acceleratoraddon/web/src/com/adyen/v6/controllers/cms/AdyenAccProductExpressCheckoutComponentController.java b/adyenv6b2ccheckoutaddon/acceleratoraddon/web/src/com/adyen/v6/controllers/cms/AdyenAccProductExpressCheckoutComponentController.java new file mode 100644 index 000000000..81e0502b7 --- /dev/null +++ b/adyenv6b2ccheckoutaddon/acceleratoraddon/web/src/com/adyen/v6/controllers/cms/AdyenAccProductExpressCheckoutComponentController.java @@ -0,0 +1,19 @@ +package com.adyen.v6.controllers.cms; + +import com.adyen.v6.model.contents.components.AdyenAccExpressCheckoutProductPageComponentModel; +import de.hybris.platform.addonsupport.controllers.cms.AbstractCMSAddOnComponentController; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; + +import javax.servlet.http.HttpServletRequest; + +@Controller(AdyenAccExpressCheckoutProductPageComponentModel._TYPECODE + "Controller") +@RequestMapping(value = "/view/" + AdyenAccExpressCheckoutProductPageComponentModel._TYPECODE + "Controller") +public class AdyenAccProductExpressCheckoutComponentController extends AbstractCMSAddOnComponentController { + + @Override + protected void fillModel(final HttpServletRequest request, final Model model, final AdyenAccExpressCheckoutProductPageComponentModel component) { + model.addAttribute("test", "testValue"); + } +} diff --git a/adyenv6b2ccheckoutaddon/acceleratoraddon/web/webroot/WEB-INF/views/responsive/cms/adyenaccexpresscheckoutcartpagecomponent.jsp b/adyenv6b2ccheckoutaddon/acceleratoraddon/web/webroot/WEB-INF/views/responsive/cms/adyenaccexpresscheckoutcartpagecomponent.jsp new file mode 100644 index 000000000..700402a84 --- /dev/null +++ b/adyenv6b2ccheckoutaddon/acceleratoraddon/web/webroot/WEB-INF/views/responsive/cms/adyenaccexpresscheckoutcartpagecomponent.jsp @@ -0,0 +1,10 @@ +<%@ page trimDirectiveWhitespaces="true" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + +
+
+ Cart Page Express Checkout component +
+ ${test} +
+
diff --git a/adyenv6b2ccheckoutaddon/acceleratoraddon/web/webroot/WEB-INF/views/responsive/cms/adyenaccexpresscheckoutproductpagecomponent.jsp b/adyenv6b2ccheckoutaddon/acceleratoraddon/web/webroot/WEB-INF/views/responsive/cms/adyenaccexpresscheckoutproductpagecomponent.jsp new file mode 100644 index 000000000..702561d7d --- /dev/null +++ b/adyenv6b2ccheckoutaddon/acceleratoraddon/web/webroot/WEB-INF/views/responsive/cms/adyenaccexpresscheckoutproductpagecomponent.jsp @@ -0,0 +1,8 @@ +<%@ page trimDirectiveWhitespaces="true" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + +
+ Product Page Express Checkout component +
+ ${test} +
\ No newline at end of file diff --git a/adyenv6b2ccheckoutaddon/resources/adyenv6b2ccheckoutaddon-items.xml b/adyenv6b2ccheckoutaddon/resources/adyenv6b2ccheckoutaddon-items.xml index 19dc5fa6c..dabc6f54e 100644 --- a/adyenv6b2ccheckoutaddon/resources/adyenv6b2ccheckoutaddon-items.xml +++ b/adyenv6b2ccheckoutaddon/resources/adyenv6b2ccheckoutaddon-items.xml @@ -19,5 +19,13 @@ xsi:noNamespaceSchemaLocation="items.xsd"> + + Represents express checkout options for product page. + + + Represents express checkout options for product page. + diff --git a/adyenv6b2ccheckoutaddon/resources/impex/projectdata-cms-config.impex b/adyenv6b2ccheckoutaddon/resources/impex/projectdata-cms-config.impex index ab834040c..4ae5791b8 100644 --- a/adyenv6b2ccheckoutaddon/resources/impex/projectdata-cms-config.impex +++ b/adyenv6b2ccheckoutaddon/resources/impex/projectdata-cms-config.impex @@ -1,10 +1,23 @@ -$contentCatalog=electronicsContentCatalog -$contentCVS=catalogVersion(CatalogVersion.catalog(Catalog.id[default=$contentCatalog]),CatalogVersion.version[default=Staged])[default=$contentCatalog:Staged] -$contentCVO=catalogVersion(CatalogVersion.catalog(Catalog.id[default=$contentCatalog]),CatalogVersion.version[default=Online])[default=$contentCatalog:Online] +$contentCatalog = electronicsContentCatalog +$contentCVS = catalogVersion(CatalogVersion.catalog(Catalog.id[default = $contentCatalog]), CatalogVersion.version[default = Staged])[default = $contentCatalog:Staged] +$contentCVO = catalogVersion(CatalogVersion.catalog(Catalog.id[default = $contentCatalog]), CatalogVersion.version[default = Online])[default = $contentCatalog:Online] -INSERT_UPDATE JspIncludeComponent;uid[unique=true];page;$contentCVS[unique=true] - ;CartComponent;/WEB-INF/views/responsive/pages/cart/cartDisplay.jsp +INSERT_UPDATE JspIncludeComponent; uid[unique = true]; page; $contentCVS[unique = true] + ; CartComponent ; /WEB-INF/views/responsive/pages/cart/cartDisplay.jsp -INSERT_UPDATE JspIncludeComponent;uid[unique=true];page;$contentCVO[unique=true] - ;CartComponent;/WEB-INF/views/responsive/pages/cart/cartDisplay.jsp \ No newline at end of file +INSERT_UPDATE JspIncludeComponent; uid[unique = true]; page; $contentCVO[unique = true] + ; CartComponent ; /WEB-INF/views/responsive/pages/cart/cartDisplay.jsp + +INSERT_UPDATE ContentSlot; $contentCVS[unique = true]; uid[unique = true]; cmsComponents(&componentRef)[mode = merge] + ; ; AddToCartSlot ; AccAdyenProductExpressCheckout + +INSERT_UPDATE AdyenAccExpressCheckoutProductPageComponent; $contentCVS[unique = true]; uid[unique = true] ; name ; &componentRef + ; ; AccAdyenProductExpressCheckout ; Adyen Accelerator Product Page Express Checkout ; AccAdyenProductExpressCheckout + +INSERT_UPDATE ContentSlot; $contentCVS[unique = true]; uid[unique = true] ; cmsComponents($contentCVS, uid) + ; ; TopContent-cartPage ; AccAdyenCartExpressCheckout,CartComponent + ; ; BottomContentSlot-cartPage ; CheckoutComponent,AccAdyenCartExpressCheckout,CartSuggestions + +INSERT_UPDATE AdyenAccExpressCheckoutCartPageComponent; $contentCVS[unique = true]; uid[unique = true] ; name ; &componentRef + ; ; AccAdyenCartExpressCheckout ; Adyen Accelerator Cart Page Express Checkout ; AccAdyenCartExpressCheckout