billras101
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] How would I change the default no gateways messageTry this:
// replace default woocommerce 'no available payment gateway' message function custom_woo_no_gateway_message( $no_gateway_message ) { $no_gateway_message = __( 'Your custom message here', 'woocommerce' ); return $no_gateway_message; } add_filter('woocommerce_no_available_payment_methods_message', 'custom_woo_no_gateway_message');Based on a snippet in Jesse M’s post at http://mycred.me/support/forums/topic/load-up-pointscreditstokens-at-check-out-woocommerce/
After a bit of tinkering, I think I figured out a fix. In the file gfctaddonbase.php …
– – – – – – –
I UPDATED THIS FUNCTION:
– – – – – – –[Code moderated as per the Forum Rules. Please use the pastebin]
– – – – – – –
TO THIS:
– – – – – –[Code moderated.]
– – – – –
1. In the original, the first ‘if’ was looking for $field[‘type’] = ‘checkbox’, but the app returned the ‘multiselect’ when using the multi select field type.
2. ‘wp_set_object_terms’ did not seem to work properly when adding multiple terms, so I swapped it out for wp_set_post_terms and used the string of ids returned by $$entry[$field[‘id’]] (from the section of code after the ‘else if’) to populate the $term_ids variable.
After testing, the revised code seems to be working as expected.
Any concerns or advice … ?
Bill 😀