Hari
Forum Replies Created
-
Hi ssrw,
Yes, you can use this filter ‘igfw_purchase_order_number_desc’.
Usage example:add_filter( 'igfw_purchase_order_number_desc', 'override_purchase_order_number_desc' ); function override_purchase_order_number_desc( $desc ) { return 'Your custom message here'; }
Let us know how it goes ??
Best regards!Hi there, @rwps.
Yes, you can. The current version of the plugin doesn’t have the setting to do so. But, we’ve made a custom snippet below for you to make the PO Number required instead of optional.
add_action( 'woocommerce_after_checkout_validation', 'igfw_po_number_required_on_checkout', 10, 2 ); function igfw_po_number_required_on_checkout( $data, $errors ){ if ( $data['payment_method'] === 'igfw_invoice_gateway' && get_option('igfw_enable_purchase_order_number') == 'yes' && ( ! isset( $_POST['igfw_purchase_order_number'] ) || empty( $_POST['igfw_purchase_order_number'] ) ) ) { $errors->add( 'billing_po_number_error', __( 'Please enter a PO Number.', 'invoice-gateway-for-woocommerce' ) ); } } add_filter( 'igfw_purchase_order_number_title', 'igfw_po_number_title_on_checkout' ); function igfw_po_number_title_on_checkout( $title ){ return __( 'Purchase Order (required)', 'invoice-gateway-for-woocommerce' ); }
Also, thanks for using our plugin and let me know how it goes.
Cheers!
Hi @alijens,
Thanks for bringing this up! We are aware of this issue and will fix it in a next patch which will be come shortly.This issue is due to the ussage of the WooCommerce Legacy API, it seems that the hook is not updated and only passing one parameter.
Cheers!
Forum: Plugins
In reply to: [Invoice Gateway for WooCommerce - Invoice Payment Gateway] Specific userAhh, it’s a unicode character. May I know where did you put the snippet?
Please refer to this article on how to add snippet to your wordpress site. ??
https://www.wpbeginner.com/beginners-guide/beginners-guide-to-pasting-snippets-from-the-web-into-wordpress/Forum: Plugins
In reply to: [Invoice Gateway for WooCommerce - Invoice Payment Gateway] Specific userHow weird, it works fine on my end. Please paste the snippet that you’ve been edited here?
Forum: Plugins
In reply to: [Invoice Gateway for WooCommerce - Invoice Payment Gateway] Specific userHi @marcoslmdb,
Yes, it’s possible to set the Invoice Gateway to specific user. You can either set the payment method exclusive to user roles or user IDs. I’ll send you both snippet so that you can choose based on your needs ??
Don’t forget to change the values in
$allowed_roles
array for restricting based on user roles, and$allowed_user_ids
for restricting based on user IDs.Set Invoice Gateway payment method for specific roles
// Invoice payment gateway only available for specific roles add_filter( 'woocommerce_available_payment_gateways', 'igfw_restrict_to_specific_roles' ); function igfw_restrict_to_specific_roles( $available_gateways ) { $allowed_roles = array( 'role_1', 'role_2', 'role_3', ); if ( ! is_user_logged_in() ) { unset( $available_gateways['igfw_invoice_gateway'] ); } else { $user = wp_get_current_user(); $user_roles = ( array ) $user->roles; if ( empty( array_intersect( $allowed_roles, $user_roles ) ) ) { unset( $available_gateways['igfw_invoice_gateway'] ); } } return $available_gateways; }
Set Invoice Gateway payment method for specific user IDs
// Invoice payment gateway only available for specific user IDs add_filter( 'woocommerce_available_payment_gateways', 'igfw_restrict_to_specific_user_ids' ); function igfw_restrict_to_specific_user_ids( $available_gateways ) { $allowed_user_ids = array( 1, 2, 3, ); if ( ! is_user_logged_in() ) { unset( $available_gateways['igfw_invoice_gateway'] ); } else { $user = wp_get_current_user(); $user_id = $user->ID; if ( ! in_array( $user_id, $allowed_user_ids ) ) { unset( $available_gateways['igfw_invoice_gateway'] ); } } return $available_gateways; }
Hi @jenacide,
Please make sure to set up the shipping zone correctly when you have multiple shipping methods with the same region. In the shipping zone setting, if the shipping zone is separated the shipping zone in the higher-order will override the other one and this causes the shipping method mapping to not be applied properly.
For example, you want to have shipping zone for AU region
https://snipboard.io/dIK0oD.jpgYou can combine all the Shipping methods with the same Region as shown in the screenshot below.
https://snipboard.io/yK2zwv.jpgFor further information on how to map multiple shipping methods within the same region, please click here: https://wholesalesuiteplugin.com/kb/how-to-restrict-wholesale-customers-to-using-particular-shipping-methods/
Cheers!
Hari