Foxy Forum Status

We're no longer responding to questions via our forum, but we will keep it up for historical reasons. If you can't find the answer you're looking for, please visit our knowledge base or contact us. If there's enough interest in the future, we may bring the forum back.

Flat Rate Shipping Modification Snippet

SimonSimon Member

We are using the flat rate shipping snippet and it works great. Our only complication is that for international parcels over 2kg we need to ask our customers to get a quote from us. Our rates are volumetric and for the number of orders we receive it is just far easier to send the customer a quote page and they can select the service they would like.

I though I had found a good solution to this by using the FC.customFlatRates.error() function to popup a message to the customer asking them to submit their order and wait for a quote. Unfortunately it really does look like an error and appears twice (above the basket items and in the delivery area).

Is there another way to tell the customer that their order is over weight and needs a quote? I've tried just adding the message using the FC.customFlatRates.add() function but that needs a price and when I set it to zero it looks a bit odd alongside a message saying that they need a quote.

I don't know enough to unpick the code and find a way to just put a message up in place of a rate.


  • fc_romanfc_roman Member, FoxyCart Team
    Hi Simon,

    Thank you for describing the situation so thoroughly.

    Could you whisper the link to the site where this is happening?

  • fc_romanfc_roman Member, FoxyCart Team
    edited July 2016
    Simon, thank you for the link.

    What would you say to the following approach:
    • Keep using the FC.customFlatRates.error() function
    • Hide the upper message
    • Keep the lower one, while changing its color to a less alarming one
    This would require that you add the following CSS to your custom header before the closing </style>:
    /*This rule hides the upper message*/
    #fc [data-fc-id="block-cart-errors"] .fc-alert--danger{display:none!important}

    /* This rule changes the color of the lower one. */
    /* Replace the color value with what would match the site better */
    .fc-sidebar.fc-sidebar--cart .fc-alert--danger{background:steelblue!important;border:none!important}
  • SimonSimon Member

    That's great, I was probably over thinking it a little instead of just using the easiest way that you have outlined.

    Works for me, and is actually a nice way to throw up custom messages whenever needed.

  • fc_romanfc_roman Member, FoxyCart Team
    Perfect. Glad we could help!
    Let us know whenever you run into any issue.
  • SimonSimon Member
    I have run into a bug with the snippet today.

    When you set the auto select config option to true which automatically selects the first rate offered to the customers, it then prevents the FC.customFlatRates.error() function from displaying its message.

    If I switch the config back to false the function works as expected.

    It's set to true currently so you can see the error
  • fc_adamfc_adam FoxyCart Team

    Sorry about that - there is a small issue with the snippet related to errors. Even though it won't display it - with autoselect enabled, it expects a rate to be there. We have a new solution for the snippet coming soon which will replace it (and negate this issue) but for now you can simply add a rate along with the error and it should stop that issue.
  • SimonSimon Member
    Hi Adam,

    Good to know there is something in the pipeline that will make this issue redundant.

    We'll add a "Quote" rate of 0 for now.

Sign In or Register to comment.