Woo-commerce | Disable proceed to checkout button in cart page if total in cart less than 15 [closed]

Try this: function disable_checkout_button_no_shipping() { $total = WC()->cart->get_cart_subtotal(); // Change made if( $total < 15 ){ remove_action( ‘woocommerce_proceed_to_checkout’, ‘woocommerce_button_proceed_to_checkout’, 20 ); echo ‘<a href=”#” class=”checkout-button button alt wc-forward”>Proceed to checkout</a>’; } } add_action( ‘woocommerce_proceed_to_checkout’, ‘disable_checkout_button_no_shipping’, 1 );

Where is the “default attribute” values located in the phpMyAdmin in Woocommerce?

Default attributes of WooCommerce variable products are stored as post meta in the database. You can find them in the wp_postmeta table, where the post_id column is the post ID of the parent product (Variable product), and the meta_key column is _default_attributes. You can clear and remove default attributes of all products by replacing all … Read more

WooCommerce: add different order item meta for each item in order

Try, woocommerce_checkout_create_order_line_item It has 4 available arguments and available after version WooCommerce 3.3+. $item is an instance of WC_Order_Item_Product new introduced Class $cart_item_key is the cart item unique hash key $values is the cart item $order an instance of the WC_Order object (This is a very useful additional argument in some specific cases) In this … Read more