Woocommerce poor guys swiss knife conflict?
-
Hello, everyone.
I am using woocommerce poor guys swiss knife plugin, very good plugin with all the features i need.
However, i found below codes in the plugin may cause some conflicts with woocommerce.
function wcpgsk_clear_messages() { if ( function_exists('WC') && function_exists('wc_clear_notices') ) : wc_clear_notices(); else : global $woocommerce; $woocommerce->clear_messages(); endif; }
I have to delete the IF part to avoid cart stock check issue. Have to keep the Function, otherwise causing error.
function wcpgsk_clear_messages() { global $woocommerce; }
Below is the part of code in the plugin where i found the above code. Just wondering except above modification, is there any potential conflict with current version of woocommerce? Do i still need these codes in current version of woocommerce as it seems related to an old version of woommcerce (Handle functions deprecated in WooCommerce since 2.1.0 for WooCommerce installations < 2.1). Thanks.
Not sure if it is proper to post plugin code here, feel free to delete if not allowed.
/** * Handle functions deprecated in WooCommerce since 2.1.0 for WooCommerce installations < 2.1 */ function wcpgsk_add_error( $error ) { if ( function_exists('WC') && function_exists('wc_add_notice') ) : wc_add_notice( $error, 'error'); else : global $woocommerce; $woocommerce->add_error( $error ); endif; } function wcpgsk_add_message( $message ) { if ( function_exists('WC') && function_exists('wc_add_notice') ) : wc_add_notice( $message ); else : global $woocommerce; $woocommerce->add_message( $message ); endif; } function wcpgsk_clear_messages() { if ( function_exists('WC') && function_exists('wc_clear_notices') ) : wc_clear_notices(); else : global $woocommerce; $woocommerce->clear_messages(); endif; } function wcpgsk_show_messages() { if ( function_exists('WC') && function_exists('wc_print_notices') ) : wc_print_notices(); else : global $woocommerce; $woocommerce->show_messages(); endif; } function wcpgsk_set_messages() { if ( !function_exists('WC') ) : global $woocommerce; $woocommerce->set_messages(); endif; }
- The topic ‘Woocommerce poor guys swiss knife conflict?’ is closed to new replies.