WP Job Manager Packages – sMyles Plugins https://plugins.smyl.es WordPress and WHMCS Plugins Mon, 31 Mar 2025 18:52:15 +0000 en-US hourly 1 https://wordpress.org/?v=4.6.29 Packages Subscription Handling for Give Functionality https://plugins.smyl.es/docs-kb/packages-subscription-handling-for-give-functionality/ Mon, 31 May 2021 19:02:03 +0000 https://plugins.smyl.es/?post_type=bwl_kb&p=192524 As of WP Job Manager Packages release 1.4.0, there is a lot of new handling and features around the “give” functionality.  If you’re unfamiliar with the “give” functionality, this is a feature in the plugin that allows you to give a Job/Resume Visibility Package or Subscription when a user purchased another WooCommerce product (any kind of product).   Most commonly this is used in conjunction with the WooCommerce Paid Listings addon, to give users a Job/Resume Visibility package when they purchase a package to submit a job or resume.

Previous version of WP Job Manager Packages had this feature available in it, but nowhere near the extend of the functionality introduced and added in 1.4.0.  Prior to version 1.4.0, if the product purchased that would “give” the free visibility package was a subscription or single product, it made no difference, and there was no synchronization between the purchased product.

As of version 1.4.0, this has all changed, there is now full synchronization between the visibility packages if the purchased product is a subscription.  Below I will go over the details of this, what has changed, and give a few examples of how you can set this up to make your site that much more awesome!

One thing to note, this new functionality is only around the PURCHASED product being some kind of subscription.  A single product purchase will still work as it did prior to the 1.4.0 update.  You will only see the new settings listed below if you’re also using the WooCommerce Subscriptions addon (sold separately).

New Settings

The 1.4.0 release adds two new settings available when setting up a product (see below for examples):

WP Job Manager Packages Subscription Give Settings

WP Job Manager Packages Subscription Give Settings

  • Give on Sub Renew
    When enabled (default is enabled), if the purchased product is a subscription, when that associated subscription is renewed, the “given” visibility product will also be renewed (if subscription) or given again (if standard visibility product).Example: A Job Submission Subscription is purchased that gives a free Resume Visibility Subscription.  When the Job Subscription is renewed, the Resume Subscription will be automatically renewed (at no cost).
  • Match Sub Status
    When enabled (default is disabled), any given package (subscription or standard) will have its status matched against the purchased subscription product.Example: A Job Submission Subscription is purchased that gives a free Resume Visibility package.  The Job Subscription expires, or is cancelled (not renewed).  All associated “given” Resume Visibility products will be set to this same status.

Handling Specifics

Given Product is Subscription

In the situation where the given product is a free subscription, when the “purchased” product that gives this subscription for free is made, the WP Job Manager Packages plugin automatically creates a $0 order in WooCommerce for the given subscription (to not mess with reporting).   This is regardless of the price set on the given product, that value is however carried over to the subscription (just not the order).

The status of this order is set to completed, and the Subscriptions addon handles all processing like normal (as if the user had actually purchased the subscription).  Notes are added on both the subscription and the order, with details of what product/subscription was purchased to give the visibility subscription for free.

  • If rollover is enabled, this will be applied on renewal

 

Emails

By default, all normal subscription and order emails will still be sent like normal.  The order emails will all show the $0 cost to the user, and gives them a good understanding of the benefit of what they are getting for their purchase.

If for some reason you want to prevent some of these emails from sending, you can do so using a filter to prevent them from sending.  Just add the code snippets below (for emails you want to prevent from sending) to your child theme’s functions.php file (omit the <?php, there only needs to be one at the top of the functions.php file),  or using the Code Snippets plugin.

Prevent Give New Subscription “Completed” Order Email

This filter applies to the order email for both give on product purchase and give on user registration.  If you use this filter to disable order emails but want email enabled for user registration, use the filter listed below “Enable Give New Subscription Order (On Registration) Email”

Developers: to see all available parameters, check the file located at /wp-content/plugins/wp-job-manager-packages/includes/give.php in the give_user_subscription method.

<?php

