Edit "add new listing form"

This topic contains 9 replies, has 3 voices, and was last updated by  Sandro 6 years ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #427834

    Sandro
    Expired Member
    Post count: 31

    Hello,
    i need to know if it’s possible to hide the radio button “Set xxx as default category” on the add new listing form in the ajax Chained category display type.
    Aonother question is if i can add another check button at the bottom of the add new listing form, near the accept terms and condition button ( something similar with the link at the privacy and cookies page instead of terms and condition page. We need two separate check…
    We use the default “places” post.
    Attached an example to explain what i mean.
    Thank you

    Sandro

    #427867

    Alex Rollin
    Moderator
    Post count: 27815

    Hello,

    GD does not include an option to add a Privacy page; instead we recommend adding a checkbox to the user profile that can be checked at resgistration with our UsersWP plugin: https://userswp.io

    You can always add another custom field that is a checkbox custom field, though, but moving it down the form would not be possible without a customization.

    About hiding the default category radio on the add listing page with CSS, I will flag this and see if we have a solution for you. Thanks for you patience while we look into it.

    #427971

    Sandro
    Expired Member
    Post count: 31

    Thank you Alex,
    i will use the checkbox in the user profile, but i need the text of the checkbox linkable to the privacy page. Is not possible to add an html “a href” on the form label text?

    #427975

    Alex Rollin
    Moderator
    Post count: 27815

    A member asked about something similar in a previous topic, but it is not a checkbox.

    https://wpgeodirectory.com/support/topic/add-custom-fields-with-link-in-add-listing/#post-363418

    I will flag your question for the developers to see if they know of a solution. Thanks for your patience while they look into it.

    #428036

    Kiran
    Moderator
    Post count: 7069

    Hi Sandro,

    To add checkbox field similar to terms & conditions, create one custom field and make it mandatory. Then use following code snippet to add link for that field.

    
    
    function _gd_custom_field_input_checkbox( $html, $cf ) {
    	$html_var = $cf['htmlvar_name'];
    
    	// CHANGE LINK HERE
    	$link = '<a href="https://www.mysite.com/privacy" target="_blank">' . __( 'Please accept privacy conditions', 'geodirectory' ) . '</a>';
    
    	$value = geodir_get_cf_value( $cf );
    	if ( $value == '' && $cf['default'] ) {
    		$value = '1';
    	}
    	if ( $value != '1' ) {
    		$value = '0';
    	}
    	ob_start();
    	?>
    	<div id="<?php echo $cf['name'];?>_row" class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
    		<label> <?php $site_title = __($cf['site_title'], 'geodirectory'); echo (trim($site_title)) ? $site_title : '&nbsp;'; ?> <?php if ($cf['is_required']) echo '<span>*</span>';?></label>
    		<input type="hidden" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>" value="<?php echo esc_attr($value);?>"/>
    		<input  <?php if ($value == '1') { echo 'checked="checked"'; }?>  value="1" class="gd-checkbox" field_type="<?php echo $cf['type'];?>" type="checkbox" onchange="if(this.checked){jQuery('#<?php echo $cf['name'];?>').val('1');} else{ jQuery('#<?php echo $cf['name'];?>').val('0');}"/> 
    		<span class="geodir_message_privacy"><?php echo $link; ?></span>
    		<span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
    		<?php if ($cf['is_required']) { ?>
    		<span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
    		<?php } ?>
    	</div>
    	<?php
    	$html = ob_get_clean();
    
    	return $html;
    }
    add_filter( 'geodir_custom_field_input_checkbox_geodir_Privacy', '_gd_custom_field_input_checkbox', 10, 2 );

    In “geodir_custom_field_input_checkbox_geodir_Privacy” replace “geodir_Privacy” with your field name.
    Change the link to your desired one that you want.

    ===
    To hide “Set xxx as default category” use following css snippet.

    
    
    .post_catlist_item .post_default_category {
    	display: none
    }

    Kiran

    #428065

    Sandro
    Expired Member
    Post count: 31

    Excuse me Kiran, be patient …
    As suggested by Alex I entered the privacy flag in the registration form of userswp.
    Is this snippet okay anyway or does it need a different one?

    #428085

    Alex Rollin
    Moderator
    Post count: 27815

    Hello Sandro,

    If you are happy with the UsersWP functionality, then the first PHP snippet may not be needed.

    If I misunderstood your question, please write back and let us know more so we can help.

    Thanks

    #428132

    Sandro
    Expired Member
    Post count: 31

    Hello Alex,
    i resolved using the po translate file of userswp, changing the “accept terms and conditions” phrase to “I agree to the treatment of my personal information” with the link to the privacy page (that is different from terms and conditions page of listings) in the registration form. Not sure if it’s the right method…

    #428136

    Alex Rollin
    Moderator
    Post count: 27815

    Sounds good! There are many possibilities for tuning with the language files.

    Good fix!

    #428926

    Sandro
    Expired Member
    Post count: 31

    Perfect Alex, thank you again.

Viewing 10 posts - 1 through 10 (of 10 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket