This repository contains the source code for a Product Comparison solution

Overview

Product Comparison Installation Guide

This repository contains the source code for a Product Comparison solution. Please report any issues here.

Instalation steps:

  1. Run the next command.
ant addoninstall -Daddonnames="productcomparison" -DaddonStorefront.yacceleratorstorefront="teststorefront"
  1. Import the next impex file.
# -----------------------------------------------------------------------
# Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved.
# -----------------------------------------------------------------------
$contentCatalog = powertoolsContentCatalog
$contentCatalogName = Powertools Content Catalog
$contentCV = catalogVersion(CatalogVersion.catalog(Catalog.id[default=$contentCatalog]), CatalogVersion.version[default=Staged])[default=$contentCatalog:Staged]
$productCatalog = powertoolsProductCatalog
$productCatalogName = Powertools Product Catalog
$productCV = catalogVersion(catalog(id[default=$productCatalog]), version[default='Staged'])[unique=true, default=$productCatalog:Staged]
$contentPage = contentPage(uid, $contentCV);
$product = product(code, $productCV)
$category = category(code, $productCV)
$addonExtensionName = b2bacceleratoraddon
$medias = medias(code, $contentCV);
$mediaContainer = media(qualifier, $contentCV);
$siteUid = powertools
###### Product Comparison Page Start ######
INSERT_UPDATE ProductComparisonComponent; $contentCV[unique = true]; uid[unique = true]         ; name                         ; &componentRef              ;
                                        ;                          ; ProductComparisonComponent ; Product Comparison Component ; ProductComparisonComponent ;

INSERT_UPDATE ContentPage; $contentCV[unique = true]; uid[unique = true]; name               ; masterTemplate(uid, $contentCV); label; defaultPage[default = 'true']; approvalStatus(code)[default = 'approved']; homepage[default = 'false']; previewImage(code, $contentCV)[default = 'ContentPageModel__function_preview']
                         ;                          ; productComparison ; Product Comparison ; AccountPageTemplate            ; productComparison

INSERT_UPDATE ContentSlotForPage; $contentCV[unique = true]; uid[unique = true]            ; position[unique = true]; page(uid, $contentCV)[unique = true][default = 'productComparison']; contentSlot(uid, $contentCV)[unique = true]; ; ;
                                ;                          ; SideContent-productComparison ; SideContent            ;                                                                    ; SideContent-productComparison              ; ; ;
                                ;                          ; BodyContent-productComparison ; BodyContent            ;                                                                    ; BodyContent-productComparison              ; ; ;

INSERT_UPDATE ContentSlot; $contentCV[unique = true]; uid[unique = true]            ; name                                     ; active; cmsComponents(&componentRef); ; ;
                         ;                          ; SideContent-productComparison ; Side Content Slot for product comparison ; true  ;                             ; ; ;
                         ;                          ; BodyContent-productComparison ; Body Content Slot for product comparison ; true  ; ProductComparisonComponent  ; ; ;

INSERT_UPDATE AddToCompareAction; $contentCV[unique = true]; uid[unique = true] ; url                     ; name                  ; &actionRef
                                ;                          ; AddToCompareAction ; /product-comparison/add ; Add To Compare Action ; AddToCompareAction

INSERT_UPDATE ListAddToCompareAction; $contentCV[unique = true]; uid[unique = true]     ; url                     ; name                       ; &actionRef
                                    ;                          ; ListAddToCompareAction ; /product-comparison/add ; List Add To Compare Action ; ListAddToCompareAction

INSERT_UPDATE ApplicableCmsActionsTypeForCmsComponent; target(code)[unique = true]; source(code)[unique = true];
                                                     ; ProductListComponent       ; ListAddToCompareAction     ;
                                                     ; ProductGridComponent       ; ListAddToCompareAction     ;
                                                     ; ProductAddToCartComponent  ; ListAddToCompareAction     ;
                                                     ; JspIncludeComponent        ; ListAddToCompareAction     ;

INSERT_UPDATE CMSProductListComponent; $contentCV[unique = true]; uid[unique = true]   ; actions(uid, $contentCV);
                                     ;                          ; ProductListComponent ; ListAddToCompareAction  ;

INSERT_UPDATE ProductGridComponent; $contentCV[unique = true]; uid[unique = true]   ; actions(uid, $contentCV);
                                  ;                          ; ProductGridComponent ; ListAddToCompareAction  ;

