Posts

Showing posts from July, 2024

Introduction to SAP Hybris / SAP Commerce Cloud

SAP Commerce Cloud [formerly SAP Hybris] is an eCommerce platform and PCM Software also known as eCommerce Solution using which we can develop eCommerce websites like Amazon, Flipkart, Shopper Stop and Ajio etc. Here PCM stands for Product & Content Management, which is used to manage products and content in the eCommerce website. eCommerce is a platform where we can buy or sell any products or services to the customers through internet. SAP Hybris was originally introduced in 1997 by German based company named Hybris and In 2013, SAP acquired Hybris. Other than SAP Hybris, there are multiple other competitors in the market including: Sales Force Commerce Cloud [Formerly known as Demandware] Adobe Commerce [Formerly known as Magento] HCL Commerce Cloud [Formerly IBM WebSphere Commerce] Oracle CX Commerce BigCommerce Enterprise and etc. Advantages of SAP Hybris over other eCommerce solutions: Advance Search Engine. Seamless Integration with other 3rd party systems. B2B & B2C ...

Groovy Script to fetch available Gift Cards in SAP Hybris:

  In this article, we are going to see how to fetch available Gift Cards in Hybris. Groovy script to fetch available Gift Cards in Hybris: import de.hybris.platform.servicelayer.search.SearchResult; import com.core.model.GiftCardModel; import org.apache.commons.collections4.CollectionUtils; import java.lang.*; import java.util.Collections; // Flexible Search Query fQuery = "Select {PK} from {GiftCard as g JOIN GiftCardType as type on {g.type}={type.pk}} where {type.code} = 'CSR'"; // we can mention any type of the Gift card in where clause. // Initiate necessary services  flexibleSearchService = spring.getBean("flexibleSearchService"); final SearchResult<GiftCardModel> searchResult = flexibleSearchService.search(fQuery); List<GiftCardModel> giftCards = CollectionUtils.isNotEmpty(searchResult.getResult()) ? searchResult.getResult() : Collections.emptyList(); println 'No. of Gift Cards found: ' + giftCards.size(); for (GiftCardModel giftCar...

Creating Gift Cards with INR value using Groovy script in SAP Hybris

In this article, we are going to explore how to create a number of Gift Cards with INR [₹] value using Groovy script in Hybris. Groovy script to create a Gift Cards with INR [ ₹ ] value: import com.core.model.GiftCardModel; import com.core.service.giftcard.GiftCardService; import com.core.enums.GiftCardType; import com.core.enums.GiftCardSourceSystem; // Initiate necessary services  gittCardService = spring.getBean("giftCardService"); userService = spring.getBean("userService"); modelService = spring.getBean("modelService"); int gift_card_count = 10; // Here, pass any number to generate 'n' number of gift cards double gift_card_amount = 100.0; // INR value of the gift card var customer_email = 'dummy@gmail.com'; // provided dummy email id and later on we can share this generated gift card with original customer for (int i = 1; i <= gift_card_count; i++) {           GiftCardModel giftCardModel = giftCardService.giftCardGenerator( gift_car...