New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Free Shipping - Remove other options! #1499

Closed
sjeden opened this Issue Sep 12, 2012 · 30 comments

Comments

Projects
None yet
@sjeden
Contributor

sjeden commented Sep 12, 2012

From the forums:

"I have "Free Shipping" set to kick in on an order of $100 or more. Is there a way to make the other shipping methods disappear once this requirement has been met? It's still offering a paid shipping option to the customer in the checkout and that seems kinda silly."

This really does make alot of sense.

Thanks

@mikejolley

This comment has been minimized.

Show comment
Hide comment
@mikejolley

mikejolley Sep 12, 2012

Member

That doesn't make sense in all situations. What if you offer free regular shipping and paid express shipping like many retailers do?

Member

mikejolley commented Sep 12, 2012

That doesn't make sense in all situations. What if you offer free regular shipping and paid express shipping like many retailers do?

@sjeden

This comment has been minimized.

Show comment
Hide comment
@sjeden

sjeden Sep 12, 2012

Contributor

I understand that,

but then wouldn't the shipping options need some sort of rating system, ie... You wouldn't want regular shipping to show if they meet the free shipping option, but you would like a "Next Day" option.

Ratings - 1 Regular Shipping Options, 2 Free Shipping Threshold (so it can be used to show above inferior options), 3 Express Options (used as a superior option to threshold)

Im not coder, but it would be something like this i believe (expression wise)

if - threshold met (display free shipping + superior options ) else ( display regular shipping options + only £x for free shipping )

Cheers

Contributor

sjeden commented Sep 12, 2012

I understand that,

but then wouldn't the shipping options need some sort of rating system, ie... You wouldn't want regular shipping to show if they meet the free shipping option, but you would like a "Next Day" option.

Ratings - 1 Regular Shipping Options, 2 Free Shipping Threshold (so it can be used to show above inferior options), 3 Express Options (used as a superior option to threshold)

Im not coder, but it would be something like this i believe (expression wise)

if - threshold met (display free shipping + superior options ) else ( display regular shipping options + only £x for free shipping )

Cheers

@sjeden sjeden closed this Sep 12, 2012

@sjeden sjeden reopened this Sep 12, 2012

@mikejolley

This comment has been minimized.

Show comment
Hide comment
@mikejolley

mikejolley Sep 12, 2012

Member

Table Rates can do it - we'd suggest that. You can define as many rates as you want with table rates (even free ones) and make a rate priority so others get hidden.

Member

mikejolley commented Sep 12, 2012

Table Rates can do it - we'd suggest that. You can define as many rates as you want with table rates (even free ones) and make a rate priority so others get hidden.

@sjeden

This comment has been minimized.

Show comment
Hide comment
@sjeden

sjeden Sep 12, 2012

Contributor

Ah i see,

I didnt realise table rates could do it, i have table rates already for myself but i was thinking of other users..

If they dont require table rates, this would be a good basic thing to be added.

Thanks

Contributor

sjeden commented Sep 12, 2012

Ah i see,

I didnt realise table rates could do it, i have table rates already for myself but i was thinking of other users..

If they dont require table rates, this would be a good basic thing to be added.

Thanks

@maxrice

This comment has been minimized.

Show comment
Hide comment
@maxrice

maxrice Sep 12, 2012

Contributor

If you've defined a few flat rate shipping methods (say a standard, expedited, and next day rate) and want to hide the standard shipping method when free shipping is available, you can use something like this in your functions.php:

// Hide standard shipping option when free shipping is available
add_filter( 'woocommerce_available_shipping_methods', 'hide_standard_shipping_when_free_is_available' , 10, 1 );

/**
 *  Hide Standard Shipping option when free shipping is available
 * 
 * @param array $available_methods
 */
function hide_standard_shipping_when_free_is_available( $available_methods ) {

    if( isset( $available_methods['free_shipping'] ) AND isset( $available_methods['flat_rate'] ) ) {

        // remove standard shipping option
        unset( $available_methods['flat_rate'] );
    }

    return $available_methods;
}

