Adding custom designed product to cart in drupal commerce
I think you can done it using commerce_cart_product_add(). Pass product id and line item as parameters. For details please check here.Hope this will help you..