public static function cc_product_via_api($args, $content)
 {
     $form = '';
     if ($error_message = CC_Flash_Data::get('api_error')) {
         $form .= "<p class=\"cc_error\">{$error_message}</p>";
     }
     $product_id = isset($args['id']) ? $args['id'] : false;
     $product_sku = isset($args['sku']) ? $args['sku'] : false;
     $display_quantity = isset($args['quantity']) ? $args['quantity'] : 'true';
     $display_price = isset($args['price']) ? $args['price'] : 'true';
     $display_mode = isset($args['display']) ? $args['display'] : null;
     if ($form_with_errors = CC_Flash_Data::get($product_sku)) {
         $form .= $form_with_errors;
     } else {
         $product = new CC_Product();
         if ($product_sku) {
             $product->sku = $product_sku;
         } elseif ($product_id) {
             $product->id = $product_id;
         } else {
             throw new CC_Exception_Product('Unable to add product to cart without know the product sku or id');
         }
         try {
             $form .= $product->get_order_form($display_quantity, $display_price, $display_mode);
         } catch (CC_Exception_Product $e) {
             $form = "Product order form unavailable";
             CC_Log::write('Failed to get product order form: ' . $e->getMessage());
         }
     }
     return $form;
 }