I've used this when customers were selecting and paying for standard shipping even though free shipping was available and selected by default.

Contributor

maxrice commented Sep 12, 2012

If you've defined a few flat rate shipping methods (say a standard, expedited, and next day rate) and want to hide the standard shipping method when free shipping is available, you can use something like this in your functions.php:

// Hide standard shipping option when free shipping is available
add_filter( 'woocommerce_available_shipping_methods', 'hide_standard_shipping_when_free_is_available' , 10, 1 );

/**
 *  Hide Standard Shipping option when free shipping is available
 * 
 * @param array $available_methods
 */
function hide_standard_shipping_when_free_is_available( $available_methods ) {

    if( isset( $available_methods['free_shipping'] ) AND isset( $available_methods['flat_rate'] ) ) {

        // remove standard shipping option
        unset( $available_methods['flat_rate'] );
    }

    return $available_methods;
}

I've used this when customers were selecting and paying for standard shipping even though free shipping was available and selected by default.

@mikejolley

This comment has been minimized.

Show comment
Hide comment
@mikejolley

mikejolley Sep 12, 2012

Member

@maxrice is this on gist? Would be good to put in the docs.

Member

mikejolley commented Sep 12, 2012

@maxrice is this on gist? Would be good to put in the docs.

@maxrice

This comment has been minimized.

Show comment
Hide comment
@maxrice
Contributor

maxrice commented Sep 12, 2012

@mikejolley

This comment has been minimized.

Show comment
Hide comment
@mikejolley

mikejolley Sep 16, 2012

Member

ta :)

Member

mikejolley commented Sep 16, 2012

ta :)

@mikejolley mikejolley closed this Sep 16, 2012

@tszming

This comment has been minimized.

Show comment
Hide comment
@tszming

tszming Dec 3, 2012

Contributor

From the usability point of view, would be great if there is an option for user to choose the "hide_standard_shipping_when_free_is_available"

Contributor

tszming commented Dec 3, 2012

From the usability point of view, would be great if there is an option for user to choose the "hide_standard_shipping_when_free_is_available"

@sjeden

This comment has been minimized.

Show comment
Hide comment
@sjeden

sjeden Dec 18, 2012

Contributor

@maxrice - how to make your gist work with table rates :( i cannot do it..

i thought it would be as simple as:

// Hide standard shipping option when free shipping is available
add_filter( 'woocommerce_available_shipping_methods', 'hide_standard_shipping_when_free_is_available' , 10, 1 );
/**
 *  Hide Standard Shipping option when free shipping is available
 * 
 * @param array $available_methods
 */
function hide_standard_shipping_when_free_is_available( $available_methods ) {
    if( isset( $available_methods['free_shipping'] ) AND isset( $available_methods['table_rate'] ) ) {
        // remove standard shipping option
        unset( $available_methods['table_rate'] );
    }
    return $available_methods;
}

but clearly not! :(

Contributor

sjeden commented Dec 18, 2012

@maxrice - how to make your gist work with table rates :( i cannot do it..

i thought it would be as simple as:

// Hide standard shipping option when free shipping is available
add_filter( 'woocommerce_available_shipping_methods', 'hide_standard_shipping_when_free_is_available' , 10, 1 );
/**
 *  Hide Standard Shipping option when free shipping is available
 * 
 * @param array $available_methods
 */
function hide_standard_shipping_when_free_is_available( $available_methods ) {
    if( isset( $available_methods['free_shipping'] ) AND isset( $available_methods['table_rate'] ) ) {
        // remove standard shipping option
        unset( $available_methods['table_rate'] );
    }
    return $available_methods;
}

but clearly not! :(

@sjeden

This comment has been minimized.

Show comment
Hide comment
@sjeden

sjeden Dec 18, 2012

Contributor

@maxrice.

Ive managed to eliminate on one rate.. how to add a wildcard so it does all table rates? :)

table_rate-2 : 12

@mikejolley - snook you in here so you can help for a sec :P dont give me the generic this is not a support channel :D

Contributor

sjeden commented Dec 18, 2012

@maxrice.

Ive managed to eliminate on one rate.. how to add a wildcard so it does all table rates? :)

table_rate-2 : 12

@mikejolley - snook you in here so you can help for a sec :P dont give me the generic this is not a support channel :D

@maxrice

This comment has been minimized.

Show comment
Hide comment
@maxrice

maxrice Dec 18, 2012

Contributor

@sjeden print_r() the $available_methods array to see what the keys are and then check if the key starts with something like table_rate and unset it :)

Contributor

maxrice commented Dec 18, 2012

@sjeden print_r() the $available_methods array to see what the keys are and then check if the key starts with something like table_rate and unset it :)

