Hi,
Joomla : v3.3.0
JomSocial:v3.2.0.5
Socialize:v1.2.7
We would like to set a default country in the Dating search module country field, as 99% of our customers are from the same one.
Could you help us on this ?
Cheers,
L
Hi,
please make override for the module:
from l/modules/mod_datingsearch/tmpl/default.php to /templates/[your template]/html/mod_datingsearch/default.php
edit the new file:
lines 147-149:
from
<?php foreach($field->value->country as $data) { ?>
<option value="<?php echo JText::_($data); ?>" <?php if($country==$data)echo 'selected'?>><?php echo JText::_($data); ?></option>
<?php } ?>
to
<?php foreach($field->value->country as $data) { ?>
<option value="<?php echo JText::_($data); ?>"
<?php
if($country==JText::_($data)) echo 'selected';
else if($data=='COM_COMMUNITY_LANG_NAME_ANGOLA') echo 'selected';
?>
>
<?php echo JText::_($data); ?>
</option>
<?php } ?>
Hi,
we've done the following changes:
<?php foreach($field->value->country as $data) { ?>
<option value="<?php echo JText::_($data); ?>"
<?php
if($country==JText::_($data)) echo 'selected';
else if($data=='COM_COMMUNITY_LANG_NAME_FRANCE') echo 'selected';?>
>
<?php echo JText::_($data); ?>
</option>
<?php } ?>
Unfortunately we still need to select the country. Can be seen on our site through user "aude" & pass same as the JSupport account.
Cheers,
L
Hi,
I made the changes for you.
line 152:
from
else if($data=='COM_COMMUNITY_LANG_NAME_FRANCE') echo 'selected';?>
to
else if($data=='France') echo 'selected';?>
It works. thank you for your support.
Cheers,
L
Hi,
since the upgrade to v3.2.0.6 it's broken, in spite of having the template override.
We have to select the country again.
We can't find out why.
Help welcome.
Cheers,
L
Hi,
Because that module have some changes at our newest version. Please check it again, I made the changes at override module file:
Line 152
from
else if($data=='France') echo 'selected';?>
to
else if($data=='COM_COMMUNITY_LANG_NAME_FRANCE') echo 'selected';?>
Fine.
Thank you
Cheers,
L
Hi,
sorry but since we've upgraded from v3.2.1.3 to v3.2.1.4 our issue is backed again.
We've seen that code has been changed in country.php so we've tried to apply your changes to the new code, but without success, list of the selected country is now empty.
See below the original part:
foreach($countriesSorted as $countryCode=>$countryName)
{
?>
<option value="<?php echo $countryCode;?>"<?php echo ($field->value == $countryCode) ? ' selected="selected"' : '';?>><?php echo $countryName;?></option>
<?php
}
?>
Then after applying our changes:
foreach($countriesSorted as $countryCode=>$countryName)
{
?>
<option value="<?php echo $countryName;?>"<?php echo ($field->value == $countryName) ? ' selected="selected"' : '';?>><?php echo (empty($field->value) && $countryName=='COM_COMMUNITY_LANG_NAME_FRANCE') ? ' selected="selected"' : '';?></option>
<?php
}
?>
Did we miss something ?
Again thank you for your help,
Cheers,
L
Hi There,
do you have developer for your site? because I just looking at override file that I made /public_html/templates/socialize/html/mod_datingsearch/default.php it changed. the country field has been disabled.
by using override, my changes will not disappear, because i'm using override.
i want make sure about this before I put pack my code.
Regards,
Albert
Hi,
you're right. It was changed because it was useless to display this field in the dating search module.
Is there a relation with the fact that now the countries list displayed, in the user's profile either at the front-end or at the back-end, is empty, just showing "choose your country". We've believed that this countries list was in relation with country.php. Are we wrong ? if so we apology for that.
We are a little bit confused between the country field in the dating search module and the countries list displayed at the user's profile(from the custom profile field), in relation with file country.php.
Our needs are to have by default country "France" set into the user's profile parameters, without displayed the country in the dating search module. Is it possible ?
Thank you for your support.
Cheers,
L
Hi,
about default country at profile page, you no need do anything. because my override code still there:
/public_html/templates/socialize/html/com_community/profile.edit.php
<script type="text/javascript">
joms.jQuery(document).ready( function(){
if(joms.jQuery('#field11').val() == "") joms.jQuery('select').val('COM_COMMUNITY_LANG_NAME_FRANCE');
});
</script><option value="<?php echo $countryCode;?>"<?php echo ($field->value == $countryCode) ? ' selected="selected"' : '';?>><?php echo (empty($field->value) && $countryCode=='COM_COMMUNITY_LANG_NAME_FRANCE') ? ' selected="selected"' : '';?></option><option value="<?php echo $countryCode;?>"<?php echo ($field->value == $countryCode) ? ' selected="selected"' : '';?>><?php echo $countryName;?></option>
Hi,
thank you for your lights and your time.
Cheers,
L