I don’t think I am allowed to send copy of a plugin. You will need to ask the Woocommerce team for access.
I had to create my own get_all_coupon_meta_fields function as I could not find a way to call yours (I believe the function is not public). Also after upgrading to the pro plugin, I found that I needed to exclude pro-free-products from the plugin list. Here is my code:
function my_wjecf_get_all_coupon_meta_fields($coupon) {
// Collect the meta_fields of all the WJECF plugins
$fields = array(
'_wjecf_min_matching_product_qty' => 'int',
'_wjecf_max_matching_product_qty' => 'int',
'_wjecf_min_matching_product_subtotal' => 'decimal',
'_wjecf_max_matching_product_subtotal' => 'decimal',
'_wjecf_products_and' => 'yesno',
'_wjecf_categories_and' => 'yesno',
'_wjecf_shipping_methods' => 'clean',
'_wjecf_payment_methods' => 'clean',
'_wjecf_customer_ids' => 'int,',
'_wjecf_customer_roles' => 'clean',
'_wjecf_excluded_customer_roles' => 'clean',
);
foreach (WJECF()->get_plugins() as $name => $plugin) {
if ($plugin->plugin_is_enabled() && ($name != 'pro-free-products')) {
// error_log('plugin name = '.$name);
$fields = array_merge($fields, $plugin->admin_coupon_meta_fields($coupon));
}
}
return $fields;
}
Let me know if there is a better way to do this.