• I am looking for a way to output the table rates to the front end so the admin doesn’t have to change the shipping rates in 2 places.

    So far i’ve found

    $delivery_zones = WC_Shipping_Zones::get_zones();
     foreach ($delivery_zones as $key => $the_zone ) {
        echo "<pre>";
        print_r($the_zone);
        echo "</pre>";
      }

    which gets the zone name, but doesn’t retrieve the actual rates. I have a zone for U.S. and a zone for Canada, and would like them both to display.

    Any suggestions by chance?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author merlinmonmouth

    (@merlinmonmouth)

    So you want to programatically walk through the rates and show them on the page – have I got that right???

    Thread Starter kyjus25

    (@kyjus25)

    Yes, that is correct!

    Currently I’ve just reproduced the fields in ACF, but it would be much better to have that shipping page automatically grab the rates dynamically so the admin doesn’t need to change the rates in 2 places.

    Hopefully this is do-able. I couldn’t even figure out how to do it with native WooCommerce rate options. All I could find were ways to use the cart data, but I’d like this page to show both United States and Canada, regardless of the cart.

    Thanks for your help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Output shipping tables programatically’ is closed to new replies.