Jump to content

button add in cart


Recommended Posts

I found this code and it works fine,

 

 

function Aggiungi_Carrello(){
            
			$.ajax({
            type: 'POST',
            headers: { "cache-control": "no-cache" },
            url: dir_base_path,
			async: true,
            cache: false,
            dataType: 'json',
                        //( (parseInt(idCombination) && idCombination != null) ? '&ipa=' + parseInt(idCombination): '')
                      
			data: 'controller=cart&add=1&qty=1&id_product=' + id_prodotto + '&token=' + static_token,
						
            success: function(jsonData)
            {
                
            }
        });
 }   

but now I have to refresh to cart
how can I do?
 

Link to comment
Share on other sites

I thank you for the answer

I'm finishing a module, when a customer chooses an attribute in a product, opens a popup window and populate another product related to the first, the customer will have to buy

 

I found the function ajaxCart.add .... and it works great, it added to the product and update the cart

function Aggiungi_al_Carrello(){
 
 	    ajaxCart.add( id_prodotto, null, true, null, '1', null);
		$('.layer_prod_desc_overlay').hide();
		$('#layer_prod_desc').fadeOut('fast');
 
 }

you know if there is a search function in the shopping cart?
I need first to see if there is already the same product added

 

ciao

Ilario

post-757615-0-01848600-1462261138_thumb.png

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...