Down & upgrade package

This topic contains 7 replies, has 4 voices, and was last updated by  Guust 5 years, 8 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #443999

    Kai Siemer
    Expired Member
    Post count: 319

    Hello,

    I have the following request:

    1. I just want the customer can only upgrade his entry he booked, but not downgrade.
    See at my Screenshot.

    2. I would like every change made by the customer to be approved by the admins, like the first entry. (Also during the upgrade)

    3. Also, I would like to have a link that allows the visitor to report the ad if the content is incorrect or unlawful. (Report ad)

    Thanks for ur Help =)

    #444028

    Guust
    Moderator
    Post count: 29970

    1. “Upgrade” really means “Choose a different package”, so that is not possible.

    2. That is possible, because the listing would disappear from your site and result in a “page not found” for search engines.
    You have the option to be notified of changes made to existing listings: GD > Notifications > Admin Emails > Notify Admin when listing edited by Author

    3. See https://wpgeodirectory.com/docs/useful-plugins/#report

    Thanks

    #444379

    Kai Siemer
    Expired Member
    Post count: 319

    1. So I do not have the opportunity to exclude the smaller packages than the chosen package?

    2. Thats Works, Thanks!
    3. Works Too

    =) Thanks for all

    #444421

    Kiran
    Moderator
    Post count: 7069

    Hello Kai,

    You can restrict showing packages from user in package list dropdown by using following code snippet.

    
    
    /* Restrict package during upgrade */
    function _gd_custom_restrict_upgrade_package_query( $sql ) {
    	global $post, $wpdb;
    
    	if ( empty( $_REQUEST['pid'] ) || empty( $_REQUEST['package_id'] ) ) {
    		return $sql;
    	}
    
    	if ( is_admin() || ! ( ! empty( $post ) && $post->ID == $_REQUEST['pid'] ) ) {
    		return $sql;
    	}
    
    	if ( ! geodir_is_page( 'add-listing' ) ) {
    		return $sql;
    	}
    
    	$package_id = geodir_get_post_meta( absint( $_REQUEST['pid'] ), 'package_id', true );
    
    	$restrict_packages = array();
    
            // DO STUFF HERE
    	if ( $package_id == 12 ) {
    		$restrict_packages = array( 1, 2, 3, 4 );
    	}
    
    	/* // Example
    	if ( $package_id == 21 ) {
    		$restrict_packages = array( 1, 2, 3, 4, 12 );
    	}
    
    	if ( $package_id == 2 ) {
    		$restrict_packages = array( 1 );
    	}
    	*/
    
    	if ( ! empty( $restrict_packages ) ) {
    		$sql = str_replace( "where status=1  and post_type =", "WHERE status = 1 AND pid NOT IN( '" . implode( "','", $restrict_packages ) . "' ) AND post_type =", $sql );
    	}
    
    	return $sql;
    }
    add_filter( 'geodir_package_list_query', '_gd_custom_restrict_upgrade_package_query', 10, 2 );

    Add above snippet in your child theme functions.php or execute via any PHP snippet plugin.
    For example i have used to hide packages 1, 2, 3, 4 from user if current listing being upgrade has package id 12.
    Change that lines with your package id.

    Thanks,
    Kiran

    #444566

    Kai Siemer
    Expired Member
    Post count: 319

    Thank u very much, thats works!

    #444621

    Alex Rollin
    Moderator
    Post count: 27815
    This reply has been marked as private.
    #445254

    Kai Siemer
    Expired Member
    Post count: 319

    Hi i have make a review =)

    i have a litte question

    I want translate Report Content, but i don’t find the Poedit files, how by GD. U Have an idea, where i can find the Po files?

    Thanks

    #445259

    Guust
    Moderator
    Post count: 29970

    “Report Content” is not translation ready, you can contact the developer here maybe: https://wordpress.org/plugins/report-content/

    Thanks

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

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

Open Support Ticket