New Landing How can we help? Atelier Hide Free Shipping on the Cart

Viewing 3 posts - 1 through 3 (of 3 total)
  • Posted in: Atelier
  • #312003
    juliensalanave
    Member
    Post count: 125

    Hello, guys! I am finding the solution on what I am trying to view on my cart page. Can you visit the site for what I am wanted to do? I running the codes via staging site before moving to production if it is good and working.

    HERE https://staging1.oree.co/product/board/

    Try to place order/s and view cart. I wanted that, placed order below $175 only Standard shipping and Express delivery will be display (like what is displaying now is good). And if the placed order is $175 and above, It only display’s Free shipping.

    The code that I’ve used is working well but I wanted that Express delivery will also be display and since It already defaults on free shipping on order/s above $175 and if the customer/s wants to have it deliver as Express delivery. I want also to display that button of Express delivery. Hope you can help me with this.

    Here is the code:

    /**
    * woocommerce_package_rates is a 2.1+ hook
    */
    add_filter( ‘woocommerce_package_rates’, ‘hide_shipping_when_free_is_available’, 10, 2 );

    /**
    * Hide shipping rates when free shipping is available
    *
    * @param array $rates Array of rates found for the package
    * @param array $package The package array/object being shipped
    * @return array of modified rates
    */
    function hide_shipping_when_free_is_available( $rates, $package ) {

    // Only modify rates if free_shipping is present
    if ( isset( $rates[‘free_shipping:5’] ) ) {

    // To unset a single rate/method, do the following. This example unsets flat_rate shipping
    unset( $rates[‘flat_rate:6’] );

    // To unset all methods except for free_shipping, do the following
    $free_shipping = $rates[‘free_shipping:5’];
    $rates = array();
    $rates[‘free_shipping:5’] = $free_shipping;
    }

    return $rates;
    }

    Best,

    Billy

    Attachments:
    You must be logged in to view attached files.
    #312019
    juliensalanave
    Member
    Post count: 125
    This reply has been marked as private.
    #312060
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    Unfortunately that kind of customisation is beyond our scope of support as it is more work than a small customisation. We only provide support for theme issues, and at times basic customisations.

    While we’d love to be able to support every customisation request, we simply don’t have the time.

    Hope you understand.

    -Rui

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.