how to list shipping options and costs without modifying the cart
I want to list the shipping options and costs for a product without adding it to the cart (like if the product were alone on the cart), also I don’t want the cart to be modified.
What I tried so far is:
To use new WC_Shipping and new WC_Cart, I’ve been reading api docs for like 1 hour and got nothing.
To use global $woocommerce->shipping and $woocommerce->cart, I managed to empty the cart, add my product and get what I wanted, but I can’t restore the cart, after a while of trying stuff from api docs I’m out of ideas with this one.
Any insight would be much appreciated, thank you.
- The topic ‘how to list shipping options and costs without modifying the cart’ is closed to new replies.