- Mark as New
- Bookmark
- Subscribe
- Permalink
- Email to a Friend
- Report Inappropriate Content
Problem:
Customer needed help in using Filter Plugin code to display Products and Rate Plan based on a custom field value.
Customer had a custom field 'Retired__c' both on Product and Product rate Plan object , based on what they would like to filter out displaying products and Rate Plans.
If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Email to a Friend
- Report Inappropriate Content
Solution:
1) First, create a custom Apex class by overriding the IFilterPlugin used in the SelectProduct component.
Following is the Filter Plugin code that they needed to implement
global class zCustomProductFilterPlugin implements zqu.SelectProductComponentOptions.IFilterPlugin { String quoteId; public zCustomProductFilterPlugin() { quoteId = ApexPages.currentPage().getParameters().get('id'); } public String getProductSoqlFragment() { return ' Retired__c != \'Yes\''; } public String getRatePlanSoqlFragment() { return ' Retired__c != \'Yes\''; } }
2) Then Register this class zCustomProductFilterPlugin in the Component Registraion Section
If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Email to a Friend
- Report Inappropriate Content
Solution:
1) First, create a custom Apex class by overriding the IFilterPlugin used in the SelectProduct component.
Following is the Filter Plugin code that they needed to implement
global class zCustomProductFilterPlugin implements zqu.SelectProductComponentOptions.IFilterPlugin { String quoteId; public zCustomProductFilterPlugin() { quoteId = ApexPages.currentPage().getParameters().get('id'); } public String getProductSoqlFragment() { return ' Retired__c != \'Yes\''; } public String getRatePlanSoqlFragment() { return ' Retired__c != \'Yes\''; } }
2) Then Register this class zCustomProductFilterPlugin in the Component Registraion Section
If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Email to a Friend
- Report Inappropriate Content
Re: Using Filter Plugin to filter out products and Rate Plan
Hey Doyeli,
Thanks for posting the solution. Can I just confirm that the IFilterPlugin does not apply if we are using CPQ? I have been trying to get this to work in our sandbox org, but without any success ...
According to this: https://knowledgecenter.zuora.com/CA_Commerce/I_Development_Resources/C_Component_Library/B_Global_C...
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Email to a Friend
- Report Inappropriate Content
Re: Using Filter Plugin to filter out products and Rate Plan
Hi @sonnylebgch,
If you are using Lightning Guided Product Selector, you need to use IHierarchyAllowedRecordPlugin.
Please review this article for sample code
Thank you
Doyeli
If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √