A
A
Andrew2017-06-22 12:05:28
PHP
Andrew, 2017-06-22 12:05:28

How to fix a bug with adding an item to the cart?

Magento 1.9
The essence of the problem is that when adding one product - it adds, when adding a second product without reloading the page - it is not added, and the page simply reloads.
I found the addAction method in the app\code\core\Mage\Checkout\controllers\CartController.php file, there is a check

if (!$this->_validateFormKey()) {
        $this->_goBack();
        return;
}

It is just on the second product and does not work.
I ask for help, I see magenta for the first time in my life and I have no idea what and where to do it right.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri Gerasimenko, 2017-06-26
@ntzch

Depending on how your product block is formed, the following options may help you
1. https://web-experiment.info/articles/Magento_1.8_f...
(should work for 1.9 too)
2. https:// web-experiment.info/articles/New_php_block/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question