@sjeden

This comment has been minimized.

Show comment
Hide comment
@sjeden

sjeden Dec 18, 2012

Contributor

@maxrice

Array (
[table_rate-1 : 14] => WC_Shipping_Rate Object (
[id] => table_rate-1 : 14
[label] => Exp Delivery - Large
[cost] => 12.5
[taxes] => Array (
[1] => 2.5
)
[method_id] => table_rate
)
[table_rate-2 : 12] => WC_Shipping_Rate Object (
[id] => table_rate-2 : 12
[label] => Std. Delivery - Large
[cost] => 10
[taxes] => Array (
[1] => 2
)
[method_id] => table_rate
)
[free_shipping] => WC_Shipping_Rate Object (
[id] => free_shipping
[label] => Free Shipping
[cost] => 0
[taxes] => Array (
)
[method_id] => free_shipping
)
[local_pickup] => WC_Shipping_Rate Object (
[id] => local_pickup
[label] => Collection From Shop
[cost] => 0
[taxes] => Array (
)
[method_id] => local_pickup
)
)
Contributor

sjeden commented Dec 18, 2012

@maxrice

Array (
[table_rate-1 : 14] => WC_Shipping_Rate Object (
[id] => table_rate-1 : 14
[label] => Exp Delivery - Large
[cost] => 12.5
[taxes] => Array (
[1] => 2.5
)
[method_id] => table_rate
)
[table_rate-2 : 12] => WC_Shipping_Rate Object (
[id] => table_rate-2 : 12
[label] => Std. Delivery - Large
[cost] => 10
[taxes] => Array (
[1] => 2
)
[method_id] => table_rate
)
[free_shipping] => WC_Shipping_Rate Object (
[id] => free_shipping
[label] => Free Shipping
[cost] => 0
[taxes] => Array (
)
[method_id] => free_shipping
)
[local_pickup] => WC_Shipping_Rate Object (
[id] => local_pickup
[label] => Collection From Shop
[cost] => 0
[taxes] => Array (
)
[method_id] => local_pickup
)
)
@maxrice

This comment has been minimized.

Show comment
Hide comment
@maxrice

maxrice Dec 18, 2012

Contributor

so something like:

// Hide table rate shipping option when free shipping is available
add_filter( 'woocommerce_available_shipping_methods', 'hide_table_rate_shipping_when_free_is_available' , 10, 1 );

/**
 *  Hide Table Rate shipping option when free shipping is available
 *
 * @param array $available_methods
 */
function hide_table_rate_shipping_when_free_is_available( $available_methods ) {

    if( isset( $available_methods['free_shipping'] ) ) {

         foreach( $available_methods as $method_id => $method ) {

            // check if method starts with 'table_rate' and remove it
            if ( ! strncmp( $method_id, 'table_rate-', 11 ) )
                unset( $available_methods[ $method_id ] );
         }
    }   

    return $available_methods;
 }
Contributor

maxrice commented Dec 18, 2012

so something like:

// Hide table rate shipping option when free shipping is available
add_filter( 'woocommerce_available_shipping_methods', 'hide_table_rate_shipping_when_free_is_available' , 10, 1 );

/**
 *  Hide Table Rate shipping option when free shipping is available
 *
 * @param array $available_methods
 */