INSERT_UPDATE SearchResultsListComponent; $contentCV[unique = true]; uid[unique = true]; actions(uid, $contentCV);
                                        ;                          ; SearchResultsList ; ListAddToCompareAction  ;

INSERT_UPDATE SearchResultsGridComponent; $contentCV[unique = true]; uid[unique = true]; actions(uid, $contentCV);
                                        ;                          ; SearchResultsGrid ; ListAddToCompareAction  ;

INSERT_UPDATE ContentSlotName; name[unique = true]; template(uid, $contentCV)[unique = true][default = 'ProductDetailsPageTemplate']; validComponentTypes(code); compTypeGroup(code)
                             ; AddToCompareSlot   ;                                                                                 ;                          ; wide
INSERT_UPDATE ContentSlot; $contentCV[unique = true]; uid[unique = true]; name                    ; active
                         ;                          ; AddToCompareSlot  ; Add To CompareSlot Slot ; true

INSERT_UPDATE ContentSlotForTemplate; $contentCV[unique = true]; uid[unique = true]              ; position[unique = true]; pageTemplate(uid, $contentCV)[unique = true][default = 'ProductDetailsPageTemplate']; contentSlot(uid, $contentCV)[unique = true]; allowOverwrite
                                    ;                          ; AddToCompareSlot-ProductDetails ; AddToCompareSlot       ;                                                                                     ; AddToCompareSlot                           ; true

INSERT_UPDATE ContentSlot; $contentCV[unique = true]; uid[unique = true]; cmsComponents(uid, $contentCV)
                         ;                          ; AddToCompareSlot  ; AddToCompareAction

###### Product Comparison Page End ######

###### Product Comparison Info Start ######
INSERT_UPDATE ProductComparisonInfoComponent; uid[unique = true]             ; name                                  ; $contentCV[unique = true]
                                            ; ProductComparisonInfoComponent ; Product Comparison Info CMS Component ;

INSERT_UPDATE ContentSlot; $contentCV[unique = true]; uid[unique = true] ; cmsComponents(uid, $contentCV)
                         ;                          ; ProductCompareSlot ; ProductComparisonInfoComponent

INSERT_UPDATE ContentSlotName; name[unique = true]; template(uid, $contentCV)[unique = true][default = 'LandingPage2Template']; validComponentTypes(code)      ; compTypeGroup(code)
                             ; ProductCompare     ;                                                                           ; ProductComparisonInfoComponent ;

INSERT_UPDATE ContentSlotForTemplate; $contentCV[unique = true]; uid[unique = true]              ; position[unique = true]; pageTemplate(uid, $contentCV)[unique = true][default = 'LandingPage2Template']; contentSlot(uid, $contentCV)[unique = true]; allowOverwrite
                                    ;                          ; ProductCompareSlot-LandingPage2 ; ProductCompare         ;                                                                               ; ProductCompareSlot                         ; true

INSERT_UPDATE ContentSlotName; name[unique = true]; template(uid, $contentCV)[unique = true][default = 'ProductGridPageTemplate']; validComponentTypes(code)      ; compTypeGroup(code)
                             ; ProductCompare     ;                                                                              ; ProductComparisonInfoComponent ;


INSERT_UPDATE ContentSlotForTemplate; $contentCV[unique = true]; uid[unique = true]                 ; position[unique = true]; pageTemplate(uid, $contentCV)[unique = true][default = 'ProductGridPageTemplate']; contentSlot(uid, $contentCV)[unique = true]; allowOverwrite
                                    ;                          ; ProductCompareSlot-ProductGridPage ; ProductCompare         ;                                                                                  ; ProductCompareSlot                         ; true

INSERT_UPDATE ContentSlotName; name[unique = true]; template(uid, $contentCV)[unique = true][default = 'ProductListPageTemplate']; validComponentTypes(code)      ; compTypeGroup(code)
                             ; ProductCompare     ;                                                                              ; ProductComparisonInfoComponent ;


INSERT_UPDATE ContentSlotForTemplate; $contentCV[unique = true]; uid[unique = true]                         ; position[unique = true]; pageTemplate(uid, $contentCV)[unique = true][default = 'ProductListPageTemplate']; contentSlot(uid, $contentCV)[unique = true]; allowOverwrite
                                    ;                          ; ProductCompareSlot-ProductListPageTemplate ; ProductCompare         ;                                                                                  ; ProductCompareSlot                         ; true



