All 17 Free Shipping Bar sections

See every section

For developers

Updated Free Shipping Bar 1.12.0Tested with WordPress 7.1

  • trfs_threshold filters the amount that unlocks free shipping. It is passed the amount and its source, auto (WooCommerce's Free shipping method) or fixed (the amount typed on the Setup screen). A typed amount has already been converted by the currency switchers listed above.
  • trfs_goal filters the shopper's progress before anything is drawn from it: an array with available, state, goal, total, remaining, percent and items. A cart whose delivery is already free by a rate is in the success state with via set to rate.
  • trfs_free_rate decides whether a delivery rate that costs nothing makes shipping free. It is passed true, the WC_Shipping_Rate and its package; return false for a method that shows 0 when its price is not known yet.
  • trfs_purge_caches fires when the plugin empties page caches, for a cache it does not know how to ask.
  • A bar pinned to the bottom of the screen sets --trasl-bottom-inset on the page's root element to its height. Add it to the bottom offset of anything else fixed to the bottom corners, as calc(24px + var(--trasl-bottom-inset, 0px)), and the two will not overlap.
  • A bar at the top that floats or follows the screen sets --trasl-top-inset the same way, to all that is held at the top: the admin bar for anyone signed in, the bar itself and a cookie banner at the top. Add it to the top offset of anything fixed to the top of the screen.
  • While such a bar shows, the page's root element (<html>) carries a class for its edge: trasl-top-trfs at the top and trasl-bar-trfs at the foot, with trfs-room-top or trasl-room-trfs as well when it floats over the page and keeps that much room free. They are set before the bar is first drawn and follow it when it is closed, refreshed or brought back, so a stylesheet can use them instead of asking the whole page with :has().

Still stuck? Ask the developers who wrote it. We aim to reply within one business day.