Sample use cases for customizing the Products details panel
This topic provides some use cases for the customization of the Product details panel.
Reordering of the accordion items
You can reorder the accordion items in the Product details panel. For
example, you can show Product variant as the last accordion item
Product details panel displayed in the Customer service
view by using the following steps:
- Create the following folder structure under store-extensions-src, if not
already present:
store-extensions-src/app/app-common/product-details-modal
- Copy the customer-view-details.config.ts file from
/store-frontend/src/app/app-common/product-details-modal
to store-frontend/store-extensions-src/app/app-common/product-details-modal/. - Update the
accordionItems
array based on your requirement. In this example, move the first item,productVariants
and add it as the last item in this array.
Removing an accordion item
You can remove an accordion item from the Product details panel. For
example, you can remove the Product variants accordion item from the
Product details panel in the Order fulfillment view by
using the following steps:
- Copy fulfillment-view-details.config.ts file from
WORKSPACE/store-frontend/src/app/app-common/product-details-modal
to WORKSPACE/store-frontend/store-extensions-src/app/app-common/product-details-modal. - Remove the
productVariants
item from theaccordionItems
array:{ id: 'productVariants', tid: 'ProductVariantsComponent', component: ProductVariantsComponent, displayBundleKey: 'addProductToCart.LABEL_ProductVariants' }
Adding a new accordion item
You can add a new accordion item to the Product details panel. For example,
you can add Product additional details as a new accordion item to the
Product details panel in the Order fulfillment view by
using the following steps:
- Copy fulfillment-view-details.config.ts file from
WORKSPACE/store-frontend/src/app/app-common/product-details-modal
to WORKSPACE/store-frontend/store-extensions-src/app/app-common/product-details-modal. - Add the following object for the new
ProductAdditionalDetailComponent
component to theaccordionItems
array:{ id: 'ProductAdditionalDetail', tid: 'ProductAdditionalDetailComponent', component: ProductAdditionalDetailComponent, displayBundleKey: 'addProductToCart.LABEL_ProductAdditionalDetail' }
- Add the new component in the declarations and
entryComponents
of theapp-common-extension.module.ts
file.
Updating the primary product information
You can customize the primary product information that is displayed in the Product
details panel. For example, you can customize the Product details
panel in the Order fulfillment view so that the SKU information is not
displayed for any of the products by using the following steps:
- Create the following folder structure under store-extensions-src, if not
already
present:
store-extensions-src/app/app-common/product-details-modal
- Copy the
fulfillment-view-primary-detail
component from /store-frontend/src/app/app-common/product-details-modal to /store-frontend/store-extensions-src/app/app-common/product-details-modal. - Update the newly copied component to remove the SKU element from the HTML.