function hide_table_rate_shipping_when_free_is_available( $available_methods ) {

    if( isset( $available_methods['free_shipping'] ) ) {

         foreach( $available_methods as $method_id => $method ) {

            // check if method starts with 'table_rate' and remove it
            if ( ! strncmp( $method_id, 'table_rate-', 11 ) )
                unset( $available_methods[ $method_id ] );
         }
    }   

    return $available_methods;
 }
@sjeden

This comment has been minimized.

Show comment
Hide comment
@sjeden

sjeden Dec 18, 2012

Contributor

you sir, are amazing!

works brilliantly :)

Contributor

sjeden commented Dec 18, 2012

you sir, are amazing!

works brilliantly :)

@danieldbird

This comment has been minimized.

Show comment
Hide comment
@danieldbird

danieldbird Jan 19, 2013

Works amazingly. Thank you. My scenario was flat rate local delivery, pickup, and free delivery for orders over $50.
Just changed a line or two:

/**

  • Hide Table Rate shipping option when free shipping is available
  • @param array $available_methods
    */
    function hide_table_rate_shipping_when_free_is_available( $available_methods ) {

    if( isset( $available_methods['free_shipping'] ) ) {

     foreach( $available_methods as $method_id => $method ) {
    
        // check if method starts with 'local_delivery' and remove it
        if ( ! strncmp( $method_id, 'local_delivery', 14 ) )
            unset( $available_methods[ $method_id ] );
     }
    

    }

    return $available_methods;
    }

danieldbird commented Jan 19, 2013

Works amazingly. Thank you. My scenario was flat rate local delivery, pickup, and free delivery for orders over $50.
Just changed a line or two:

/**

  • Hide Table Rate shipping option when free shipping is available
  • @param array $available_methods
    */
    function hide_table_rate_shipping_when_free_is_available( $available_methods ) {

    if( isset( $available_methods['free_shipping'] ) ) {

     foreach( $available_methods as $method_id => $method ) {
    
        // check if method starts with 'local_delivery' and remove it
        if ( ! strncmp( $method_id, 'local_delivery', 14 ) )
            unset( $available_methods[ $method_id ] );
     }
    

    }

    return $available_methods;
    }

@JRyven

This comment has been minimized.

Show comment
Hide comment
@JRyven

JRyven Jan 22, 2013

Alright...

Maxrice, I'm trying to incorporate this script, but I don't know how to print_r(). I'm pretty new to PHP. print_r() is a SQL Query? What syntax do I need to use it?

JRyven commented Jan 22, 2013

Alright...

Maxrice, I'm trying to incorporate this script, but I don't know how to print_r(). I'm pretty new to PHP. print_r() is a SQL Query? What syntax do I need to use it?

@maxrice

This comment has been minimized.

Show comment
Hide comment
@maxrice

maxrice Jan 22, 2013

Contributor

@JRyven You'll want to put that code in your functions.php file -- it is PHP code 😄

Contributor

maxrice commented Jan 22, 2013

@JRyven You'll want to put that code in your functions.php file -- it is PHP code 😄

@JRyven

This comment has been minimized.

Show comment
Hide comment
@JRyven

JRyven Jan 22, 2013

Pardon my lacking skill...

I placed

function print_r($available_methods) {
}

in my childtheme's functions.php ... which, obviously to you, I am sure, broke the site.

Am I supposed to place that code in wocommerce-functions.php? or woocomerce-core-functions.php temporarily? How do I capture the output?

Thank you,
James

JRyven commented Jan 22, 2013

Pardon my lacking skill...

I placed

function print_r($available_methods) {
}

in my childtheme's functions.php ... which, obviously to you, I am sure, broke the site.

Am I supposed to place that code in wocommerce-functions.php? or woocomerce-core-functions.php temporarily? How do I capture the output?

Thank you,
James

@maxrice

This comment has been minimized.

Show comment
Hide comment
@maxrice

maxrice Jan 22, 2013

Contributor

Try this:

// Hide table rate shipping option when free shipping is available
add_filter( 'woocommerce_available_shipping_methods', 'hide_table_rate_shipping_when_free_is_available' );

