Country Logged User / New Listing

Please post bugs you have found in tuffclassified theme. If you have fix for that post it too.
Do not post anything else, issue related to third party plugins should not be posted here.
Locked
renas
Starter
Posts: 30
Joined: Sun Jun 14, 2015 5:33 pm

Country Logged User / New Listing

Post by renas »

Hi,

When logged in Region and City load propely from user but Country do not. :?
User avatar
tuffadmin
Site Admin
Posts: 1236
Joined: Tue Jan 29, 2013 7:31 pm

Re: Country Logged User / New Listing

Post by tuffadmin »

I will check it thanks for reporting.
No support for unnecessary PM, use forum for support queries.
Please give us good review if you bought our theme from Osclass Market
renas
Starter
Posts: 30
Joined: Sun Jun 14, 2015 5:33 pm

Re: Country Logged User / New Listing

Post by renas »

Could you replicate the issue? I only use one Country and as i can see this could be hiden.
User avatar
tuffadmin
Site Admin
Posts: 1236
Joined: Tue Jan 29, 2013 7:31 pm

Re: Country Logged User / New Listing

Post by tuffadmin »

renas wrote:Could you replicate the issue? I only use one Country and as i can see this could be hiden.
It can effect both as on some page it is javascript driven while on the others it is preference driven no matter you have single or multiple categories.

Try to also set in Defult country in theme dashboard.
No support for unnecessary PM, use forum for support queries.
Please give us good review if you bought our theme from Osclass Market
renas
Starter
Posts: 30
Joined: Sun Jun 14, 2015 5:33 pm

Re: Country Logged User / New Listing

Post by renas »

Hi have default Country specified.

While it read perfectly when not logged in, it cannot read it when on profile and logged in. Even so and as i said i only use one country and will be good to hide the Country selection as it is the only one.

Any help will be great.

Tks
renas
Starter
Posts: 30
Joined: Sun Jun 14, 2015 5:33 pm

Re: Country Logged User / New Listing

Post by renas »

Hi made further developments on this:

I do have for now preselected the default country wich is hardcoded, for this i have changed tfc.item.form.php.

Even so and as i can see this should be done on "item-post.php with a hidden input and not with a selectable dropdown with 1 contry.

So tfc.item.form.php is like this now:

Code: Select all

        static public function country_select($countries = null, $item = null) {
            if($countries==null) { $countries = osc_get_countries(); };
            if($item==null) { $item = osc_item(); };
			if( count($countries) == 1 ) {
                if( Session::newInstance()->_getForm('countryId') != "" ) {
                    $item['fk_c_country_code'] = Session::newInstance()->_getForm('countryId');
                }
                parent::generic_select('class="form-control"','countryId', $countries, 'pk_c_code', 's_name', __('Select a country...'), 'PT');
                return true;
            } else if( count($countries) >= 1 ) {
                if( Session::newInstance()->_getForm('countryId') != "" ) {
                    $item['fk_c_country_code'] = Session::newInstance()->_getForm('countryId');
                }
                parent::generic_select('class="form-control"','countryId', $countries, 'pk_c_code', 's_name', __('Select a country...'), (isset($item['fk_c_country_code'])) ? $item['fk_c_country_code'] : null);
                return true;
            } else {
                if( Session::newInstance()->_getForm('country') != "" ) {
                    $item['s_country'] = Session::newInstance()->_getForm('country');
                }
                parent::generic_input_text('placeholder="Enter Country Name" class="form-control"','country', (isset($item['s_country'])) ? $item['s_country'] : null);
                return true;
            }
        }
But what should be changed is the function or post/edit form like this:

Code: Select all

							<div class="form-group col-md-10">
								<label for="countryId"><?php _e('Country', 'tuffclassified'); ?></label>
								<?php tfcItemForm::country_select(osc_get_countries(), osc_user()) ; ?>
							</div>
As many users do have only one country it will be a valuable change.

Can you help?

Tks
Locked