Marco Florian
Forum Replies Created
-
Well, actually, the plugin author should apply this fix. Hope he/she does. Still a great plugin! Thanks.
Glad to help. You’re welcome 🙂
Marking it as solve.
Go to the file and line below:
/wp-content/plugins/wordpress-https/lib/WordPressHTTPS/Module/DomainMapping.php on line 43
Replace:
preg_match(‘/’ . $http_domain . ‘/’, $url, $matches);
With:
preg_match(‘/’ . str_replace(‘/’, ‘\/’, $http_domain) . ‘/’, $url, $matches);
Forum: Plugins
In reply to: [WooCommerce - Table Rates] Enable only if inside min and max range.Quick fix:
Find (there are two cases):
$shipping_costs = (float) $rates[‘shippingO’];
if ( ( (float) $price >= (float) $rates[‘minO’]) && ( (float) $price <= (float) $rates[‘maxO’] ) )
break;Replace with:
if ( ( (float) $price >= (float) $rates[‘minO’]) && ( (float) $price <= (float) $rates[‘maxO’] ) ) {
$shipping_costs = (float) $rates[‘shippingO’];
break;
}Checking a previous post, I believe the author wanted to also cover total prices even if they were over the max value. I think it was right how it was working before. I would propose a different solution which I think could be better to that scenario. I would add a wildcard * so if the max value is equal to an asterisk, there would be no max limit.
I hope I get an answer soon if the workaround above is correct or if I should do different for my case.
Thanks for such terrific work on this plugin, keep it up!
MarcoForum: Plugins
In reply to: [WooCommerce - Table Rates] Enable only if inside min and max range.Note: The free shipping method is only enabled if orders exceed a total of $500. If this is the case, free shipping is enabled, otherwise, it is disabled.
Thanks.
I went to the line and tried a few things.
(1) preg_quote($http_domain, ‘/’)
– This would change “\d.gravatar.com” to “\\d\.gravatar\.com”. Which is right, but we need the \d to be parsed as regexp.(2) preg_match(‘|’ . $http_domain . ‘|’, $url, $matches);
– I changed the delimiters to another character, but again, we could be using it inside the regexp.(3) str_replace(‘/’, ‘\/’, $http_domain)
– I just decided to use this one. It is working fine, no more warnings. Try it out and make the fix if applicable and/or give me a recommendation please.Thanks.