Thatch77 Posted December 15, 2017 Share Posted December 15, 2017 (edited) 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 ); } } Edited December 15, 2017 by Thatch77 Quote Link to comment https://forums.phpfreaks.com/topic/305918-allow-variable-rules-on-quantity-rules/ Share on other sites More sharing options...
ginerjm Posted December 15, 2017 Share Posted December 15, 2017 Maybe this s/b on a wordpress related site? Sure - it is PHP code but the knowledge behind all the calls you are making would probably make more sense to those who use those functions. Quote Link to comment https://forums.phpfreaks.com/topic/305918-allow-variable-rules-on-quantity-rules/#findComment-1554682 Share on other sites More sharing options...
Thatch77 Posted December 15, 2017 Author Share Posted December 15, 2017 Potentially yes, I havent really found a good forum for wordpress yet.. Plus as you say it had some php so assumed as wordpress is most of the web nowadays. Most would have used it? Quote Link to comment https://forums.phpfreaks.com/topic/305918-allow-variable-rules-on-quantity-rules/#findComment-1554692 Share on other sites More sharing options...
ginerjm Posted December 15, 2017 Share Posted December 15, 2017 Have no idea how wordpress is meant to be used personally... I would think that any forum that focuses on WP would be good. Quote Link to comment https://forums.phpfreaks.com/topic/305918-allow-variable-rules-on-quantity-rules/#findComment-1554693 Share on other sites More sharing options...
BigB Posted December 18, 2017 Share Posted December 18, 2017 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'; Quote Link to comment https://forums.phpfreaks.com/topic/305918-allow-variable-rules-on-quantity-rules/#findComment-1554721 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.