Last active
February 18, 2017 14:13
-
-
Save nielslange/fb9799f37927fbd655e5d444353afec7 to your computer and use it in GitHub Desktop.
Access WC variables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//* Get global WC object | |
global $woocommerce; | |
//* Access various WooCommerce cart variables, see also https://docs.woothemes.com/wc-apidocs/class-WC_Cart.html | |
$woocommerce->cart->get_cart_subtotal(); | |
$woocommerce->cart->get_cart_tax(); | |
$woocommerce->cart->get_cart_total(); | |
//* Access various WooCommerce customer variables, see also @see https://docs.woothemes.com/wc-apidocs/class-WC_Customer.html | |
$woocommerce->customer->get_country(); | |
$woocommerce->customer->get_default_country(); | |
$woocommerce->customer->get_shipping_country(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment