Added some WooCommerce logic. Needs review.