Ragonz Posted November 2, 2017 Share Posted November 2, 2017 As per title is this possible? We have several config options we want customers to be able to upgrade but there is one we dont want to them to be able to Link to comment Share on other sites More sharing options...
brian! Posted November 2, 2017 Share Posted November 2, 2017 50 minutes ago, Ragonz said: As per title is this possible? We have several config options we want customers to be able to upgrade but there is one we don't want to them to be able to interesting question - out of the box, the answer is almost certainly no as currently all configurable options are upgradeable. I suppose the work around could be to modify upgrade.tpl and put an {if} statement in the config option foreach loop to not show (or make it readonly if that's applicable to the option type) this specific option... give that a try and see if it works. Link to comment Share on other sites More sharing options...
Ragonz Posted November 2, 2017 Author Share Posted November 2, 2017 any idea of what that would look like? to give a bit more background we have lots of products and all those products share a set of config options and 1 config option specific to that product, in the shared set of config options there is a location value, this is the one we dont want people to be able to change (read only would be fine) Link to comment Share on other sites More sharing options...
brian! Posted November 2, 2017 Share Posted November 2, 2017 2 minutes ago, Ragonz said: any idea of what that would look like? I was hoping you weren't going to ask. 3 minutes ago, Ragonz said: there is a location value, this is the one we don't want people to be able to change (read only would be fine) what type of config option is it - a dropdown or radio button ? Link to comment Share on other sites More sharing options...
Ragonz Posted November 2, 2017 Author Share Posted November 2, 2017 (edited) 2 are quantities 4 are dropdown's (the one we dont want people to be able to change is one of these) 1 is a yes/no Edited November 2, 2017 by Ragonz Link to comment Share on other sites More sharing options...
brian! Posted November 2, 2017 Share Posted November 2, 2017 50 minutes ago, Ragonz said: the one we don't want people to be able to change is one of these how about trying this, in upgrade.tpl change... {if $option.selected}<option value="{$option.id}" selected>{$LANG.upgradenochange}</option>{else}<option value="{$option.id}">{$option.nameonly} {$option.price}{/if}</option> to... {if $option.selected}<option value="{$option.id}" selected>{$LANG.upgradenochange}</option>{elseif $configoption.id neq '1'}<option value="{$option.id}">{$option.nameonly} {$option.price}{/if}</option> so let's say your config option that contains the various locations has an ID value of 1, the above code will remove any other options from the dropdown and only leave "No Change" - that should prevent the user from changing this config option value - all other dropdown config options should be unaffected. to get the ID value, you could either examine the db table, or from the admin area, run the mouse over the edit button and view the link URL in the browser... or click the button and examine the URL in the popup window... configproductoptions.php?manageoptions=true&cid=1 and that value of cid will be the one you're looking for. Link to comment Share on other sites More sharing options...
Ragonz Posted November 2, 2017 Author Share Posted November 2, 2017 (edited) replaced that line in the template (using the correct id which was 112) WHMCS is showing as being used within general settings > general > template (pretty sure I was in the right template anyway but doesnt hurt to doublecheck) and it still allows users to change the config option unfortunatly. Edited November 2, 2017 by Ragonz Link to comment Share on other sites More sharing options...
brian! Posted November 2, 2017 Share Posted November 2, 2017 can you PM me a link to a product using this "Locations" configurable option.... or perhaps try a value of 151 Link to comment Share on other sites More sharing options...
Ragonz Posted November 2, 2017 Author Share Posted November 2, 2017 nevermind it was 151 despite the link in the admin area saying it was 112 https://www.dropbox.com/s/5ragl6j6xnnu533/Screenshot 2017-11-02 18.36.56.png?dl=0 how would we go about expanding this to allow for multiple values (151,224,206) Link to comment Share on other sites More sharing options...
brian! Posted November 2, 2017 Share Posted November 2, 2017 2 minutes ago, Ragonz said: nevermind it was 151 that wasn't a random guess - I found it by looking at your cart. 3 minutes ago, Ragonz said: how would we go about expanding this to allow for multiple values (151,224,206) if it's only 3... {elseif $configoption.id neq '151' and $configoption.id neq '204' and $configoption.id neq '224'} Link to comment Share on other sites More sharing options...
Ragonz Posted November 2, 2017 Author Share Posted November 2, 2017 excellent, will have to buy you a beer or somthing lol Link to comment Share on other sites More sharing options...
brian! Posted November 2, 2017 Share Posted November 2, 2017 3 minutes ago, Ragonz said: excellent, will have to buy you a beer or somthing lol Link to comment Share on other sites More sharing options...
WHMCS Developer WHMCS Andrew Posted November 3, 2017 WHMCS Developer Share Posted November 3, 2017 16 hours ago, brian! said: {elseif $configoption.id neq '151' and $configoption.id neq '204' and $configoption.id neq '224'} Also {elseif !in_array($configoption.id, array(151, 204, 224)} Just to show a different way of doing the same thing Link to comment Share on other sites More sharing options...
brian! Posted November 3, 2017 Share Posted November 3, 2017 5 minutes ago, WHMCS Andrew said: Just to show a different way of doing the same thing yeah that's what I had in mind if he'd said more than 3. Link to comment Share on other sites More sharing options...
Recommended Posts