WordPress.org

Forums

WP Job Manager
[resolved] Multiple forms? (10 posts)

  1. Mikey B
    Member
    Posted 9 months ago #

    Is there some way of creating multiple shortcodes?

    Basically I want to separate pages with job submission forms on, but each will behave different.

    I currently have the woocommerce plugin installed, and I want to have 1 page with the option to buy packages, and the other to take you to the standard form. (I'll then restrict which user type can see what page using S2Member)

    Thanks

    https://wordpress.org/plugins/wp-job-manager/

  2. Mike Jolley
    Member
    Plugin Author

    Posted 9 months ago #

    There is only 1 job submission form so you cannot have differing forms, not without customisation anyhow.

    Don't know if you're aware but you can have a 'free' package too, if thats all you're after here.

  3. Mikey B
    Member
    Posted 9 months ago #

    I know there is thanks, but what I want to do is to only allow certain member "levels" to access the free package.

    I've created a very badly hacked version, which included hard-coding the packages into the "package-selection.php" file, but it's obviously not working right as even though the free package should be unlimited, it's actually forcing people to add the package to their cart for every single post.. which isn't exactly ideal!

    Is there some cunning way of adding the specific packages to the page using either shortcodes or some PHP snippets once I've created them?

  4. Mike Jolley
    Member
    Plugin Author

    Posted 9 months ago #

    In the packages file (the one which lists them) in the loop, you could check the package ID is equal to your free package, and check the user level, and if they don't have access, skip over it?

  5. Mikey B
    Member
    Posted 9 months ago #

    That's a thought! I'll take a look at that in a couple of days and see if it's possible with S2member.. it's almost hometime on friday so that's not going to happen now!

  6. Mikey B
    Member
    Posted 9 months ago #

    Hi Mike, I don't suppose there's a chance of demonstrating how I could do this at all?

    Say for instance there are 2 products: ID 1 and ID 2, with 2 account levels: "freeuser" and "paiduser"

    Your plugin is brilliant, so I would strongly recommend you working with the S2Member guys to get it working with their system. If you could restrict products to different member levels, it would open up a whole level of usability

  7. Mike Jolley
    Member
    Plugin Author

    Posted 9 months ago #

    Have you found what functions S2member has to check access programmatically?

  8. Mikey B
    Member
    Posted 8 months ago #

    Sorry for the delay, I've been on holiday.

    S2Member basically uses its own variation of the standard WordPress conditionals.

    eg:

    <?php if(is_user_logged_in()){ ?>

    <?php if (current_user_is("s2member_level4")){ ?>

    <?php if (current_user_can("access_s2member_level1")){ ?>

    <?php } else if (S2MEMBER_CURRENT_USER_ACCESS_LEVEL >= 3){ ?>

  9. Mike Jolley
    Member
    Plugin Author

    Posted 8 months ago #

    So based on that, in the package-selection.php template where you have:

    <?php foreach ( $packages as $key => $package ) :
    			$product = get_product( $package );
    			?>

    You'd add something along the lines of:

    <?php foreach ( $packages as $key => $package ) :
    			$product = get_product( $package );
    if ( $product->id == 10 && ! current_user_is("s2member_level4") ) {
    continue; // skip this package!
    }
    			?>
  10. Mikey B
    Member
    Posted 8 months ago #

    Mike, you're a star! Thank you so much, I'll try that soon and let you know how I get on.

Reply

You must log in to post.

About this Plugin

  • WP Job Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.