woocommerce plugin bugs

You need to correct how you call function in your class, if the function you want to use is in the class, for the add_action: add_action( ‘woocommerce_account_wallet-endpoint’, array($this, ‘displayWallet’) ); add_action( ‘wp_login’, array($this, ‘walletOwner’), 99); Replace all add_action or filter like this.

Add a product attribute to permalink in WooCommerce

You can do like this, to append QUERY to permalinks (not base url): add_filter( ‘post_type_link’, ‘my_append_query_string’, 10, 4 ); function my_append_query_string( $permalink, $post, $leavename, $sample ) { if ( $post->post_type == ‘shop’ ) { if (get_option(‘permalink_structure’)){ $permalink = AddStringToUrl($permalink,’color=red’); } } return $permalink; } function AddStringToUrl($current_url, $string) { return $current_url . ( stripos($current_url, ‘?’) === … Read more

WooCommerce remove_action and add_action [closed]

You can create your own dedicated function and overwrite a default one when a function is in a function_exists statement. if ( ! function_exists( ‘woocommerce_template_single_add_to_cart’ ) ) {} You can use the woocommerce_template_single_add_to_cart function from wc-template-functions.php Just copy/paste this function to your woocommerce-functions.php and modify it with the statement you want. This method is simple … Read more