/**
 *  Hide Table Rate shipping option when free shipping is available
 *
 * @param array $available_methods
 */
function hide_table_rate_shipping_when_free_is_available( $available_methods ) {

    echo "<pre>" . print_r( $available_methods, true ) . "</pre>";

    return $available_methods;
 }

This will show you the methods and then you can adapt the code earlier in this thread to remove whatever one you don't want

Contributor

maxrice commented Jan 22, 2013

Try this:

// Hide table rate shipping option when free shipping is available
add_filter( 'woocommerce_available_shipping_methods', 'hide_table_rate_shipping_when_free_is_available' );

/**
 *  Hide Table Rate shipping option when free shipping is available
 *
 * @param array $available_methods
 */
function hide_table_rate_shipping_when_free_is_available( $available_methods ) {

    echo "<pre>" . print_r( $available_methods, true ) . "</pre>";

    return $available_methods;
 }

This will show you the methods and then you can adapt the code earlier in this thread to remove whatever one you don't want

@danieldbird

This comment has been minimized.

Show comment
Hide comment
@danieldbird

danieldbird Jan 23, 2013

Unsubscribe.

Kind regards,

Daniel Bird.

On 23/01/2013, at 3:22 PM, JRyven notifications@github.com wrote:

My goal is to only offer handling_rate if it is available. It is set up so that it only appears if orders are over a certain amount.

And I tried this, which failed:

// Hide table rate shipping option when free shipping is available
add_filter( 'woocommerce_available_shipping_methods', 'hide_ups_when_handling_only_is_available' , 10, 1 );

/**

Hide Table Rate shipping option when free shipping is available *
@param array $available_methods
*/
function hide_ups_when_handling_only_is_available( $available_methods ) {

if( isset( $available_methods['handling_rate'] ) ) {

foreach( $available_methods as $method_id => $method ) {

// check if method starts with 'ups' and remove it
if ( ! strncmp( $method_id, 'ups_', 11 ) )
    unset( $available_methods[ $method_id ] );

}
}

return $available_methods;
}
?>

I output this (with the script you gave me, thank you for your support):

Array
(
[ups_03 - UPS Ground] => WC_Shipping_Rate Object
(
[id] => ups_03 - UPS Ground
[label] => UPS Ground
[cost] => 404.56
[taxes] => Array
(
)

)

[ups_12 - UPS Three-Day Select] => WC_Shipping_Rate Object
(
[id] => ups_12 - UPS Three-Day Select
[label] => UPS Three-Day Select
[cost] => 955.78
[taxes] => Array
(
)

)

[ups_02 - UPS Second Day Air] => WC_Shipping_Rate Object
(
[id] => ups_02 - UPS Second Day Air
[label] => UPS Second Day Air
[cost] => 1326.92
[taxes] => Array
(
)

)

[ups_59 - UPS Second Day Air A.M.] => WC_Shipping_Rate Object
(
[id] => ups_59 - UPS Second Day Air A.M.
[label] => UPS Second Day Air A.M.
[cost] => 1525.45
[taxes] => Array
(
)

)

[ups_13 - UPS Next Day Air Saver] => WC_Shipping_Rate Object
(
[id] => ups_13 - UPS Next Day Air Saver
[label] => UPS Next Day Air Saver
[cost] => 1952.27
[taxes] => Array
(
)

)

[ups_01 - UPS Next Day Air] => WC_Shipping_Rate Object
(
[id] => ups_01 - UPS Next Day Air
[label] => UPS Next Day Air
[cost] => 2321.27
[taxes] => Array
(
)

)

[ups_14 - UPS Next Day Air Early A.M.] => WC_Shipping_Rate Object
(
[id] => ups_14 - UPS Next Day Air Early A.M.
[label] => UPS Next Day Air Early A.M.
[cost] => 3286.97
[taxes] => Array
(
)

)

[handling_rate] => WC_Shipping_Rate Object
(
[id] => handling_rate
[label] => Handling Fee with Free Shipping
[cost] => 50
[taxes] => Array
(
)

)

)


