Disabling the free shipping method when the cart has product/s which assigned a certain shipping class [closed]

Try this: function hide_shipping_methods( $available_shipping_methods, $package ) { $shipping_classes = array( ‘some-shipping-class-1’, ‘some-shipping-class-2’ ); $excluded_methods = array( ‘free_shipping’ ); $shipping_class_exists = false; foreach( $package[‘contents’] as $key => $value ) if ( in_array( $value[‘data’]->get_shipping_class(), $shipping_classes ) ) { $shipping_class_exists = true; break; } if ( $shipping_class_exists ) { $methods_to_exclude = array(); foreach( $available_shipping_methods as $method => … Read more

WooCommerce WebHook Retry

This seems to do the trick, it retries every 5 minutes and uses the built in woocommerce action name. <?php /* Plugin Name: Custom Stuff Description: Custom Functions, etc. */ // make sure woocommerce never disables a webhook function overrule_webhook_disable_limit($number) { return 999999999999; //very high number hopefully you’ll never reach. } add_filter(‘woocommerce_max_webhook_delivery_failures’, ‘overrule_webhook_disable_limit’); // add … Read more

How to update the WooCommerce cart Icon to show new products added with JavaScript

Heres a nice article describing how to do this, but a very different approach to yours : https://aceplugins.com/ajax-add-to-cart-button-on-the-product-page-woocommerce/ Since you know how many items are being added to the cart (1 based on your link) you could just fake some addition and upate the cart icon value Assuming the cart icon number has an id … Read more

Woocommerce: How to remove page title from storefront theme homepage

Try this: add_action( ‘wp’, ‘storefront_remove_title_from_home_homepage_template’ ); function storefront_remove_title_from_home_homepage_template() { remove_action( ‘storefront_homepage’, ‘storefront_homepage_header’, 10 ); } or if you use default template add_action( ‘wp’, ‘_storefront_remove_title_from_home_default_template’ ); function storefront_remove_title_from_home_default_template() { if ( is_front_page() ) remove_action( ‘storefront_page’, ‘storefront_page_header’, 10 ); }

WooCommerce Product Page css

You’ve actually done most of the work finding this by identifying the classes (good job!). All you then had to do was to grep the WooCommerce code for those two – and you’ll find them both in templates/single-product/product-attributes.php. So all you need to do to restructure the table is to override the single-product/product-attributes.php template and … Read more

WooCommerce single products images doesn’t zoom on hover and doesn’t change clicking on gallery

my solution works for who makes a theme from zero (not using WordPress ready themes) make a Backup from your WordPress theme go to wp-content/plugins/woocommerce and find and copy a directory which name is templates into wp-content/themes/your-theme and rename it to woocommerce in your theme directory, create a file and name it woocommerce.php and add … Read more