Thatch77 Posted December 15, 2017 Share Posted December 15, 2017 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 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. Link to comment 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? Link to comment 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. Link to comment 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'; Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.