Add a custom product page in spartacus

79 Views Asked by At

I need to create a new custom PDP page on my Hybris Storefront and URL should be

{siteurl}/asset/{assetCode}

I have created a custom product detail page in hybris using the impexes

INSERT_UPDATE ProductPage; uid[unique=true]; name          ; masterTemplate(uid, $contentCV); defaultPage; approvalStatus(code)[default='approved']; $contentCV[unique=true]
                         ; assetDetails    ; Asset Details ; AssetDetailsPageTemplate       ; false      ;

I am not expert in Spartacus. How do I map this custom PDP in the Spartacus side. Can we do it?

1

There are 1 best solutions below

1
mkysoft On

Hybris has product based page functionality. You don't need a custom endpoint for this. Spartacus makes backend call with product code to find a page. You can add restriction to your page based on your product. Check the network activity for below endpoint.

/cms/pages?pageType=ProductPage&code=YOUR_PRODUCT

You can also add custom endpoint but it requires a lot of effort.