The main class is
woocommerce which is available globally via the
$woocommerce variable. This handles the main functions of SC Commerce and initializes other classes, stores site-wide variables, and handles error/success messages.
woocommerce class initializes the following classes when constructed:
Other classes are auto-loaded on demand.
SC Commerce has several product classes responsible for loading and outputting product data. This can be loaded through PHP using:
$product = wc_get_product( $post->ID );
In the loop this is not always necessary since calling the_post() will automatically populate the global $product variable if the post is a product.
The customer class allows you to get data about the current customer, for example:
global $woocommerce;<br></br> $customer_country = $woocommerce->customer->get_country();
The cart class loads and stores the users cart data in a session. For example, to get the cart subtotal you could use:
global $woocommerce;<br></br> $cart_subtotal = $woocommerce->cart->get_cart_subtotal();