brian! Posted August 31, 2019 Share Posted August 31, 2019 (edited) Following a question from @Mauwiks... Quote how do we link an available add-on product to any of our customers? natively in WHMCS, there is no way to do this - but with the help of the attached hook, it is possible - just upload the hook to /includes/hooks the hook currently includes EIGHT different parameter options - I can think of at least 4 more options that I could add, and may do so at a later date, but I think 8 is plenty to be going on with. 🙂 note: the addon's ID value can be found when in the URL when you edit that product addon in the admin area - configaddons.php?action=manage&id=1 Linking to one specific product addon cart.php?gid=addons&id=1 Linking to Market Connect product addons by brand cart.php?gid=addons&id=codeguard cart.php?gid=addons&id=sitelock cart.php?gid=addons&id=spamexperts cart.php?gid=addons&id=ssl cart.php?gid=addons&id=weebly these addons are found by the hook searching whether specific terms are found at the START of the product addon descriptions, e.g Codeguard etc Linking to multiple product addons cart.php?gid=addons&multi[]=1&multi[]=32&multi[]=54 Linking to a predefined group of product addons cart.php?gid=addons&id=group1 $group1 is a predefined array of product addon IDs that you can edit in the hook.. $group1 = array(12,28,20); you could, in theory, have multiple groups (arrays of addon IDs) predefined in the hook, but it's currently only coded for 1 group - but it would be simple enough to change. if you pass a numeric addon ID value that doesn't exist for the particular client, then you'll get the no addons available error message... ... I did toy with the idea of showing all addons under those circumstances, but I decided against it for now - not least because it keeps the coding simplified! 😉 if you pass an undefined non-numeric id, e.g cart.php?gid=addons&id=brian, then there is nothing for the hook to remove and it will show all addons as per normal. you can only use one parameter option in a URL - e.g., you can't use cart.php?gid=addons&id=43&multi[]=32 addons_mauwiks.php Edited August 31, 2019 by brian! 4 Quote Link to comment Share on other sites More sharing options...
mauwiks Posted August 31, 2019 Share Posted August 31, 2019 This is very much awesome @brian! And I can't thank you enough for the effort of doing this. Thank you, thank you and more thanks. More power and everthing else. You're the best. I hope I can offer something as a token of appreciation. I will take note of this at the time being and will surely give back one day 1 Quote Link to comment Share on other sites More sharing options...
web2008 Posted April 23, 2020 Share Posted April 23, 2020 This was a very good idea, but does it work on version 7.10.x? Have tried, but all addons are displayed anyway. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 24, 2020 Author Share Posted April 24, 2020 12 hours ago, web2008 said: This was a very good idea it still is! ☺️ 12 hours ago, web2008 said: but does it work on version 7.10.x? yes. 😎 newer MarketConnect brands might need to be added to the hook code at some point, but it definitely still works in v.7.10.1 13 hours ago, web2008 said: Have tried, but all addons are displayed anyway. as you're using a custom orderform, is there an addons.tpl template in the v1 folder ? if all addons are showing, i'm wondering if the if statement that checks the template name isn't being triggered for some reason - difficult for me to know as these are effectively client only pages, so I can't directly access them to test. almost certainly, this solution should work with any template as it's basically only manipulating the $addons array. btw - I still can't reproduce the network issues hook issue locally. 0 Quote Link to comment Share on other sites More sharing options...
Kelby Posted May 6, 2020 Share Posted May 6, 2020 Hello, How to replace Addons & Extras Purchase & Activate by Upgrade/Downgrade Options? Thank you 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 7, 2020 Author Share Posted May 7, 2020 21 hours ago, Kelby said: How to replace Addons & Extras Purchase & Activate by Upgrade/Downgrade Options? with difficulty.... I assume this is related to this thread ? 0 Quote Link to comment Share on other sites More sharing options...
HostMaria Posted June 19, 2020 Share Posted June 19, 2020 (edited) Hi Brian, thank you. Uploaded your php to includes/hooks thank you. Did try various approaches .. couldn't get working :) -- my main category is: cart.php?gid=1 product shopping cart link: cart.php?a=add&pid=1 what would be the exact url to display only product id=1 on the page? --- and what would be the exact url to show items of 2 categories on one page? cat 1: cart.php?gid=3 cat 2: cart.php?gid=5 Huge thank you, Helmuts Edited June 19, 2020 by HostMaria 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 20, 2020 Author Share Posted June 20, 2020 On 19/06/2020 at 14:06, HostMaria said: Uploaded your php to includes/hooks for anyone else, this is in relation to the thread below... and i'll answer the question in the above thread as it's not really relevant to the purpose of the hook in this thread. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.