Woo-commerce functionality with variation products


Woo-commerce functionality with variation products
/* Set woo-commerce session */
WC()->session->set( ‘gift_user’, “data” );

/* Get woo-commerce session */
WC()->session->get( ‘gift_user’);

/* Store variation using variation ID */
$variation = array(‘attribute_variation’ => $color);

/* Empty Woo-Commerce cart */
WC()->cart->empty_cart();

/*Get Woo-commerce price*/
$_product = wc_get_product( $product_id );

$_product->get_regular_price();
$_product->get_sale_price();
$_product->get_price();

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s