split 1 cart item into instock and back ordered

Here is a plugin that does this in case someone else needs it. Just save this in <?php /* Plugin Name: WC Split Cart Backorders Plugin URI: https://www.creativemonarchy.com Description: A simple plugin that helps you split the WooCommerce in stock and backorder stock items for the same product in your cart. Author: Sohrab Iravani Version: … Read more

Woocommerce – if selected attribute term equals

I have modified code of https://stackoverflow.com/a/54722971/10183871 which you have provided. i have made some changes according your requirement. you can take reference below code and make changes as per your requirement. i have tested code and it is working for me https://prnt.sc/pgwwvq. // Set the defined product attribute taxonomy function vendor_defined_taxonomy() { // The targeted … Read more

WooCommerce and ACF: How to Redirect Upon Add to Cart – Partially Working Example

Try with below code. i have tested and it is working fine for me. add_filter( ‘woocommerce_add_to_cart_redirect’, ‘acf_product_redirect’ ); function acf_product_redirect() { #Get product ID if ( isset( $_REQUEST[‘add-to-cart’] ) || is_numeric( $_REQUEST[‘add-to-cart’] ) ) { $product_id = (int) apply_filters( ‘woocommerce_add_to_cart_product_id’, $_REQUEST[‘add-to-cart’] ); # Check if redirect url set or not if (!empty(get_field(‘redirect_url’, $product_id))) { $redirect_id … Read more