cbcg
Forum Replies Created
-
@andreasmuench That’s great, big thanks for adding those. I’ve updated it on the site and it’s working nicely.
I’m not sure regarding the Pro version, sorry, but I don’t think they were.
Getting the same problem with one of our clients’ sites.
If a site-breaking bug can potentially be caused by an unsupported network being included in the settings, then perhaps a bit of error checking could be added to the dpsp_get_svg_data_for_networks() function?
function dpsp_get_svg_data_for_networks( $networks ) { $icons = \Mediavine\Grow\Icons::get_instance(); $slugs = array_keys( $networks ); $data = []; foreach ( $slugs as $slug ) { $icon = $icons->get( $slug ); if($icon) { $data[ $slug ] = $icon->get_data(); } else { $data[ $slug ] = ''; error_log( $slug ); error_log( print_r( $networks, true ) ); } } return $data; }(Outputting $networks was just to have a nose at what was there, just in case.)
With the above, the site doesn’t crash out anymore, and in the error log we have:
[12-Jul-2021 10:28:44 UTC] google-plus [12-Jul-2021 10:28:44 UTC] Array ( [facebook] => Array ( [label] => Facebook ) [twitter] => Array ( [label] => Twitter ) [google-plus] => Array ( [label] => Google+ ) )Hi Justus,
Shaun submitted the bug report, and the response on July 13th was “I am giving this issue a high priority. We’re going to work on this bug as soon as possible” – but nothing after that. As far as I know, it hasn’t been fixed.
I’m not familiar myself with getting the shipping details, but would it work for you this way?
(1) Is the shipping class Germany?
(2) If so, do any products in the cart have the Product B Clothing shipping class, meaning they can’t be shipped to Germany?
(3) If so, this cart can’t be shipped, so return no rates.If I’m missing something, or you need it to work flexibly rather than with a hard-coded shipping class, then maybe someone else can help?
add_filter('woocommerce_package_rates', 'fix_woocommerce_package_rates', 200, 2); function fix_woocommerce_package_rates($rates, $package) { if(!WC()->cart->is_empty()) { $country = WC()->customer->get_shipping_country(); // Only make the check if shipping country is Germany, else it doesn't matter if($country == 'DE') { // Check all products in the cart - if at least one can't be shipped to Germany, then the order can't be shipped, so return no rates foreach(WC()->cart->get_cart() as $cart_item) { $class = $cart_item['data']->get_shipping_class(); if($class = 'no-ship-to-germany') { return []; } } } } return $rates; }Forum: Plugins
In reply to: [WooCommerce] Apache domlogs create 100+ GB FilesIt’s the “Facebook for WooCommerce” plugin.
https://ww.wp.xz.cn/support/topic/excessive-database-error-log-entries
Forum: Plugins
In reply to: [Meta for WooCommerce] Excessive Database Error Log EntriesSame, it took the server down. I’ve never seen an error log grow at such a speed.
The bug is in line 141 of includes/Utilities/Background_Remove_Duplicate_Visibility_Meta.php
“wp_postmeta” has been hard-coded, but the table prefix is configurable – it should be “{$wpdb->postmeta}”.
Hi Anika,
Sorry I didn’t have time to file a bug report. I put together a quick function to do it manually. It boils down to: if the basket contains any “local” products, and the postcode is not in the “local” list, then we cannot deliver. (The bug only happens if there are “national” products in the basket as well, Woo handles it fine otherwise, but it makes no difference, wasn’t worth bothering with extra checks.)
Not sure if I can post code here and have it formatted decently, so I’ve put it in Pastebin:
https://pastebin.com/jGTdVZgMYou’ll need to set the right shipping class slug and list of postcodes (assuming this function is even suitable for your case).
Hi Shaun,
Ok, thanks for the reply, we’ll have to look into other ways to do it.
It sounds like a bug to me?
Hi,
Any further thoughts, by any chance? It’s becoming a bit of a problem for us.
Just thought I might as well provide a couple more screenshots just in case.
Shipping zones – https://snipboard.io/CmcRDg.jpg
(Free Shipping in both requires “a valid free shipping coupon”)Local (first shipping zone), flat rate – https://snipboard.io/iZEsug.jpg
Hi Shaun,
Yes, the Local zone is at the top of the list, then the National zone.
Your second paragraph is exactly the way we have it set up.
I’ll give a few example scenarios:
(1) Cart contains only a “national” product, i.e. available for delivery anywhere across the country. (a) Customer enters a local postcode: shipping is 3.95. (b) Customer enters a postcode further away: shipping is 5.95. This all works correctly with the current setup.
(2) Cart contains only a “local” product, i.e. available for delivery to the local area only. (a) Customer enters a local postcode: shipping is 3.95. (b) Customer enters a postcode further away: checkout says “no methods available”. This all works correctly with the current setup.
(3) Cart contains a “local” product and a “national” product, i.e. we cannot ship the entire basket to an address outside the local area. (a) Customer enters a local postcode: shipping is 3.95. (b) Customer enters a postcode further away: checkout should say “no methods available”, but instead says shipping is 5.95. This is the part we’re struggling to set up.
Hi Shaun,
Thank you for your reply. Unfortunately I’ve had to temporarily put it back the way it was, because when I set it up exactly as per your instructions:
(1) it makes no difference to a mixed cart, still 5.95 for a non-local postcode.
(2) it now gives the “no methods available” message if the cart contains only a “national” product, and a local postcode is entered. It’s not meant to work that way around – local zone needs to cover all products.
For more info in case it helps in any way: “local” products in our case is for food that has to be delivered by our own vehicles, therefore limited to a small local area, e.g. frozen food in a refrigerated van; “national” means safe to post out anywhere in the country, including the local areas.
Forum: Plugins
In reply to: [Mongoose Page Plugin] plugin update cause website downThat appears to be working fine. Thank you for the quick response and quick fix.
Forum: Plugins
In reply to: [Mongoose Page Plugin] plugin update cause website downGetting the same problem after running the update, using PHP 5.6 (can’t upgrade PHP because it breaks other things; this is an old site that really wants replacing). That IIFE syntax is PHP7.0+ only.