WPML support – hack for your consideration
-
hi
i was having a problem, actually two, but this with WPML was a major issue:the plugin works with using $product->id, but WPML translations of such product have their own ids, so i modified woo-min-max-quantity.php at line 79 from:
$mmaxEnable = get_post_meta($product->id, '_wc_mmax_prd_opt_enable', true); $minQty = get_post_meta($product->id, '_wc_mmax_max', true); $maxQty = get_post_meta($product->id, '_wc_mmax_min', true);to:
if(function_exists('icl_object_id')) { $default_language = wpml_get_default_language(); $prodid = icl_object_id($product->id, 'product', true, $default_language); } else { $prodid = $product->id; } $mmaxEnable = get_post_meta($prodid, '_wc_mmax_prd_opt_enable', true); $minQty = get_post_meta($prodid, '_wc_mmax_max', true); $maxQty = get_post_meta($prodid, '_wc_mmax_min', true);the other issue i was having if that if you do not set a maximum value too, the minimum does not work. i was wondering if it was possible for you to add an option for max=null, or have a general option page where to set a general high value.
thanks
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘WPML support – hack for your consideration’ is closed to new replies.