Skip to Content
0
Jul 10, 2020 at 12:39 PM

Banner component is not visible in PDP page after Providing Category Restriction on Component.

112 Views Last edit Jul 12, 2020 at 11:20 AM 3 rev

Hi Everyone,

Problem -- Trying to show Banner on PLP and PDP page according to the category selected.Used Category restriction to control the banner component as per category selected. But After providing restriction , On PLP page i am able to see the banner Component as Per the category selected . But on PDP page the banner component disappears even after the product selected is from the same Category to which restriction Applied on Component.

I have to use the same banner component for both PDP and PLP page.

I have given the lines of code being used by me to create component and restrictions:

INSERT_UPDATE BannerComponent;$contentCV[unique=true];uid[unique=true];name;ComponentRef;urlLink;content;headline;$picture 
;;Category1BannerComponent;Category1 Component;Category1BannerComponent;"/pcs";"Content1";"Find the right";pic1.jpg 
;;Category2BannerComponent;Category2 Component;Category2BannerComponent;"/pcs";"Content2";"Find the right";pic2.jpg 
;;Category3BannerComponent;Category3 Component;Category3BannerComponent;"/pcs";"Content3";"Find the right";pic3.jpg

INSERT_UPDATE ComponentSelectorBannerComponent;$contentCV[unique=true];uid[unique=true];name;banners(componentRef);componentRef 
;;CustomBannerComponent;Custom BannerComponent;Category1BannerComponent,Category2BannerComponent,Category3BannerComponent;CustomBannerComponent 


INSERT_UPDATE CMSCategoryRestriction; uid[unique = true] ; $contentCV[unique = true]; categories(code, $productCV) ; components(uid, $contentCV) ; ComponentRef 				    
; Category1CommponentRestriction ;; 101001000000 ; Category1BannerComponent ; Category1CommponentRestriction 
; Category2CommponentRestriction ;; 101002000000 ; Category2BannerComponent ; Category2CommponentRestriction  						   
; Category3ComponentRestriction  ;; 101007190900,40141600; Category3BannerComponent ; Category3ComponentRestriction

Any help would be appreciated.

Thanks