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:
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
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!
(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