Radiogroup Change Default

I am still using cs-cart 2.1.1. Years ago i set up a user profile field asking if they would like our newsletter with a simple radiogroup. with a yes or no radio. It automaticly defaulted to yes. At that time I thought this would be fine. Years later I have found that this is not the best practice of adding to our newsletter. I would like the default to be no, so they will have to opt in. How should I do this, and keep the answers in same order. I believe I have found the correct file to edit, just not sure of code changes.

File: /skins/new_vision_blue/customer/views/profiles/components/profile_fields.tpl

Code to change, I think:

{elseif $field.field_type == "R"} {* Radiogroup *}
{foreach from=$field.values key=k item=v name="rfe"}
{$v}
{/foreach}

Thanks for your help,

David DeWitt

Try to replace

{foreach from=$field.values key=k item=v name="rfe"}

with

{foreach from=$field.values|array_reverse key=k item=v name="rfe"}

and clear cache

Well that switched the position of the answers in user profile fields, So the first was "No" . But when I viewed user form admin side it was displayed the original way and the answer showed "Yes". So I'm guess I would have to change code in several places.

I decided to try just changing the position number in the user profile creation area. Hoping to that it would not change what it save in the DB.

Yeah, it did just what I wanted. So in the end it was much easier than I thought.

Thanks,

david DeWitt

Look for a hidden field above the radio inputs that will contain a value=“Y” attribute. Or drop me an email and I’ll take a look for you.

Well that switched the position of the answers in user profile fields, So the first was "No" . But when I viewed user form admin side it was displayed the original way and the answer showed "Yes". So I'm guess I would have to change code in several places.

I decided to try just changing the position number in the user profile creation area. Hoping to that it would not change what it save in the DB.

Yeah, it did just what I wanted. So in the end it was much easier than I thought.

Do you mean that the default value was not saved? What if you check profile details in the store-front?