Programatically update cart ( global / normal ) based on the product id and quantity…

Hi Team,

We have created a global search through AJAX.

Something like when you search any product, it will search in all the sites(Multisite) and show the products. For showing the product, I used the shortcode ‘[mp_product product_id=”‘.$post_id.'” title=”1″ content=”excerpt” meta=”1″]’.

It is showing the product properly. But when we click on the add to cart button of any product, it is not updating the cart in any of the site. Even if it is a global cart.

I checked the AJAX response, it is showing “0” in response. But I tried to use the button Short-code ( Add to Cart button by product id ). Even it has the same issue. Some where I found something like its because of the cookie issue.

So, I just want to know is there any custom hook to update the cart by inputting the product id and quantity.

Please reply back asap!!!