{"action":"created","issue":{"url":"https://api.github.com/repos/gaiterjones/magento-buy-x-get-y-free/issues/9","labels_url":"https://api.github.com/repos/gaiterjones/magento-buy-x-get-y-free/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/gaiterjones/magento-buy-x-get-y-free/issues/9/comments","events_url":"https://api.github.com/repos/gaiterjones/magento-buy-x-get-y-free/issues/9/events","html_url":"https://github.com/gaiterjones/magento-buy-x-get-y-free/issues/9","id":121182664,"number":9,"title":"On first Visit of Cart free gift is not added.","user":{"login":"GFEMajor","id":2239440,"avatar_url":"https://avatars.githubusercontent.com/u/2239440?v=3","gravatar_id":"","url":"https://api.github.com/users/GFEMajor","html_url":"https://github.com/GFEMajor","followers_url":"https://api.github.com/users/GFEMajor/followers","following_url":"https://api.github.com/users/GFEMajor/following{/other_user}","gists_url":"https://api.github.com/users/GFEMajor/gists{/gist_id}","starred_url":"https://api.github.com/users/GFEMajor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GFEMajor/subscriptions","organizations_url":"https://api.github.com/users/GFEMajor/orgs","repos_url":"https://api.github.com/users/GFEMajor/repos","events_url":"https://api.github.com/users/GFEMajor/events{/privacy}","received_events_url":"https://api.github.com/users/GFEMajor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-09T07:57:41Z","updated_at":"2015-12-09T08:43:04Z","closed_at":null,"body":"We set up a rule \"Spend 60€ and get a free product\" on Magento 1.9.2.1.\r\nBut if someone puts products in the cart for more than 60€, and visit the cart (he is not rediected automatically, but he has to visit the cart before checking out), the product is not added.\r\nIf we simply reload the page, everything is fine and the product is added.\r\nAlso, after that, if we delete all products from the cart, and put something back in it, the free product is added on the first visit of the cart.\r\n\r\nIf we delete all browser data, the game begins again, on first visit of the cart, the free product is not added."},"comment":{"url":"https://api.github.com/repos/gaiterjones/magento-buy-x-get-y-free/issues/comments/163151490","html_url":"https://github.com/gaiterjones/magento-buy-x-get-y-free/issues/9#issuecomment-163151490","issue_url":"https://api.github.com/repos/gaiterjones/magento-buy-x-get-y-free/issues/9","id":163151490,"user":{"login":"GFEMajor","id":2239440,"avatar_url":"https://avatars.githubusercontent.com/u/2239440?v=3","gravatar_id":"","url":"https://api.github.com/users/GFEMajor","html_url":"https://github.com/GFEMajor","followers_url":"https://api.github.com/users/GFEMajor/followers","following_url":"https://api.github.com/users/GFEMajor/following{/other_user}","gists_url":"https://api.github.com/users/GFEMajor/gists{/gist_id}","starred_url":"https://api.github.com/users/GFEMajor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GFEMajor/subscriptions","organizations_url":"https://api.github.com/users/GFEMajor/orgs","repos_url":"https://api.github.com/users/GFEMajor/repos","events_url":"https://api.github.com/users/GFEMajor/events{/privacy}","received_events_url":"https://api.github.com/users/GFEMajor/received_events","type":"User","site_admin":false},"created_at":"2015-12-09T08:43:04Z","updated_at":"2015-12-09T08:43:04Z","body":"I found something. On the first call of the CartController (your controller, not the one from Magento), it seams that the totals are not generated, because\r\n$subtotal = $totals['subtotal']->getValue();\r\nreturns a 0."}}