• Resolved wpquestions2018

    (@wpquestions2018)


    Hi Greg,
    Please help solve this.

    I want my website to have 2 posting forms in 2 different pages.

    1. Users that are not logged into the site can post and pay for an ad

    2. users that login can post ads without seeing price text and their ads go live without moderation

    how can i have 2 forms, 1 with price and 2nd without price and not show the free text on the price field

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter wpquestions2018

    (@wpquestions2018)

    Greg or this can be done.

    Once the price is set as free instead of having the price show as free we can replace the free text with maybe “agents”

    How can i replace the text “free” when price is set at zero

    Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    you can remove the price field for not-logged-in users from the [adverts_add] form by adding the code below in your theme functions.php

    
    add_filter( "adverts_form_load", "anon_remove_price_field" );
    function anon_remove_price_field( $form ) {
      if( $form['name'] != "advert" ) {
        return $form;
      }
      if( get_current_user_id() > 0 ) {
        return $form;
      }
      foreach( $form["field"] as $key => $field ) {
        if( $field["name"] == "adverts_price" ) {
            unset( $form["field"][$key] );
        }
      }
      return $form;
    }
    

    This will allow you to have one form with the price field hidden if the user is not logged in.

    If you need to have two separate pages with two different form schemes, then the best way to do that is to use the Custom Fields add-on.

    Thread Starter wpquestions2018

    (@wpquestions2018)

    Thanks Greg,

    I want the price hidden for logged in user.
    The other way round

    Plugin Author Greg Winiarski

    (@gwin)

    Just change get_current_user_id() > 0 to get_current_user_id() == 0.

    Thread Starter wpquestions2018

    (@wpquestions2018)

    Greg That never worked as i wished.

    I want when a user is not logged in they can pay for a normal or featured ad, so i have 2 for not logged in.

    If a user logs in i want them to post for free

    How can i do this please

    Thread Starter wpquestions2018

    (@wpquestions2018)

    Greg That never worked at all, the code did not change anything

    I want when a user is not logged in they can pay for a normal and a featured ad, so i have 2 prices for not logged in.

    If a user logs in i want them to post for free without seeing the price field

    How can i do this please

    Plugin Author Greg Winiarski

    (@gwin)

    This is not really possible right now, it would require some more complex custom programming, but i am afraid this is beyond the free support offered here, sorry.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Posting Form’ is closed to new replies.