Reply to this email directly or view it on GitHub.

danieldbird commented Jan 23, 2013

Unsubscribe.

Kind regards,

Daniel Bird.

On 23/01/2013, at 3:22 PM, JRyven notifications@github.com wrote:

My goal is to only offer handling_rate if it is available. It is set up so that it only appears if orders are over a certain amount.

And I tried this, which failed:

// Hide table rate shipping option when free shipping is available
add_filter( 'woocommerce_available_shipping_methods', 'hide_ups_when_handling_only_is_available' , 10, 1 );

/**

Hide Table Rate shipping option when free shipping is available *
@param array $available_methods
*/
function hide_ups_when_handling_only_is_available( $available_methods ) {

if( isset( $available_methods['handling_rate'] ) ) {

foreach( $available_methods as $method_id => $method ) {

// check if method starts with 'ups' and remove it
if ( ! strncmp( $method_id, 'ups_', 11 ) )
    unset( $available_methods[ $method_id ] );

}
}

return $available_methods;
}
?>

I output this (with the script you gave me, thank you for your support):

Array
(
[ups_03 - UPS Ground] => WC_Shipping_Rate Object
(
[id] => ups_03 - UPS Ground
[label] => UPS Ground
[cost] => 404.56
[taxes] => Array
(
)

)

[ups_12 - UPS Three-Day Select] => WC_Shipping_Rate Object
(
[id] => ups_12 - UPS Three-Day Select
[label] => UPS Three-Day Select
[cost] => 955.78
[taxes] => Array
(
)

)

[ups_02 - UPS Second Day Air] => WC_Shipping_Rate Object
(
[id] => ups_02 - UPS Second Day Air
[label] => UPS Second Day Air
[cost] => 1326.92
[taxes] => Array
(
)

)

[ups_59 - UPS Second Day Air A.M.] => WC_Shipping_Rate Object
(
[id] => ups_59 - UPS Second Day Air A.M.
[label] => UPS Second Day Air A.M.
[cost] => 1525.45
[taxes] => Array
(
)

)

[ups_13 - UPS Next Day Air Saver] => WC_Shipping_Rate Object
(
[id] => ups_13 - UPS Next Day Air Saver
[label] => UPS Next Day Air Saver
[cost] => 1952.27
[taxes] => Array
(
)

)

[ups_01 - UPS Next Day Air] => WC_Shipping_Rate Object
(
[id] => ups_01 - UPS Next Day Air
[label] => UPS Next Day Air
[cost] => 2321.27
[taxes] => Array
(
)

)

[ups_14 - UPS Next Day Air Early A.M.] => WC_Shipping_Rate Object
(
[id] => ups_14 - UPS Next Day Air Early A.M.
[label] => UPS Next Day Air Early A.M.
[cost] => 3286.97
[taxes] => Array
(
)

)

[handling_rate] => WC_Shipping_Rate Object
(
[id] => handling_rate
[label] => Handling Fee with Free Shipping
[cost] => 50
[taxes] => Array
(
)

)

)


Reply to this email directly or view it on GitHub.

@JRyven

This comment has been minimized.

Show comment
Hide comment
@JRyven

JRyven Jan 24, 2013

Got it

/* Hide ups when halding_rate is available  @param array $available_methods */
function hide_ups_when_handling_rate_is_available( $available_methods ) {
    if( isset( $available_methods['handling_rate'] ) ) {
         foreach( $available_methods as $method_id => $method ) {
            // check if method starts with 'ups' and remove it
            if ( ! strncmp( $method_id, 'ups', 3 ) )
                unset( $available_methods[ $method_id ] );
         }
    }   
    return $available_methods;
 }
?>

JRyven commented Jan 24, 2013

Got it

/* Hide ups when halding_rate is available  @param array $available_methods */
function hide_ups_when_handling_rate_is_available( $available_methods ) {
    if( isset( $available_methods['handling_rate'] ) ) {
         foreach( $available_methods as $method_id => $method ) {
            // check if method starts with 'ups' and remove it
            if ( ! strncmp( $method_id, 'ups', 3 ) )
                unset( $available_methods[ $method_id ] );
         }
    }   
    return $available_methods;
 }
