How Do You Increase the Database Column Length For An Itemtype Attribute?

In SAP Hybris Commerce 6.x, the default database column length for an Itemtype Attribute String type is 255 characters.  A client recently asked to increase the database column length for the Orders table P_NAME column from the default 255 variable characters length to 500 variable characters length. In this tutorial, I will show you how to properly increase the database column in SAP Hybris Commerce. For this tutorial, I'm using the default Hybris database, HSQLDB. Open the <Your Hybris DIR>/ext/core/resources/core-items.xmll file using your preferred text file editor. Once the core-items.xml file is open, find the attribute qualifier="name" under AbstractOrder itemtype node. For …

How Do I Validate Outbound Connections to Third Party E-Commerce Solutions Without SSH Access?

I recently worked on a Hybris Commerce implementation where the DevOps role was managed by an external, cloud service provider.  In this externally managed DevOps situation, the Hybris development team were prevented from accessing the production Linux servers directly, and only the external DevOps team had direct access to the production servers. Sound familiar? This Hybris implementation, like most Hybris implementations, included third-party integrations to payment and tax web services. Each third-party integration's IP address or domain had to be whitelisted by the external DevOps team before the Hybris Commerce platform was able to connect with the third-party service successfully. On-premise services also had to …

How Do I Programmatically Display Base Products That Have Variant Products in Hybris Commerce?

This tutorial provides step by step instructions how to display base products that have variant products using Groovy. Step by Step Instructions 1. Goto to HAC in your Web browser. (If Hybris is running on your local machine, type https://localhost:9002/ in your Web browser URL) 2. Type your user name and password once HAC is displayed. (The following screenshot displays the HAC login page with username and password provided) 3. Once you've logged in successfully, click on Console -> Scripting Languages 4.  Copy and paste the following code into the Console window: import de.hybris.platform.servicelayer.search.FlexibleSearchService import de.hybris.platform.servicelayer.search.SearchResult; import de.hybris.platform.core.model.product.ProductModel import de.hybris.platform.variants.model.VariantProductModel; Map<String, Object> params …

How Do I Display a List of Available Catalogs in Hybris Commerce?

This tutorial will provide step by step instructions to display a list of available catalogs in your Hybris Commerce implementation. Step by Step Instructions 1. Goto to HAC in your Web browser. (If Hybris is running on your local machine, type https://localhost:9002/ in your Web browser URL) 2. Type your user name and password once HAC is displayed. (The following screenshot displays the HAC login page with username and password provided) 3. Once you've logged in successfully, click on Console -> Scripting Languages 4.  Copy and paste the following code into the Console window: import de.hybris.platform.catalog.CatalogService; import de.hybris.platform.core.Registry; import de.hybris.platform.catalog.model.CatalogModel; CatalogService …

How Do I Set Foreign Exchange Rates Using an Impex Script?

  # Currencies $usaCurrency=USD $ukCurrency=GBP $audCurrency=AUD $europeCurrency=EUR $chinaCurrency=CNY $canadaCurrency=CAD $norwayCurrency=NOK $swedenCurrency=SEK # Currencies INSERT_UPDATE Currency ;isocode[unique=true] ;conversion ;$usaCurrency ;1 ;$ukCurrency ;0.75 ;$audCurrency ;1.26 ;$europeCurrency ;0.85 ;$chinaCurrency ;6.59 ;$canadaCurrency ;1.25 ;$norwayCurrency ;7.89 ;$swedenCurrency ;8.10 The foreign exchange rates are stored in the Currency item type Conversion attribute.  In practice, you would create a Cron Job to update the foreign exchange rates in Hybris Commerce as often as required to effectively run your business.

How Do You Setup Custom Error Pages in the web.xml File?

Prior to go-live, it's important to establish custom error pages to prevent unexpected behavior from those pesky 500 HTTP status codes. Although you could perform a similar implementation using the Apache Web Server, you may also configure custom error pages using Hybris Commerce's web.xml file using the following XML snippet: <error-page> <error-code>500</error-code> <location>/WEB-INF/views/mobile/pages/error/ServerError.jsp</location> </error-page> <error-page> <error-code>503</error-code> <location>/WEB-INF/views/mobile/pages/error/ServerError.jsp</location> </error-page> <error-page> <exception-type>java.lang.Throwable</exception-type> <location>/WEB-INF/views/mobile/pages/error/ServerError.jsp</location> </error-page>

How Do You Create a New Content Page With an ImpEx File?

ImpEx files may create new content pages in Hybris Commerce. In this tutorial, we will create the ImpEx for creating a new “Contact Us” page. Here's the ImpEx for creating a new "Contact Us" Page: $contentCatalog=yourContentCatalog $contentCV=catalogVersion(CatalogVersion.catalog (Catalog.id[default=$contentCatalog]), CatalogVersion.version[default=Staged]) [default=$contentCatalog:Staged] 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'];; contact;Contact Us;ContentPage2Template;/contact ImpEx Review: $contentCatalog: The variable name that contains the name of the desired content catalog the "Contact Us" page should belong to. $contentCV: The variable name that contains the name of the desired catalog version. Hybris best practice is to set the catalog version to Staged when writing your ImpEx files/scripts. uid: The …

How Do You Verify Password Encoding for Users and Customers in Hybris Commerce?

Hybris Commerce's default encoding strategy is plain text. Obviously, this encoding strategy is not safe, and must be changed before going live with your Hybris implementation. To verify the encoding strategy has been changed from plain text, you should run the following FlexibleSearch query in HAC or backoffice: select {uid},{password},{encodedPassword}, {passwordEncoding} from {user} where {passwordEncoding} != 'md5' or {passwordEncoding} != 'sha256' or {passwordEncoding} != 'sha512' or {passwordEncoding} != 'pbkdf2'

How Do You Install the Hybris Commerce Suite License?

This is a quick tutorial that describes how to install the Hybris Commerce Suite License. This article also assumes you have the SAP Hybris license information in your possession. Open the command prompt Go to your Hybris config directory: cd <HYBRIS_HOME_DIR>/config Create a new file in this directory. The filename you choose doesn't matter. For example, you could create a file called SAPHybrisLicense.txt vi SAPHybrisLicense.txt Once the vi editor is displayed, copy and paste the Hybris license you received from the SAP License Management portal. The license will resemble the following: ----- Begin SAP License ----- SAPSYSTEM=PRD HARDWARE-KEY=XXXXXXXX INSTNO=XXXXXXX BEGIN=XXXXXXX …

How Do You Allocate Additional Storage to a Red Hat Enterprise Linux Server (RHEL) Volume Group?

I recently ran out of storage space on my development server that has both Hybris and Adobe Experience Manager (AEM) installed. A quick df -h command confirmed my suspicion: Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_system-opt 7.0G 7.0G 20K 100% /opt After installing a new disk. the operating system identified this new disk as /dev/sdb.  Since this is a brand new disk, no partitions exist. The following are the steps required to add additional space to a Red Hat Enterprise Linux Server Volume Group. 1. Convert this new disk into a physical volume: # pvcreate /dev/sdb Physical volume "/dev/sdb" successfully created 2. …