4.0 Breaking Changes
This document presents a chronological list of changes that break existing functionality, APIs, or contracts with third party Liferay Commerce developers or users in Commerce 4.0. We try our best to minimize these disruptions, but sometimes they are unavoidable.
Here are some of the types of changes documented in this file:
-
Functionality that is removed or replaced
-
API incompatibilities: Changes to public Java or JavaScript APIs
-
Changes to context variables available to templates
-
Changes in CSS classes available to Liferay themes and portlets
-
Configuration changes: Changes in configuration files, like
com.liferay.commerce.*.cfgetc. -
Execution requirements: Java version, JEE Version, browser versions, etc.
-
Deprecations or end of support: For example, warning that a certain feature or API will be dropped in an upcoming version.
-
Recommendations: For example, recommending using a newly introduced API that replaces an old API, in spite of the old API being kept in Liferay Portal for backwards compatibility.
Destination Names Changed
-
Date: 2020-Sep-10
-
JIRA Ticket: COMMERCE-4762
What changed?
The prefix commerce_ has been added to the Commerce destinations defined in com.liferay.commerce.constants.CommerceDestinationNames:
-
liferay/commerce_order_status; -
liferay/commerce_payment_status; -
liferay/commerce_order_status; -
liferay/commerce_payment_status; -
liferay/commerce_subscription_status.
Who is affected?
Anyone who references or uses these destinations.
How should I update my code?
Update any explicit reference to Commerce destinations with the new names.
Why was this change made?
This change introduces Liferay’s naming pattern for the Commerce destinations.
Destination Names Changed
-
Date: 2021-Feb-22
-
JIRA Ticket: COMMERCE-4762
What changed?
Rearrangement of methods that reference the externalReferenceCode.
Classes with updated methods:
-
com.liferay.commerce.inventory.service.CommerceInventoryWarehouseLocalService -
com.liferay.commerce.inventory.service.CommerceInventoryWarehouseService -
com.liferay.commerce.price.list.service.CommercePriceEntryLocalService -
com.liferay.commerce.price.list.service.CommercePriceEntryService -
com.liferay.commerce.price.list.service.CommercePriceListLocalService -
com.liferay.commerce.price.list.service.CommercePriceListService -
com.liferay.commerce.price.list.service.CommerceTierPriceEntryLocalService -
com.liferay.commerce.price.list.service.CommerceTierPriceEntryService -
com.liferay.commerce.pricing.service.CommercePriceModifierLocalService -
com.liferay.commerce.pricing.service.CommercePriceModifierService -
com.liferay.commerce.pricing.service.CommercePricingClassLocalService -
com.liferay.commerce.pricing.service.CommercePricingClassService -
com.liferay.commerce.product.service.CommerceCatalogLocalService -
com.liferay.commerce.product.service.CommerceCatalogService -
com.liferay.commerce.product.service.CommerceChannelLocalService -
com.liferay.commerce.product.service.CommerceChannelService -
com.liferay.commerce.product.service.CPAttachmentFileEntryLocalService -
com.liferay.commerce.product.service.CPAttachmentFileEntryService -
com.liferay.commerce.product.service.CPDefinitionLocalService -
com.liferay.commerce.product.service.CPDefinitionService -
com.liferay.commerce.product.service.CPInstanceLocalService -
com.liferay.commerce.product.service.CPInstanceService -
com.liferay.commerce.product.service.CPOptionLocalService -
com.liferay.commerce.product.service.CPOptionService -
com.liferay.commerce.product.service.CPOptionValueLocalService -
com.liferay.commerce.product.service.CPOptionValueService -
com.liferay.commerce.product.service.CProductLocalService -
com.liferay.commerce.product.service.CProductService -
com.liferay.commerce.service.CommerceAddressLocalService -
com.liferay.commerce.service.CommerceAddressService -
com.liferay.commerce.service.CommerceOrderItemLocalService -
com.liferay.commerce.service.CommerceOrderItemService -
com.liferay.commerce.service.CommerceOrderLocalService -
com.liferay.commerce.service.CommerceOrderNoteLocalService -
com.liferay.commerce.service.CommerceOrderNoteService -
com.liferay.commerce.service.CommerceOrderService
Who is affected?
Anyone who references or uses methods from these classes.
How should I update my code?
Update methods to use the new corresponding method.
Why was this change made?
This change was introduced to follow Liferay source formatting.
MiniCart Component Extensibility
-
Date: 2021-Feb-12
-
JIRA Ticket: COMMERCE-4974
What changed?
-
The
MiniCartTag and FE React Component have been extended to support partial and total replacement of its component views and labels and have some of its features configurable, either via standard Tag attribute, or via direct import of the JS implementation.-
The exposed
MiniCartTagattributes changed. -
The
commerce-frontend-jsmodule is now exposed with a proper interface to allow a controlled access and exposure of its content (and in particular, of theMiniCartContextwhich is needed forMiniCartintegration). -
Usability and extensibility of the MiniCart component is documented here.
-
Who is affected?
Developers relying or extending the old MiniCartTag.
Why was this change made?
Alignment with Liferay DXP standards to support component extensibility.
CommerceCountry and CommerceRegion Removed
-
Date: 2021-Mar-02
-
JIRA Ticket: LPS-125991
What changed?
-
The
CommerceCountryandCommerceRegiontables have been removed from the database. -
Service and persistence classes for
CommerceCountryandCommerceRegionhave been removed. -
References to
com.liferay.commerce.model.CommerceCountryandcom.liferay.commerce.model.CommerceRegionhave been replaced bycom.liferay.portal.kernel.model.Countryandcom.liferay.portal.kernel.model.Region. -
Foreign keys that references
CommerceCountryandCommerceRegionhave been renamed fromcommerceCountryIdandcommerceRegionIdtocountryIdandregionIdrespectively. Tables that have columns that were updated are-
CommerceAddress -
CommerceAddressRestriction -
CommerceShippingFixedOptionRel -
CommerceTaxFixedRateAddressRel -
com.liferay.commerce.country.CommerceCountryManageris added for retrieving Commerce-specific countries. Available methods are: -
getBillingCountries -
getBillingCountriesByChannelId -
getShippingCountries -
getShippingCountriesByChannelId -
getWarehouseCountries
-
Who is affected?
Anyone who references or uses these models and services.
How should I update my code?
Update any explicit reference to CommerceCountry and/or CommerceRegion with the new corresponding models and services.
Why was this change made?
This change removes duplicate models and services in Liferay Portal.
Mini Compare Widget + Mini Compare Component
-
Date: 2021-Mar-26
-
JIRA Ticket: COMMERCE-2909
What changed?
-
Migration of the
MiniCompareFE implementation from JSP/vanilla JavaScript to React (incommerce-frontend-js). It’s loaded directly from the same JSP source incommerce-product-content-web. -
CP Definition ID’s are now stored in and eventually read from a cookie, instead of using the session.
-
Refactored the
CompareCheckboxTagto render via JSP. The JSP in turn renders theCompareCheckboxReact component.- Deprecated and removed the old Soy/MetalJS implementation of the
CompareCheckboxin thecommerce-frontend-taglibmodule.
- Deprecated and removed the old Soy/MetalJS implementation of the
Who is affected?
Developers relying or extending the old implementation of the MiniCompare component/widget.
Why was this change made?
-
Due to Soy/MetalJS deprecation
-
To align with Liferay DXP to support Liferay Classic Theme in Commerce, paving way for future DXP WEM integration.
-# Revamped Account Selector
-
Date: 2021-Apr-27
-
JIRA Ticket: COMMERCE-5888
What changed?
-
Refactored the
AccountSelectorTagto render via JSP and extend it from theIncludeTag. The JSP hydrates and renders theAccountSelectorReact component migrated from Soy/MetalJS. -
Renamed the event names to notify other components about Account/Order changes communicated during the runtime life cycle via the Commerce Headless API.
Who is affected?
Developers who rely or extend the old Soy/MetalJS component with its related Tag.
Why was this change made?
-
Due to Soy/MetalJS deprecation
-
To align with Liferay DXP to support Liferay Classic Theme in Commerce, paving way for future DXP WEM integration.
Product Card and Product Rendering Strategies in Storefront
-
Date: 2021-Apr-27
-
JIRA Ticket: COMMERCE-5889
What changed?
-
The Product Card component is now ported to a JSP template to display product information. It hydrates and renders via
CPContentListRenderer→CPContentListEntryRenderer.-
The Product Publisher, Search Results, Compare widgets now use these rendering strategies.
-
Commerce Theme Minium Site Initializer is now configured to use these rendering strategies.
-
The implementation now resides in the
commerce-product-content-webmodule and is extensible throughCPContentRendereroverride, JSP override, or Liferay Dynamic Include. -
Deprecated and removed The old Soy/MetalJS implementation of the Product Card in the
commerce-frontend-taglibmodule has been deprecated and removed. -
The old Minium-specific
CPContentRenderer’s in thecommerce-theme-minium-implmodule have been deprecated and removed.
-
-
Refactored the
AddToCartTagto render via JSP and now extends from theIncludeTag. The JSP in turn renders theAddToCartReact component, including theQuantitySelectorReact component.-
Deprecated and removed the old Soy/MetalJS implementation of the
AddToCartButtonin thecommerce-frontend-taglibmodule. -
Deprecated and removed the old Soy/MetalJS implementation of the
QuantitySelectorin thecommerce-frontend-taglibmodule. -
Deprecated and removed the old
QuantitySelectorTagin thecommerce-frontend-taglibmodule.
-
-
The
PriceTaghas been refactored to render via JSP and now extends from theIncludeTag. The JSP both renders the correctly structured template (for SEO purposes) and eventually renders thePriceReact component (for user page landing).- Deprecated and removed the old Soy/MetalJS implementation of the
Pricein thecommerce-frontend-taglibmodule.
- Deprecated and removed the old Soy/MetalJS implementation of the
Who is affected?
Developers relying on or extending:
-
the Minium-specific CP Content Renderers in
commerce-theme-minium-impl -
the Soy/MetalJS
AddToCartTagandAddToCartButton*. -
the Soy/MetalJS
QuantitySelectorTagandQuantitySelector*. -
the Soy/MetalJS
PriceTagandPrice*.
Why was this change made?
-
Due to Soy/MetalJS deprecation
-
To align with Liferay DXP to support Liferay Classic Theme in Commerce, paving way for future DXP WEM integration.
Standardize Method Names to Use AddOrUpdate vs. Upsert in *ServiceImpl Classes
-
Date: 2021-Jun-4
-
JIRA Ticket: COMMERCE-6095
What changed?
Any methods in Commerce *ServiceImpl classes with the name upsert* are now renamed to addOrUpdate*.
Who is affected?
Developers who are using any *ServiceImpl upsert* methods must use the corresponding methods addOrUpdate*.
Why was this change made?
This change introduces Liferay’s source formatting to the above methods.
BOM Feature Is Replaced by Shop by Diagram Feature
-
Date: 2021-Oct-14
-
JIRA Ticket: COMMERCE-3030
What changed?
Shop by Diagram replaces the BOM feature. This means that the entries Folder and BOM entry do not exist and there is a new Product Type called Diagram.
Who is affected?
Product specialists who must create diagrams for their store don’t need to create products with the Diagram product type.
Why was this change made?
This change fixes BOM issues and better fulfills spare parts use cases.
Remove the Accounts widget so it is no longer a module in Liferay Commerce
-
Date: 2021-Nov-21
-
JIRA Ticket: COMMERCE-7288
What changed?
The Account widget replaces the Commerce Account widget. All instances on an existing running system have been updated.
Who is affected?
-
Developers who have customized the Commerce Account widget and/or used it with site initializers.
-
End users (Account managers) that will use a different widget to manage accounts.
Why was this change made?
This change was necessary to conform with the migration of Commerce Account to Account.
Refactor CommerceOrderLocalServiceImpl
-
Date: 2022-Feb-16
-
JIRA Ticket: COMMERCE-8440
What changed?
-
There are now only three instances of the
updateCommerceOrdermethod, instead of four. -
Removed the
updateCustomFieldsmethod. -
Removed the
updateOrderStatusmethod. -
Removed the
updateTransactionIdmethod. -
Removed the
updateUsermethod.
Who is affected?
Developers who are calling any of these methods in their code.
How should I update my code?
-
Use the remaining 3
updateCommerceOrdermethods as a direct replacement. -
Use
updateCommerceOrder(CommerceOrder commerceOrder)method after settingexpandoBridgeAttributeswithcommerceOrder.setExpandoBridgeAttributes(ServiceContext serviceContext)to update thecustomFields. -
Use
updateCommerceOrder(CommerceOrder commerceOrder)method after setting theorderStatuswithcommerceOrder.setOrderStatus(int orderStatus)to update theorderStatus. -
Use
updateCommerceOrder(CommerceOrder commerceOrder)method after settingtransactionIdwithcommerceOrder.setTransactionId(String transactionId)to update thetransactionId. -
Use
updateCommerceOrder(CommerceOrder commerceOrder)method after setting theuserIdanduserNamewithcommerceOrder.setUserId(long userId)andcommerceOrder.setUserName(String userName)to update the user information.
Why was this change made?
This change was introduced to clean up the class CommerceOrderLocalServiceImpl.
Refine CommerceOrder in commerce-service service.xml
-
Date: 2022-Apr-13
-
JIRA Ticket: COMMERCE-8408
What changed?
-
Rearrangement of parameters for the
addCommerceOrdermethod inCommerceOrderLocalServiceandCommerceOrderService. -
Rearrangement of parameters for the
addOrUpdateCommerceOrdermethod inCommerceOrderLocalServiceandCommerceOrderService. -
Rearrangement of parameters for the
updateCommerceOrdermethod inCommerceOrderLocalServiceandCommerceOrderService. -
Rearrangement of parameters for the
updateCommerceOrderPricesmethod inCommerceOrderLocalServiceandCommerceOrderService.
Who is affected?
Developers who are calling any of these methods in their code.
How should I update my code?
-
Verify that parameters are correctly aligned with new
addCommerceOrdermethod(s). -
Verify that parameters are correctly aligned with new
addOrUpdateCommerceOrdermethod(s). -
Verify that parameters are correctly aligned with new
updateCommerceOrdermethod(s). -
Verify that parameters are correctly aligned with new
updateCommerceOrderPricesmethod(s).
Why was this change made?
This change cleans up the entity CommerceOrder in commerce-service service.xml.
Refactor CPContentHelper and CPContentHelperImpl
-
Date: 2021-Dec-16
-
JIRA Ticket: COMMERCE-7830
What changed?
- Change in signature of method in
CPContentHelper.javaandCPContentHelperImpl.java:getReplacementCommerceProductFriendlyURL(long cProductId, String cpIntanceUuid, ThemeDisplay themeDisplay)togetReplacementCommerceProductFriendlyURL(CPSku cpSku, ThemeDisplay themeDisplay)
- Renamed the
getCPAttachmentFileEntries()method inCPContentHelper.javaandCPContentHelperImpl.javatogetCPMedias()
Who is affected?
This affects any developers referencing or using these methods in their code.
How should I update my code?
Replace any references and usages of the above methods with the new ones.
Why was this change made?
The methods were refactored for better readability, consistency and maintainability.