Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Marketplace (WooCommerce Multivendor Marketplace) › How can i set a limit order ?
- This topic has 1 reply, 2 voices, and was last updated 4 years, 9 months ago by Sarmistha Chakraborty.
Viewing 1 reply thread
- AuthorPosts
- February 14, 2020 at 4:07 pm #107139georgeannaParticipant
Hello,
Is there any way how can i set a limit on the order amount.
Example i want orders to be made when they have a value 50 euros or more (<=50 euro).
Thank you. - February 18, 2020 at 11:57 am #107606Sarmistha ChakrabortyMember
Hello,
Add this code to your child theme’s functions.php
In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets//** * Set a minimum order amount for checkout */ add_action( 'woocommerce_checkout_process', 'wc_minimum_order_amount' ); add_action( 'woocommerce_before_cart' , 'wc_minimum_order_amount' ); function wc_minimum_order_amount() { // Set this variable to specify a minimum order value $minimum = 50; if ( WC()->cart->total < $minimum ) { if( is_cart() ) { wc_print_notice( sprintf( 'Your current order total is %s — you must have an order with a minimum of %s to place your order ' , wc_price( WC()->cart->total ), wc_price( $minimum ) ), 'error' ); } else { wc_add_notice( sprintf( 'Your current order total is %s — you must have an order with a minimum of %s to place your order' , wc_price( WC()->cart->total ), wc_price( $minimum ) ), 'error' ); } } }
Ref. link: https://docs.woocommerce.com/document/minimum-order-amount/
Thanks.
- AuthorPosts
Viewing 1 reply thread
- You must be logged in to reply to this topic.