1

I use Magento 1.9 and now i have problem with adding item to cart, when i press button Add to cart, just refresh page and in cart nothing, i added in Session Cookie Management -> Cookie Lifetime = 86400, but nothing, early all working good with my site. Can you help solve problem?

  • Sounds like the formkey block isn't being rendered or the form key isn't being sent. The form key is a protection for your site and form posts without it will not accept the request and redirect you. – Brett Mar 26 '17 at 21:03
  • ok, where i can add this points? in addtocart.phtm? – Lerry Mar 26 '17 at 21:05
  • Yes. Typically it's the line directly following the <form> tag in most other Magento forms. – Brett Mar 26 '17 at 21:06
  • i added <?php $formKey = Mage::getSingleton('core/session')->getFormKey();?> and in <form> added hidden input: <input type="hidden" name="form_key" value="<?php echo $formKey; ?>" /> - but products can not add to cart – Lerry Mar 26 '17 at 21:42
  • The formkey is a block that you should be able to just do <?php echo $this->getChildHtml('formkey'); ?> to get the full input. – Brett Mar 26 '17 at 21:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.