afoc
Forum Replies Created
-
Forum: Themes and Templates
In reply to: [Zakra] Can’t change logo on Zakra CharityI’ve found the option through here: https://www.ads-software.com/support/topic/how-to-remove-zakra-logo-and-edit-footer/
Unintuitive location.
For the record, I solved this issue by directly editing the part I pasted from
PostmanInstaller.php
to read$options['post_smtp_global_settings'] = '1';
instead ofpost_smtp_allow_overwrite
. That way the default is the value I want regardless of whether or not it keeps resetting.I’ve done some more digging into trying to figure out why this is happening. Every ~5 minutes the network settings reset, I have watched this happen in the database, in the
wp_sitemeta
table,postman_network_options
row.The only thing I can think of is for some reason the plugin is re-running its installer as if it is being newly activated, because in
post-smtp/Postman/PostmanInstaller.php
the default setting it keeps resetting to is seen here:if ( function_exists( 'is_multisite' ) && is_multisite() ) { $options['post_smtp_allow_overwrite'] = '1'; update_site_option( PostmanOptions::POSTMAN_NETWORK_OPTIONS, $options ); .... }
No other options are changed in the database except that one, and
post_smtp_global_settings
disappears from the database.Regarding the dashboard, I noticed that “per-site mode’ is the only possible display for that widget regardless of what state it is in. From
Postman/Postman-Controller/PostmanDashboardWidgetController.php
:/** * Create the function to output the contents of our Dashboard Widget. */ public function printNetworkDashboardWidget() { printf ( '<p class="wp-menu-image dashicons-before dashicons-email"> %s</p>', __ ( 'Postman is operating in per-site mode.', Postman::TEXT_DOMAIN ) ); }
Excellent, and thank you for the prompt response.
Thanks @dlim_vernier, that was helpful.
The IDs can be checked by echoing the contents of
$package['rates']
inplugins/woocommerce/includes/class-wc-shipping.php
, which is where thewoocommerce_package_rates
filters are applied.I found that the method IDs on my local environment are named like this:
flexible_shipping_ups:2:01
, etc, but they weren’t the same for the production environment. I ended up doing the following & setting a minimum no matter what method is used.add_filter( 'woocommerce_package_rates', function( $shipping_costs, $package ) { $shipping_min_cost = 15; foreach( $shipping_costs as $shipping_cost ) { $shipping_method_id = $shipping_cost->get_id(); $cost = (float) $shipping_cost->get_cost(); if( $cost < $shipping_min_cost ) { $shipping_cost->set_cost($shipping_min_cost); } } return $shipping_costs; }, 1, 2);
Ok, thank you for the quick response.