function orb_check_for_out_of_stock_products() { if ( WC()->cart->is_empty() ) { return; } $removed_products = []; foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) { $product_obj = $cart_item['data']; if ( ! $product_obj->is_in_stock() ) { WC()->cart->remove_cart_item( $cart_item_key ); $removed_products[] = $product_obj; } } if (!empty($removed_products)) { wc_clear_notices(); // remove any WC notice about sorry about out of stock products to be removed from cart. foreach ( $removed_products as $idx => $product_obj ) { $product_name = $product_obj->get_title(); $msg = sprintf( __( "The product '%s' was removed from your cart because it is now out of stock. Sorry for any inconvenience caused.", 'woocommerce' ), $product_name); wc_add_notice( $msg, 'error' ); } } } add_action('woocommerce_before_cart', 'orb_check_for_out_of_stock_products');
In case of any complain or © copyright or issues please check disclaimer page for faster resolutions.
E-commerce webshop
E-commerce is a booming industry worldwide. The advent of the internet and the rapid, sustainedread more...
Wat is het verschil tussen UX en UI?
UI-design en UX-design In de wereld van webdesign, maar ook in het ontwikkelen van softwareread more...
Google analytics is a free service provided by Google
Google Analytics Google analytics is a free service provided by Google that helps webmasters, siteread more...
Create a multilingual wordpress site
Translatepress plug-in The internet is truly global in nature. An internet user in the Netherlandsread more...
Search engine optimization by Yoast
Yoast Plugin Search Engine Optimization (SEO) can be a very technical field. It is alsoread more...
Het snelste en beste webshopplatform Woocommerce
In case of any complain or © copyright or issues please check disclaimer page forread more...
WP Rocket is the best way to boost your site
WP Rocket Plugin WP Rocket is a WordPress plugin that facilitates faster page loads andread more...
Why should you use Cloudways?
Cloudways hosting Web hosting is an essential service for any internet-based or internet-interfaced business. Whetherread more...
Every website needs hosting
SiteGround hosting Every website needs hosting. Unless you happen to operate a web hosting agency,read more...
Block malicious web traffic
Sucuri firewall The internet is full of malicious actors. There are low-level annoyances like “scriptread more...
Verify that Google can find your page
Google Search console Google Search Console is a free tool from Google that helps youread more...