?>
@webgalactica

This comment has been minimized.

Show comment
Hide comment
@webgalactica

webgalactica Apr 8, 2013

This is absurd! the guys from woo just complicated this on purpose so that people buy the table rate extension.
even if you add the php code then now its all free shipping. if you have one item for free shipping and one for payed the problem remains !!!

In that respect woo is like a gift that does not work ! and on top of it the price is not even proportional

webgalactica commented Apr 8, 2013

This is absurd! the guys from woo just complicated this on purpose so that people buy the table rate extension.
even if you add the php code then now its all free shipping. if you have one item for free shipping and one for payed the problem remains !!!

In that respect woo is like a gift that does not work ! and on top of it the price is not even proportional

@mikejolley

This comment has been minimized.

Show comment
Hide comment
@mikejolley

mikejolley Apr 8, 2013

Member

@webgalactica Core came before table rate shipping. Flat Rate/Free shipping methods are simple, and will remain simple. Some features of table rates (zones) may make it into core in a future release.

If you don't want to pay for table rate shipping from us, buy a method from someone else (codecanyon?) or build you own.

Member

mikejolley commented Apr 8, 2013

@webgalactica Core came before table rate shipping. Flat Rate/Free shipping methods are simple, and will remain simple. Some features of table rates (zones) may make it into core in a future release.

If you don't want to pay for table rate shipping from us, buy a method from someone else (codecanyon?) or build you own.

@beenuken

This comment has been minimized.

Show comment
Hide comment
@beenuken

beenuken Apr 25, 2013

Hello,
I am using 'Table Rate Shipping' and 'UPS Shipping' plugins, now what the requirement is that the UPS plugin should not show any result if 'Table Rate' plugin has a result for that particular Zip, say zero or some value.

beenuken commented Apr 25, 2013

Hello,
I am using 'Table Rate Shipping' and 'UPS Shipping' plugins, now what the requirement is that the UPS plugin should not show any result if 'Table Rate' plugin has a result for that particular Zip, say zero or some value.

@helencham

This comment has been minimized.

Show comment
Hide comment
@helencham

helencham May 31, 2013

Hi, i want to setup woocomerce to charge handling after the cost of shipping is included. Does anyone know how i can do that?

eg, product 1 is $99 + $5 shipping = $104 + 3% handling fee = $107.12 total.

currently woocommerce only charges handling based on the product, so it excludes the $5 ive set for shipping. Making the total incorrect.

Does anyone know where i shud be adding the code?

helencham commented May 31, 2013

Hi, i want to setup woocomerce to charge handling after the cost of shipping is included. Does anyone know how i can do that?

eg, product 1 is $99 + $5 shipping = $104 + 3% handling fee = $107.12 total.

currently woocommerce only charges handling based on the product, so it excludes the $5 ive set for shipping. Making the total incorrect.

Does anyone know where i shud be adding the code?

@danieldbird

This comment has been minimized.

Show comment
Hide comment
@danieldbird

danieldbird May 31, 2013

Why am I receiving email notifications about this? Please remove me from
this list.
Thank you.

Kind regards,

Daniel Bird.

On 31 May 2013 19:01, helencham notifications@github.com wrote:

Hi, i want to setup woocomerce to charge handling after the cost of
shipping is included. Does anyone know how i can do that?

eg, product 1 is $99 + $5 shipping = $104 + 3% handling fee = $107.12
total.

currently woocommerce only charges handling based on the product, so it
excludes the $5 ive set for shipping. Making the total incorrect.

Does anyone know where i shud be adding the code?


Reply to this email directly or view it on GitHubhttps://github.com//issues/1499#issuecomment-18726699
.

danieldbird commented May 31, 2013

Why am I receiving email notifications about this? Please remove me from
this list.
Thank you.

Kind regards,

Daniel Bird.

On 31 May 2013 19:01, helencham notifications@github.com wrote:

