cancel
Showing results for 
Search instead for 
Did you mean: 

expired sale price retained in customer cart

expired sale price retained in customer cart

Magento 2.4.1, CE 2.4.1

Persistent Shopping cart enabled, with default settings for all values (31536000 seconds, yes on remaining values)

 

Problem:

  1. customer logs in and puts sale item in cart, then goes away without checking out
  2. sale expires
  3. customer logs in after sale has expired, item in cart still has sale price

This is not good, I do not want the now-expired sale price reflected in the cart.

 

Can someone tell me how to fix this?

Thanks,

Evelyn

3 REPLIES 3

Re: expired sale price retained in customer cart

Hi @KnittyNoddy,

 

You can try reloading the customer cart on their login using the following way

 

You can do it using

Vendor/Module/etc/frontend/sections.xml

file.

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
    <action name="customer/account/loginPost">
        <section name="cart"/>
    </action>
    <action name="customer/ajax/login">
        <section name="cart"/>
    </action>
</config>

Hope this helps You!

Problem Solved! Click Kudos & Accept as Solution!

Re: expired sale price retained in customer cart

@Nishu Jindal 

(sorry but I'm a Magento newbie, and need a-b-c instructions for now)

So if I'm using the default, built-in, theme I should change the contents of file

vendor/magento/module-customer/etc/frontend/sections.xml

?

And just changing the file is enough, or do I have to run some cache clear, or recompile, or ?

 

Currently that file has:

<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
    <action name="customer/account/logout">
        <section name="*"/>
    </action>
    <action name="customer/account/loginPost">
        <section name="*"/>
    </action>
    <action name="customer/account/createPost">
        <section name="*"/>
    </action>
    <action name="customer/account/editPost">
        <section name="*"/>
    </action>
    <action name="customer/ajax/login">
        <section name="checkout-data"/>
        <section name="cart"/>
    </action>
</config>

and I should change it to:

<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
    <action name="customer/account/logout">
        <section name="*"/>
    </action>
    <action name="customer/account/loginPost">
        <section name="cart"/>
    </action>
    <action name="customer/account/createPost">
        <section name="*"/>
    </action>
    <action name="customer/account/editPost">
        <section name="*"/>
    </action>
    <action name="customer/ajax/login">
        <section name="cart"/>
    </action>
</config>

?

 

Thanks,

Evelyn

Re: expired sale price retained in customer cart

@Nishu Jindal 

No sorry your suggestion doesn't seem to work.

 

I'm still looking for some help.