Jump to content

Change value in upgrade options shown to clients


Ragonz

Recommended Posts

Looking to change the text shown to clients in a certain configurable option

In

there are instructions to remove the ability to change a particular configurable option, you can click the dropdown box but all it displays is "no change"

What I would like to do is change this drop down option to say "Contact Support" or somthing similar

I've located where to add the required language (Lang > English) but changing {$LANG.upgradenochange} to {$LANG.upgradesupport} (what my lang value is called) changes all the boxes which display no change, how would you go about changing just a single config option?

Link to comment
Share on other sites

7 minutes ago, Ragonz said:

've located where to add the required language (Lang > English) but changing {$LANG.upgradenochange} to {$LANG.upgradesupport} (what my lang value is called) changes all the boxes which display no change, how would you go about changing just a single config option?

I suspect it would have to be an {if} statement in the upgrade.tpl template (as that is where the string is used, not in an array)... untested, but I think something along the lines of..

{if $option.selected}<option value="{$option.id}" selected>{$LANG.upgradenochange}</option>{else}<option value="{$option.id}">{$option.nameonly} {$option.price}{/if}</option>

becomes...

{if $option.selected}<option value="{$option.id}" selected>{if $option.id eq 'x'}{$LANG.upgradesupport}{else}{$LANG.upgradenochange}{/if}</option>{else}<option value="{$option.id}">{$option.nameonly} {$option.price}{/if}</option>

where 'x' is the ID value of the configurable option.

Link to comment
Share on other sites

So combining the above and the previous line (so that you cannot choose any options for certain config options I get

 

{if $option.selected}<option value="{$option.id}" selected>{if $option.id eq '151' and $option.id eq '204' and $option.id eq '224'}{$LANG.upgradecontactsupport}{else}{$LANG.upgradenochange}{/if}</option>{elseif $configoption.id neq '151' and $configoption.id neq '204' and $configoption.id neq '224'}<option value="{$option.id}">{$option.nameonly} {$option.price}{/if}</option>

I'm not sure I've dont it correct as I still get "no change" rather than the desired text

Link to comment
Share on other sites

15 hours ago, Ragonz said:

I'm not sure I've dont it correct as I still get "no change" rather than the desired text

I suspect that...

{if $option.id eq '151' and $option.id eq '204' and $option.id eq '224'}

should really be...

{if $option.id eq '151' or $option.id eq '204' or $option.id eq '224'}

the point being that you are using this code whilst inside a loop, so one of those conditions can be true, but never all three at the same time... e.g the current option is either 151, 204 or 224 - it can't be all three at the same time (which is what your code is currently checking for).

Link to comment
Share on other sites

Tried or as well no change

if $option.selected}<option value="{$option.id}" selected>{if $option.id eq '151' or $option.id eq '204' or $option.id eq '224'}{$LANG.upgradecontactsupport}{else}{$LANG.upgradenochange}{/if}</option>{elseif $configoption.id neq '151' and $configoption.id neq '204' and $configoption.id neq '224'}<option value="{$option.id}">{$option.nameonly} {$option.price}{/if}</option>

Edited by Ragonz
Link to comment
Share on other sites

then I suspect you're using the wrong value(s) for $option.id - let's use the "Server Branding" option below...

KpLK4oy.png

<td>
	<select name="configoption[36]">
		<option value="67" selected>No Change</option></option>
	</select>
</td>

so from that above code (viewed from the browser), the value that you want is not "36" from the configoption, it's "67" - with that value, if I then modify the template...

{if $option.selected}<option value="{$option.id}" selected>{if $option.id eq '67'}Brian{else}{$LANG.upgradenochange}{/if}</option>{else}<option value="{$option.id}">{$option.nameonly} {$option.price}{/if}</option>

ignore that i'm hardcoding the output and I haven't included your outer IF statement, I get the following...

6mSURQS.png

so I suspect you're going to have to work your way through viewing the source of the page in the browser and finding what the three values are for these specific "No Change" options and use *those* values in your inner IF statement.

Link to comment
Share on other sites

hmm, the 151, 204 and 224 values are the ones used in the later part of the line to hide everything in the location field and only display "No Change" its that field that I want to change the "No Change" text for so surely the id's would be the same?

Link to comment
Share on other sites

3 minutes ago, Ragonz said:

hmm, the 151, 204 and 224 values are the ones used in the later part of the line to hide everything in the location field and only display "No Change" its that field that I want to change the "No Change" text for so surely the id's would be the same?

the 151, 204 & 224 could well be correct for the outer if statement, but they are the configurable option values (.eg Quantity (GB), Server Branding etc)... however, each option within a configurable option select dropdown has it's own value and it's that value that you need to use in this inner if statement.

Link to comment
Share on other sites

51 minutes ago, Ragonz said:

So I've found the ID's I need but it seems to have ID's different for every single product...

oh hold on - if you have a config select option with lets say 5 choices... service #1 currently uses option #3, service #2 uses option #4 - they're both going to be different option ID values... you'd be forever chasing your own tail trying to do it this way.

the following might work as the upgrade page will default to "no changing" the existing selected option, so i think you would only have to change that select text for those 3 configurable options... try it and see what happens - if it doesn't work, post the entire if statement (as I know you have an outer statement that i'm ignoring for now)....

{if $option.selected}<option value="{$option.id}" selected>{if in_array($configoption.id,array(151,204,224))}{$LANG.upgradecontactsupport}{else}{$LANG.upgradenochange}{/if}</option>{else}<option value="{$option.id}">{$option.nameonly} {$option.price}{/if}</option>
Link to comment
Share on other sites

That did the trick

{if $option.selected}<option value="{$option.id}" selected>{if in_array($configoption.id,array(151,204,224))}{$LANG.upgradecontactsupport}{else}{$LANG.upgradenochange}{/if}</option>{elseif $configoption.id neq '151' and $configoption.id neq '204' and $configoption.id neq '206' and $configoption.id neq '224'}<option value="{$option.id}">{$option.nameonly} {$option.price}{/if}</option>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 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