INSERT_UPDATE ContentSlotName; name[unique = true]; template(uid, $contentCV)[unique = true][default = 'SearchResultsGridPageTemplate']; validComponentTypes(code)      ; compTypeGroup(code)
                             ; ProductCompare     ;                                                                                    ; ProductComparisonInfoComponent ;


INSERT_UPDATE ContentSlotForTemplate; $contentCV[unique = true]; uid[unique = true]                   ; position[unique = true]; pageTemplate(uid, $contentCV)[unique = true][default = 'SearchResultsGridPageTemplate']; contentSlot(uid, $contentCV)[unique = true]; allowOverwrite
                                    ;                          ; ProductCompareSlot-SearchResultsGrid ; ProductCompare         ;                                                                                        ; ProductCompareSlot                         ; true

INSERT_UPDATE ContentSlotName; name[unique = true]; template(uid, $contentCV)[unique = true][default = 'SearchResultsListPageTemplate']; validComponentTypes(code)      ; compTypeGroup(code)
                             ; ProductCompare     ;                                                                                    ; ProductComparisonInfoComponent ;


INSERT_UPDATE ContentSlotForTemplate; $contentCV[unique = true]; uid[unique = true]                               ; position[unique = true]; pageTemplate(uid, $contentCV)[unique = true][default = 'SearchResultsListPageTemplate']; contentSlot(uid, $contentCV)[unique = true]; allowOverwrite
                                    ;                          ; ProductCompareSlot-SearchResultsListPageTemplate ; ProductCompare         ;                                                                                        ; ProductCompareSlot                         ; true


INSERT_UPDATE ContentSlotName; name[unique = true]; template(uid, $contentCV)[unique = true][default = 'ProductDetailsPageTemplate']; validComponentTypes(code)      ; compTypeGroup(code)
                             ; ProductCompare     ;                                                                                 ; ProductComparisonInfoComponent ;


INSERT_UPDATE ContentSlotForTemplate; $contentCV[unique = true]; uid[unique = true]                ; position[unique = true]; pageTemplate(uid, $contentCV)[unique = true][default = 'ProductDetailsPageTemplate']; contentSlot(uid, $contentCV)[unique = true]; allowOverwrite
                                    ;                          ; ProductCompareSlot-ProductDetails ; ProductCompare         ;                                                                                     ; ProductCompareSlot                         ; true

###### Product Comparison Info End ######

  1. Run a Catalog Sync.

Configure the product comparison page.

To add a new attribute to the product comparison page, you need to write an impex file with the following configuration:

  • name : The product attribute backend identifier (for example, code, name, unit, and so on).
  • fieldValueProvider : This attribute is used to retrive the value for the product attribute. A value provider needs to implement the ProductComparisonFieldValueProvider interface (for example, DefaultVariantCategoryFieldValueProvider). The fieldValueProvider can be left blank if the product attribut is a text.
  • fieldNameProvider : This attribute is used to change the displayed attribute name. A feld label provider needs to implement the ProductComparisonFieldLabelProvider interface (for example, DefaultVariantCategoryFieldLabelProvider). If the attribute is blank, the backoffice label will be used.

An example for product comparison configuration:

INSERT_UPDATE ProductComparisonProperty; name  ; fieldValueProvider                ; fieldNameProvider                ;
                                       ; name  ;                                   ;                                  ;
                                       ; unit  ; unitComparisonFieldValueProvider  ;                                  ;
                                       ; color ; colorComparisonFieldValueProvider ; colorComparisonFieldNameProvider ;

Images

Product Listing Page

ProductComparison

Product Details Page

The bottom pop-up will be displayed in the Product Listing Page and the Product Details Page. ProductComparison

Product comparison table

ProductComparison

Product comparison table (Highlighted differences)

ProductComparison

You might also like...

This repository contains solutions to all the Bit Manipulations problems and coding challenges

This repository contains solutions to all the Bit Manipulations problems and coding challenges. I have also written a course on how to solve problems using bit manipulation. You can visit it here: https://www.educative.io/courses/bit-manipulation (Grokking Bit Manipulation For Coding Interviews)

Nov 15, 2022

This repository contains my first project of Suven Internship.

This repository contains my first project of Suven Internship.

Consumer-Loan-Assistant PROBLEM STATEMENT (Ever wonder just) How much those credit card accounts are costing you? ABSTRACT This project will help you

Sep 16, 2022

This repository contains examples of modern Java features that appear in various videos I'm creating for my courses at Vanderbilt.

