Shipping Question: How to fake TBD

sparkwebsparkweb Member, Integration Developer, FoxyShop, Order Desk
in General edited February 2012
So kind of an odd question here for the inestimable @fc_adam: I'm working on a custom post code app only for use in Australia. It is adding a certain % to the flat-rate shipping depending on the post code entered (each post code gets assigned one of 16 zones and each zone has a % that is added to the flat rate). It's working fine, except when the checkout first loads, the shipping shows the base shipping price and then when the customer enters their postcode the shipping amount adjusts to the higher adjusted value, potentially causing confusion and irritation on the part of the customer. So how can I fake the TBD? Is it just a matter of setting
FC.checkout.config.orderFlatRateShipping = 0
and using jQuery to set the shipping values to "TBD" or is there a better more appropriate way? Because with my hack they might still see a FOUC FOLP (that's Flash of Lower Price).
  • fc_adamfc_adam FoxyCart Team
    @sparkweb, can you link me to your checkout?
  • fc_adamfc_adam FoxyCart Team

    Nice approach with the zones, I really like that.

    In terms of the TBD, I'd take the same approach that we already do with the live rates TBD and the taxes TBD. Essentially insert a new table row after the shipping tr#fc_cart_foot_shipping called tr#fc_cart_foot_shipping_tbd, and also hide the current #fc_cart_foot_shipping row. Then when you've done your calculations, hide your TBD row and show the actual row.

    That way, the TBD doesn't get updated before your calculations have run for sure, and you decide when it's ready.

    Worth noting, in the updatePrice() function in checkout.js, it hides #fc_cart_foot_shipping_tbd and shows the shipping total row. That might be ok, but you'll want to test and if it interferes you'll want to change the id to something else. Or just do that from the start :)
  • sparkwebsparkweb Member, Integration Developer, FoxyShop, Order Desk
    edited February 2012
    Oh good idea! I'll give that a shot. Thanks for taking a look.
Sign In or Register to comment.