cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 1.9.2.3 : After successful Payment "Shopping Cart is Empty" Error

SOLVED

Re: Magento 1.9.2.3 : After successful Payment "Shopping Cart is Empty" Error

Hi @Aveeva 

 

Replace the code below  in line no. 41 in app/code/core/Mage/Core/Model/Cookie.php

 

const SAMESITE = ';samesite=None; Secure';

 

Replace  the code below in line no. 37  in app/design/frontend/base/default/template/page/js/cookie.phtml 

 

Mage.Cookies.path = '<?php echo Mage::helper('core')->jsQuoteEscape($this->getPath()) ?>;samesite=None; Secure';


I think that is enough for samesite cookie. No need to do more amendments in the other file if you did not enable page cache.

 

If the issue is because of samesite cookie attribute then the issue should be fixed with this changes.

 

Hope this helps you!
Problem Solved! Click Kudos & Accept as Solution!

Re: Magento 1.9.2.3 : After successful Payment "Shopping Cart is Empty" Error

@Madhu Rajawat  What about cookie.php line 239 : 

 

setcookie($name, $value, $expire, $path.self::SAMESITE, $domain, $secure, $httponly);

Shall i revert or go with this?

Re: Magento 1.9.2.3 : After successful Payment "Shopping Cart is Empty" Error

@Aveeva  Keep this code same

 

setcookie($name, $value, $expire, $path.self::SAMESITE, $domain, $secure, $httponly);
Hope this helps you!
Problem Solved! Click Kudos & Accept as Solution!

Re: Magento 1.9.2.3 : After successful Payment "Shopping Cart is Empty" Error

@Madhu Rajawat  Really thank you for your effort,  may i know the causes of error.

Re: Magento 1.9.2.3 : After successful Payment "Shopping Cart is Empty" Error

@Aveeva 

 

Samesite attribute cookie  is a chrome 80 feature

 

For more samesite cookie information you can go through the below URL:

 

https://web.dev/samesite-cookies-explained/

Hope this helps you!
Problem Solved! Click Kudos & Accept as Solution!

Re: Magento 1.9.2.3 : After successful Payment "Shopping Cart is Empty" Error

@Madhu Rajawat  May i know how did you know this is the error, i can't able to view any log error in magento, what is the way how to debug this issue, are you using any debug process to find this kind of error because the last 4 years working good, suddenly issue, How to know this kind of issue my own self?

Re: Magento 1.9.2.3 : After successful Payment "Shopping Cart is Empty" Error

Hi @Aveeva 

 

I have done lots of debugging and read all about related to samesite cookie Crome 80 feature.

You should do more debugging and read about all the latest updates related to Magento and apply the same on the website. If you see in the console the error shows related to samesite.  You can't achieve the solution until you will not debugging step by step and with the latest updates.

Hope this helps you!
Problem Solved! Click Kudos & Accept as Solution!

Re: Magento 1.9.2.3 : After successful Payment "Shopping Cart is Empty" Error

@Madhu Rajawat  Thank You .

Re: Magento 1.9.2.3 : After successful Payment "Shopping Cart is Empty" Error

@Madhu Rajawat Sorry to keep posting doubts, i am just learning to Magento 2.3.4.

My question:

If i click filter i am getting Undefined Offset Error

 

URL : https://test.giri.in

 

Error Screenshot :

 

1) https://snipboard.io/2o7nyV.jpg

2) https://i.stack.imgur.com/IIYET.png

Re: Magento 1.9.2.3 : After successful Payment "Shopping Cart is Empty" Error

Hello,

I have the same problem.

The customers buying products but the shopping list is empty. I did the changes that you said and restart the Apache service but problem not solved.

My changes are:

class Mage_Core_Model_Cookie
{
const XML_PATH_COOKIE_DOMAIN = 'web/cookie/cookie_domain';
const XML_PATH_COOKIE_PATH = 'web/cookie/cookie_path';
const XML_PATH_COOKIE_LIFETIME = 'web/cookie/cookie_lifetime';
const XML_PATH_COOKIE_HTTPONLY = 'web/cookie/cookie_httponly';
const SAMESITE = ';samesite=None; Secure';

protected $_lifetime;

/**
* Store object
*
* @var Mage_Core_Model_Store
*/
protected $_store;
...

And:

<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magento.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magento.com for more information.
*
* @category design
* @package base_default
* @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
?>
<?php
/**
* Cookie settings initialization script
*
* @see Mage_Page_Block_Js_Cookie
*/
?>

<script type="text/javascript">
//<![CDATA[
Mage.Cookies.path = '<?php echo Mage::helper('core')->jsQuoteEscape($this->getPath()) ?>;samesite=None; Secure';
Mage.Cookies.domain = '<?php echo Mage::helper('core')->jsQuoteEscape($this->getDomain()) ?>';
//]]>
</script>

What is my mistake?

 

Thank you.