add_filter( 'job_manager_packages_give_user_subscription_prevent_completed_order_email', 'jmp_give_prevent_completed_new_sub_order_email' );

function jmp_give_prevent_completed_new_sub_order_email( $send ){
    return true;
}

Enable Give New Subscription (on Registration) “Completed” Order Email

This is only needed if you’re using the filter above to disable new order emails for give on product purchase, and want to keep emails for on registration.

Developers: to see all available parameters, check the file located at /wp-content/plugins/wp-job-manager-packages/includes/give.php in the give_register_package method.

<?php

add_filter( 'job_manager_packages_give_reg_user_subscription_enable_order_email', 'jmp_give_enable_reg_new_sub_order_email' );

function jmp_give_enable_reg_new_sub_order_email( $send ){
    return true;
}

Prevent Give Subscription Renewal “Completed” Order Email

Developers: to see all available parameters, check the file located at /wp-content/plugins/wp-job-manager-packages/includes/give/wc.php in the check_give_related_sub_renewal method.

<?php

add_filter( 'job_manager_pacakges_give_renew_user_subscription_prevent_completed_order_email', 'jmp_give_prevent_completed_renew_sub_order_email' );

function jmp_give_prevent_completed_renew_sub_order_email( $send ){
    return true;
}

 

]]>
Template Overrides https://plugins.smyl.es/docs-kb/template-overrides/ Tue, 21 Apr 2020 14:46:54 +0000 https://plugins.smyl.es/?post_type=bwl_kb&p=181165 To customize the template you would need to use Template Overrides which you can find more information on the wpjobmanager.com documentation site:

https://wpjobmanager.com/document/template-overrides/

If you want to customize any of the form field templates (template for field types), please see this link for documentation on that:
https://plugins.smyl.es/docs-kb/using-custom-template-overrides-for-input-fields/

For the Packages addon the override directory should be jm_packages instead of job_manager

For Resumes addon the override directory should be wp-job-manager-resumes instead of job_manager

]]>
Give user free/trial visibility package on registration https://plugins.smyl.es/docs-kb/give-user-freetrial-visibility-package-on-registration/ Mon, 02 Apr 2018 21:29:33 +0000 https://plugins.smyl.es/?post_type=bwl_kb&p=152404 After a few request from clients, I have come up with a method that you can automagically give a user a package when they register on your site, which can be used as a way to provide a “free trial” or “free” package initially.  This does require adding some PHP code to your child theme’s functions.php file (or using the Code Snippets plugin).

As of  version 1.2.1+ a feature has been added to “give” a package to user on registration in the product configuration page.  You can then set the product  as hidden, and users won’t be able to select the package from package selection page, but will be given the package on registration.

I have been looking at different ways to integrate this into the plugin for a future update, probably when creating a new visibility package you can select a checkbox that says something like “Hide from cart, and assign to new users on registration”, but if you would like this functionality before I can release this update, here’s some example code to do this:

You will notice there are two actions, one for Job and one for Resumes … if you only need this for Job packages, or only for Resume packages, you can omit the add_action and the associated function (do not omit the function to check user roles).  As an example, if you only needed this for Job Packages, you would use this code instead:

You will also notice in the code that there is a check for the User Role before assigning a package.  You can change this to any specific user role you want, but in these examples the user role of employer is used for Job Visibility packages, and candidate for Resume Visibility Packages.

]]>
How to require packages for Administrators https://plugins.smyl.es/docs-kb/how-to-require-packages-for-administrators/ Sat, 28 Jan 2017 18:58:28 +0000 https://plugins.smyl.es/?post_type=bwl_kb&p=125537 By default in the new WP Job Manager Packages plugin, the configured restrictions are not enabled for Administrators.  If you want to require Administrators to have a package on the frontend of your site, you will need to add the following to your child theme’s functions.php file, or as a code snippet in using the Code Snippets plugin:

functions.php

add_filter( 'job_manager_packages_admin_required_packages_frontend', 'smyles_packages_demo_admin_require_packages' );

function smyles_packages_demo_admin_require_packages(){
	return true;
}
]]>