Title: Use with points
Last modified: September 6, 2024

---

# Use with points

 *  Resolved [yuyodev](https://wordpress.org/support/users/yuyodev/)
 * (@yuyodev)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/use-with-points/)
 * Hi,
 * Is there a way to use Advanced Free Shipping with points?
 * Specifically, I am using the Points and Rewards for WooCommerce plugin to manage
   customers’ points, but when customers use their points they do not get free shipping
   even though they meet the Advanced Free Shipping rate requirements.
 * Does Advanced Free Shipping offer a way to get free shipping even when using 
   points?
 * Thank you,
 * Takahiro

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Jeroen Sormani](https://wordpress.org/support/users/sormano/)
 * (@sormano)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/use-with-points/#post-18000606)
 * Hi Takahiro,
 * This can be accomplished through a [custom condition](https://aceplugins.com/doc/advanced-shipping-for-woocommerce/developer-adding-a-custom-condition/).
   Feel free to reach out through my website if you need help with this.
 * Cheers,
   Jeroen
    -  This reply was modified 1 year, 9 months ago by [Jeroen Sormani](https://wordpress.org/support/users/sormano/).
 *  Thread Starter [yuyodev](https://wordpress.org/support/users/yuyodev/)
 * (@yuyodev)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/use-with-points/#post-18004513)
 * Hi Jeroen, thank you for your reply. I added the following code to functions.
   php as documented, but the points does not appear in the dropdown under Conditions.
   Do you know what the problem is?
 *     ```wp-block-code
       /** * Add condition to conditions list. * * @param	array	$conditions	List of existing conditions. * @return	aray			List of modified conditions. */function was_conditions_add_points( $conditions ) {		// 'General', 'User Details', 'Cart' are default groups, you can also use something custom	$conditions['Cart']['points'] = __( 'Points', 'woocommerce-advanced-shipping' );	return $conditions;}add_filter( 'was_conditions', 'was_conditions_add_points', 10, 1 );/** * Add value field for 'date' condition *  * @param	array	$values		List of value field arguments * @param	string	$condition	Name of the condition. * @return	array	$values		List of modified value field arguments. */function was_values_add_points( $values, $condition ) {	switch ( $condition ) {		case 'points':			$values['field'] = 'text';			$values['placeholder'] 	= '0';			// Option 2; Drop down value field			//			// $values['field'] = 'select';			//			// foreach ( array( '1', '2' ) as $key => $value ) :			// 	$values['options'][ $key ] = $value;			// endforeach;					break;	}	return $values;}add_filter( 'was_values', 'was_values_add_points', 10, 2 );/** * Must match given date. * * @param  bool   $match    Current matching status. Default false. * @param  string $operator Store owner selected operator. * @param  mixed  $value    Store owner given value. * @param  array  $package  Shipping package. * @return bool             If the current user/environment matches this condition. */function was_match_condition_points( $match, $operator, $value, $package ) {	// Check if its a date, when false subtract the number of days	if ( $value > 0 ) :		if ( $operator == '==' ) :			$match = ( $value ==  $value);		elseif ( $operator == '!=' ) :			$match = ( $value !=  $value);		elseif ( $operator == '>=' ) :			$match = (  $value >=  $value);		elseif ( $operator == '<=' ) :			$match = (  $value <=  $value );		endif;	endif;	return $match;}add_action( 'was_match_condition_points', 'was_match_condition_points', 10, 4 );/** * Add date description. * * @param	array	$description	List of existing descriptions. * @return	array			List of modified descriptions. */function was_descriptions_points( $descriptions ) {		$descriptions['points'] = __( 'points use', 'woocommerce-advanced-shipping' );		return $descriptions;	}add_filter( 'was_descriptions', 'was_descriptions_points' );
       ```
   
 *  Plugin Author [Jeroen Sormani](https://wordpress.org/support/users/sormano/)
 * (@sormano)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/use-with-points/#post-18007686)
 * Hi,
 * Sorry, I see I forgot to mention in my previous comment that the doc is for the
   [Advanced Shipping](https://aceplugins.com/plugin/advanced-shipping-for-woocommerce/purchase)
   plugin, its very similar, but you’d have to look up the correct hook/filter names
   for this plugin.
 * Cheers,
   Jeroen
 *  Thread Starter [yuyodev](https://wordpress.org/support/users/yuyodev/)
 * (@yuyodev)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/use-with-points/#post-18008692)
 * Hi,
 * I have solved some problems by rewriting the part in the documentation where 
   it says “was” to “wafs”. The issue now is how to detect point usage handled by
   another plugin and pass it to this plugin as a condition, but I will give it 
   a try.
 * Thank you,
 * Takahiro

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Use with points’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-advanced-free-shipping/assets/icon-256x256.png?
   rev=1171652)
 * [Advanced Free Shipping for WooCommerce](https://wordpress.org/plugins/woocommerce-advanced-free-shipping/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-advanced-free-shipping/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-advanced-free-shipping/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-advanced-free-shipping/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-advanced-free-shipping/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-advanced-free-shipping/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [yuyodev](https://wordpress.org/support/users/yuyodev/)
 * Last activity: [1 year, 9 months ago](https://wordpress.org/support/topic/use-with-points/#post-18008692)
 * Status: resolved