This repository contains examples of modern Java features that appear in various videos I'm creating for my courses at Vanderbilt. It's organized into

Dec 1, 2022

The Google code scanner API provides a complete solution for scanning codes without requiring your app to request camera permission.

Android Google Code Scanner The Google code scanner API provides a complete solution for scanning codes without requiring your app to request camera p

Nov 23, 2022

This is the primary repository for the source code of the OpenJML project.

OpenJML This is the primary repository for the OpenJML project. The active issues list for OpenJML development is here and the wiki contains informati

Dec 22, 2022

This repository will contain useful matriel and source code for OOP exam.

This repository will contain useful matriel and source code for OOP exam.

PrepForOopExam Hello everyone! I assume that you're currently studying for your OOP exam and you are probably tired from exercise 5 , don't know how o

Sep 20, 2022

It contains a simple program to apply basic arithmetic operations in Morse code

Morse-Calculator By Mohamad Farag F. Makkawi This project falls under DSL (Domain Specific Language) . the Input is an equation in which simple arithm

Apr 29, 2022

Proj that contains code for merging files' data into one

Proj that contains code for merging files' data into one

Merge System Program that's written on Java for merging data (int or string types) of files (preferably .txt) into one file. Merge System Note: progra

Nov 27, 2022

Community-Driven Game Server Development solution for Java Developers based on DEEPINTHINK MagOKO Project.

MagOKO Stack Community-Driven Game Server Development solution for Java Developers based on DEEPINTHINK MagOKO Project. License Copyright 2021-present

Jun 1, 2021
Owner
Mărgărit Marian Cătălin
Mărgărit Marian Cătălin
This repository contains source code examples to support my course Spring Data JPA and Hibernate Beginner to Guru

Spring Data JPA - Spring Data JPA This repository contains source code examples to support my course Spring Data JPA and Hibernate Beginner to Guru Co

John Thompson 8 Aug 24, 2022
An Open-Source repository 🌎 that contains all the Data Structures and Algorithms concepts and their implementation, programming questions and Interview questions

An Open-Source repository ?? that contains all the Data Structures and Algorithms concepts and their implementation, programming questions and Interview questions. The main aim of this repository is to help students who are learning Data Structures and Algorithms or preparing for an interview.

Aritra Das 19 Dec 29, 2022
This repository contains all the code developed during lessions of Foundations of Informatics T2.

If you're using the content of this Repostory, please consider to Watch or Star it in order to help tracking how many people are drawing on it. Founda

null 7 Nov 24, 2022
This repository contains the code for the Runescape private server project, and this repo is soley maintained by @Avanae and @ThePolyphia and @Xeveral

Runescape: The private server project. A Runescape private server based on the 2009 era. This repository contains the code for the Runescape private s

ProjectArchitecture 4 Oct 1, 2022
Ptubes is a database disaster recovery product based on the PITR (Point In Time Recovery) method

Ptubes is a database disaster recovery product based on the PITR (Point In Time Recovery) method, which can be used to restore the entire database to a specific point in time to help users improve the reliability and security of the database

美团 Meituan 46 Nov 29, 2022
The open source CyborgFlow project is an out-of-the-box (OOTB) solution to perform load test on your online system.

CyborgFlow CyborgFlow provides an out-of-the-box (OOTB) solution to perform load test on your online system, powered by Apache APISIX, Apache SkyWalki

SphereEx 70 Nov 30, 2022
A repository that contains the backend part of the Human Resources Management System.

Human Resources Management System Backend A human resources management system is a form of human resources (HR) software that combines several systems

Bulent Baris Kilic 24 Dec 26, 2022
This repository is for Todo application. This contains the Backend part of the application.

Todo Application 개요(Abstract) 개인용 할일 목록 리스트 앱플리케이션 구축 (Personal Todo List Application) 목적 1. React.js기초, AWS서버 활용, 스프링 부트 공부 목적으로 프로젝트 시작했습니다.

Thom 3 Jan 8, 2022
This repository contains CQRS implementation in Java

CQRS Design Pattern Java This repository contains CQRS implementation in Java. I've written this code-base step by step on Medium that is my Turkish c

Yusuf Yılmaz 14 Oct 25, 2022
This repository contains Java programs to become zero to hero in Java. Programs related to each and every concep are present from easy to intermidiate level.

Learn Java Programming In this repository you will find topic wise programs of java from basics to intermediate. This follows topic wise approach that

Sahil Batra 15 Oct 9, 2022