• Resolved benjaminblue

    (@benjaminblue)


    I am using a snippet that works, to require a minimum order amount of $75. I am looking require that $75 total before freight charges are added.

    Does anyone have any insight? Is there a Woo freight variable? I looked but didn’t find one.

    My current snippet:

    
    /**
     * 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 = 75;
    
        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' 
                );
    
            }
        }
    }
    
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hey @benjaminblue !

    I am not exactly sure how you have set up freight shipping, but we have an extension that would help wonderfully in this situation. WooCommerce Table Rate shipping will allow you to set logical rules for shipping based on product totals, weight, location, and much more.

    Something like this would be a little more complex than just a code snippet. You could hire a developer to create this feature for you. We highly recommend using developers on our Customizations Page.

    Thread Starter benjaminblue

    (@benjaminblue)

    Thanks Tony, i will check it out. I am a dev myself and this for my client and her store, so i would need to take a look at how she has freight setup.

    I’ll check that out though, thanks!

    Thread Starter benjaminblue

    (@benjaminblue)

    I have the plugin installed now.

    I only need to require a minimum $75 order before shipping for all orders. So went into each shipping zone, and added Table Rates shipping method, and added Per Order calculation type with Minimum Cost Per Order of $75. I then bought a product for $2.95 that worked, no minimum was enforced.

    Can you help me with what i am missing?

    • This reply was modified 4 years, 5 months ago by benjaminblue. Reason: improved questioin

    Hi @benjaminblue – sorry for the delay here!

    If you’re still needing our assistance, you can fill out a ticket for the Table Rate Shipping plugin via this link: https://woocommerce.com/my-account/create-a-ticket/

    Thanks!
    – Joey

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Requiring minimum order amount before freight is added’ is closed to new replies.