Hi, i want to setup woocomerce to charge handling after the cost of
shipping is included. Does anyone know how i can do that?

eg, product 1 is $99 + $5 shipping = $104 + 3% handling fee = $107.12
total.

currently woocommerce only charges handling based on the product, so it
excludes the $5 ive set for shipping. Making the total incorrect.

Does anyone know where i shud be adding the code?


Reply to this email directly or view it on GitHubhttps://github.com//issues/1499#issuecomment-18726699
.

@Choueiry

This comment has been minimized.

Show comment
Hide comment
@Choueiry

Choueiry Jan 22, 2014

Hello everyone! this seems to be what I am looking for.

I've added Another option for shipment called "Express" using the docs found at woocommerce (http://docs.woothemes.com/document/shipping-method-api/)

The Express delivery shows up, so it's all good. The problem is when I have international buyers it still shows up. Can I somehow make it only for ONE country?

Aslo regarding this free shipping - > Remove shipping method. I want the standard shipment to be removed (the express shipping should always be there). So can i use the snippet provided here? And where do I place it?

Choueiry commented Jan 22, 2014

Hello everyone! this seems to be what I am looking for.

I've added Another option for shipment called "Express" using the docs found at woocommerce (http://docs.woothemes.com/document/shipping-method-api/)

The Express delivery shows up, so it's all good. The problem is when I have international buyers it still shows up. Can I somehow make it only for ONE country?

Aslo regarding this free shipping - > Remove shipping method. I want the standard shipment to be removed (the express shipping should always be there). So can i use the snippet provided here? And where do I place it?

@zenimot

This comment has been minimized.

Show comment
Hide comment
@zenimot

zenimot Apr 25, 2014

How to add local pickup to the mix? What if the customer doesn't want the order to be shipped?
With above code it defaults to free shipping (which is nice), but the customer can't choose anymore.
How do I change the code to make this possible?

zenimot commented Apr 25, 2014

How to add local pickup to the mix? What if the customer doesn't want the order to be shipped?
With above code it defaults to free shipping (which is nice), but the customer can't choose anymore.
How do I change the code to make this possible?

@pipoulito

This comment has been minimized.

Show comment
Hide comment
@pipoulito

pipoulito Nov 26, 2014

Hi !

hi
i use woocomerce 2.112 so i tried these two different ways in my function.php but it nothing is called.
I need to hide my local_pickup options defined in my table rate plug setting if my contains a product with shipping class=="XX"
Please, I'm lost , thanks a lot

add_filter( 'woocommerce_package_rates', 'hide_shipping_when_free_is_available', 10, 2 );
function hide_shipping_when_free_is_available( $rates, $package ) {
mail('myemail', 'yo', $rates);
print_r($rates);
return $rates;
}

add_filter( 'woocommerce_available_shipping_methods','hide_table_rate_shipping_when_free_is_available' , 10, 1 );
function hide_table_rate_shipping_when_free_is_available( $available_methods ) {
mail('mymail', 'yo', $available_methods);
print_r($available_methods);
return $available_methods;
}

thanks

pipoulito commented Nov 26, 2014

Hi !

hi
i use woocomerce 2.112 so i tried these two different ways in my function.php but it nothing is called.
I need to hide my local_pickup options defined in my table rate plug setting if my contains a product with shipping class=="XX"
Please, I'm lost , thanks a lot

add_filter( 'woocommerce_package_rates', 'hide_shipping_when_free_is_available', 10, 2 );
function hide_shipping_when_free_is_available( $rates, $package ) {
mail('myemail', 'yo', $rates);
print_r($rates);
return $rates;
}

add_filter( 'woocommerce_available_shipping_methods','hide_table_rate_shipping_when_free_is_available' , 10, 1 );
function hide_table_rate_shipping_when_free_is_available( $available_methods ) {
mail('mymail', 'yo', $available_methods);
print_r($available_methods);
return $available_methods;
}

thanks

@lakhassane lakhassane referenced this issue Jul 11, 2017

Closed

Checkout button unavailable in cart page #16078

3 of 3 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment