Jump to content

Allow variable rules on "Quantity Rules"


Thatch77

Recommended Posts

Hey guys, i need to Amend the quantity rules plugin to allow rules on product variations also.  Now I cant seem to find a way of doing this currently. I am still learning php/wordpress etc so its a bit above me at the moment. Im assuming i would need to add something in here? 

function wpbo_get_applied_rule( $product, $role = null ) {
	
	// Check for site wide rule
	$options = get_option( 'ipq_options' );
	
	if ( get_post_meta( $product->id, '_wpbo_deactive', true ) == 'on' ) {
		return 'inactive';
		
	} elseif ( get_post_meta( $product->id, '_wpbo_override', true ) == 'on' ) {
		return 'override';
	
	} elseif ( isset( $options['ipq_site_rule_active'] ) and $options['ipq_site_rule_active'] == 'on' ) {
		return 'sitewide';
		
	} else {
		return wpbo_get_applied_rule_obj( $product, $role );
	}
} 

 

Link to comment
Share on other sites

Hi @Thatch77,

 

We are little lost with your question, have you looked in Wordpress admin dashboard for any of the options you're trying to achieve?

 

It looks like you could edit some code here for your objective, you could create another condition (quantity), though it may never get called or used, there is missing code and I am assuming this is a third-party add-on, may want to check on the third-party add-on web page.

 

 

 

Example only... does nothing... Where was the variables $quanity and $amt set?? Where is it returned too?? and how are they used??

	} elseif ( !empty($quanity) and !empty($amt)) {
		$quanity = $amt;
		return '$quanity';
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.