Jump to content

Choosing what configurable options are upgradeable


Ragonz

Recommended Posts

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

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

2 minutes ago, Ragonz said:

any idea of what that would look like?

I was hoping you weren't going to ask. :P

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

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.

6KbMTVd.png

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...

v1cb4kr.png

configproductoptions.php?manageoptions=true&cid=1

and that value of cid will be the one you're looking for. :idea:

Link to comment
Share on other sites

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 by Ragonz
Link to comment
Share on other sites

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

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated