Skip to Content
0
Mar 22, 2015 at 06:18 PM

How hide all Products and Product Variants of specific category using restriction.

293 Views

HiExperts,

Requirement: I Want to hide all Products and Product Variants of specific category for specific User Group from PCM/HMC.

**Action Performed : I created a following restriction and able to hide all Products of category which pk value is (8796093186190),

         NOT EXISTS ({{

SELECT {rel.target FROM {CategoryProductRelation as rel} WHERE {item.PK} ={rel.target} AND {rel.source} ='8796093186190' }})

To hide Product Variants I written another restriction but its working only for single Product and that's Variant.

         NOT EXISTS ({{

select * from {VariantProduct} where p_baseproduct =({{ SELECT targetPK FROM {CategoryProductRelation} WHERE sourcePK ='8796093186190' }})

}})

Issue : I have three levels of product Variants after my base product, and currently I am able to hide my base products only, what correction I have to make in query to hide All products and different level of Product Variants? what is best way to handle this issue ?