Hari
Forum Replies Created
-
Hi @rwky,
Thank you for confirming that. We have escalated this to a high-priority issue, and a permanent fix will be included in our next plugin release to ensure this query only runs when absolutely necessary and optimize the query.
In the meantime, if you need an immediate solution and are comfortable editing a plugin file, you can comment out the specific line of code causing this slowdown.
File to Edit:
wp-content/plugins/woo-product-feed-pro/classes/class-get-products.php
Line to Comment Out:
Please locate line 2421 and add two forward slashes (//) to the beginning of it, as shown below.Change this:
$product_data['total_product_orders'] = \AdTribes\PFP\Classes\Orders::get_variation_total_sales( $product->get_id() );To this:
// $product_data['total_product_orders'] = \AdTribes\PFP\Classes\Orders::get_variation_total_sales( $product->get_id() );This change will stop the slowΒ query from executing during feed generation. Please be aware that this isΒ a temporary fix. Your changes will be overwritten the next time you update the plugin. The official, permanent solution will be part of the upcoming update.
Best regards,
HariHi @rwky,
Thank you for your detailed feedback and for investigating this. We appreciate you bringing it to our attention.
To help us identify the issue, could you please let us know if this is causing specific database errors or significant performance issues like timeouts?
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_rolesarray for restricting based on user roles, and$allowed_user_idsfor 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