how to add new product ( hidden list ) forr smartcart jquery pluguin?
<p>i am using smartcart 2 jquery pluguin on my application to handle session cart.
the user can create new product and add it to his cart. i use ajax call to save the product in my list .and then i need to refresh the list ( intial hidden products ).
the ajax responce is the saved id of the new product.
the problem is i can't add it to the cart ??
here is my script :</p>

<p>// This function place the new saved product (from user ) to the cart</p>

<pre><code>                    function addInventoryToCart(id)
                    {
                       $.ajax({
                            url: "{{ path('inventory_add_to_card') }}",
                            type: "POST",
                            data: "id="+id,
                            success: function(html) { 
                                    $("div.scCartList").append(html);                                 
                            }
                        });                    
                    }
</code></pre>

<p>// This function add a new hidden entry for the new product</p>

<pre><code>                    function refreshList(id)
                    {
                       $.ajax({
                            url: "{{ path('inventory_refresh_List') }}", 
                            type: "POST", 
                            data: "id="+id, 
                            success: function(html) {             
                                    if(html != '')
                                    {                                          
                                        $('.scTabs').before(html);

                                    } 
                            }
                        });                    
                    }
</code></pre>

<p>and</p>

<pre><code>        $(document).ready(function(){
                            $("#weight").forceNumeric();
                            $("#height").forceNumeric();
                            $("#depth").forceNumeric();

            // Call Smart Cart          
                            $('#SmartCart').smartCart(); 

                            $("#formNewProduct").submit(function () {
                                           $.ajax({
                                                url: "{{ path('inventory_save_temp') }}", 
                                                type: "POST", 
                                                data: $(this).serialize(), 
                                                success: function(html) { 
                                                    refreshList(html);
                                                    addInventoryToCart(html);
                                                    $('#SmartCart').populateProducts();
                                                }
                                            });

                                            $(".scMessageBar").hide();                                        
                                            return false;
                            });

        });
</code></pre>
