soir Posted December 27, 2013 Share Posted December 27, 2013 Hey! I am new to PrestaShop, I have developed a custom module and I have a problem. When choosing a product to add to cart is added only if logged on, I think it's a problem with the cookie. My code to add a producto to cart: $context=Context::getContext(); //new Cart(); $id_cart=$context->cookie->__get('id_cart'); if (count($_POST["service"])>0){ $cart=new Cart($id_cart); $cart->id_currency=2; $cart->id_lang=1; foreach($_POST["service"] as $variable_get_services) { $site_get_services = $variable_get_services; $site_get_services = str_replace("service-", "", $site_get_services); if (($site_get_services == "0") || ($site_get_services == "")) {} else { $cart->updateQty(1, $site_get_services); } } } Thnx! Link to comment Share on other sites More sharing options...
soir Posted January 7, 2014 Author Share Posted January 7, 2014 Up? Link to comment Share on other sites More sharing options...
Violet Posted January 8, 2014 Share Posted January 8, 2014 i think is ur proxy setting i had this problem before also Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now