Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

Set default country in Dating search module

12 years 1 month ago
Licenses:
JomSocial Expired Socialize Expired

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

12 years 1 month ago
Licenses:

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 } ?>

please replace "COM_COMMUNITY_LANG_NAME_ANGOLA" with your default country language constant. e.g: for english you can find it at /language/en-GB/en-GB.com_community.country.ini

Let me know the result.

Regards,
Albert

12 years 1 month ago
Licenses:
JomSocial Expired Socialize Expired

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

12 years 1 month ago
Licenses:

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';?>

sorry, my mistake.

Regards,
Albert

The following user(s) said Thank You: SAS Coeurs de Breizh
12 years 1 month ago
Licenses:
JomSocial Expired Socialize Expired

It works. thank you for your support.
Cheers,
L

12 years 3 weeks ago
Licenses:
JomSocial Expired Socialize Expired

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

12 years 3 weeks ago
Licenses:

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';?>

Regards,
Albert

12 years 3 weeks ago
Licenses:
JomSocial Expired Socialize Expired

Fine.
Thank you
Cheers,
L

11 years 10 months ago
Licenses:
JomSocial Expired Socialize Expired

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

11 years 10 months ago
Licenses:

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

11 years 10 months ago
Licenses:
JomSocial Expired Socialize Expired

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

11 years 10 months ago
Licenses:

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>

but this code for frontend only. I think for backend we no need put this code. because all users must register they self from frontend, with that at backend, every members must already have they country value.

and about country field, I already revert back the code to original. that code was wrong, that make country field always empty.
from
<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>
to
<option value="<?php echo $countryCode;?>"<?php echo ($field->value == $countryCode) ? ' selected="selected"' : '';?>><?php echo $countryName;?></option>

Regards,
Albert

11 years 10 months ago
Licenses:
JomSocial Expired Socialize Expired

Hi,
thank you for your lights and your time.
Cheers,
L

Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW