Skip to content

Cart not updated if I click back button in browser #29484

@keylenjaimes

Description

@keylenjaimes

Prerequisites (mark completed items with an [x]):

Issue Description:
I have seen that the cart is not updated if the buyer click "back" in the browser button after checkout try. It is common that the customer uses the back button if we design no distractions checkout pages.

I tested several sites, I believed it was cache, however the issue also happen on clean installations of wordpress.

The scenario was happening with all plugins updated, 2021 theme, nothing else installed as plugin:

1.- Open the Shop, https://wordpress-464928-1837555.cloudwaysapps.com/shop/
2.- Then add a couple of products to the cart
3.- Click over "view cart"
4.- Remove any item from the cart
5.- Go to checkout page
6.- Go back with the browser's back button to the cart. The recently removed item appears.
7.- If you refresh the page, then the item got removed.

Regards,

KJ

Below the status report for Woocommerce:

`

WordPress Environment

WordPress address (URL): https://wordpress-464928-1837555.cloudwaysapps.com
Site address (URL): https://wordpress-464928-1837555.cloudwaysapps.com
WC Version: 5.1.0
REST API Version: ✔ 5.1.0
WC Blocks Version: ✔ 4.4.3
Action Scheduler Version: ✔ 3.1.6
WC Admin Version: ✔ 2.0.2
Log Directory Writable: ✔
WP Version: 5.7
WP Multisite: –
WP Memory Limit: 512 MB
WP Debug Mode: –
WP Cron: ✔
Language: en_US
External object cache: –

Server Environment

Server Info: Apache/2.4.25 (Debian)
PHP Version: 7.4.16
PHP Post Max Size: 50 MB
PHP Time Limit: 60
PHP Max Input Vars: 3000
cURL Version: 7.52.1
OpenSSL/1.0.2u

SUHOSIN Installed: –
MySQL Version: 5.5.5-10.4.18-MariaDB-1:10.4.18+maria~stretch-log
Max Upload Size: 50 MB
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ✔
DOMDocument: ✔
GZip: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔

Database

WC Database Version: 5.1.0
WC Database Prefix: wp_
Total Database Size: 3.93MB
Database Data Size: 2.44MB
Database Index Size: 1.49MB
wp_woocommerce_sessions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wp_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_actionscheduler_actions: Data: 0.02MB + Index: 0.11MB + Engine InnoDB
wp_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_actionscheduler_logs: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_comments: Data: 0.02MB + Index: 0.09MB + Engine InnoDB
wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_options: Data: 1.48MB + Index: 0.03MB + Engine InnoDB
wp_postmeta: Data: 0.11MB + Index: 0.06MB + Engine InnoDB
wp_posts: Data: 0.05MB + Index: 0.06MB + Engine InnoDB
wp_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_term_relationships: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_usermeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_wc_admin_notes: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wc_customer_lookup: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_order_product_lookup: Data: 0.02MB + Index: 0.11MB + Engine InnoDB
wp_wc_order_stats: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wp_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_product_meta_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB
wp_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB

Post Type Counts

attachment: 24
page: 6
post: 2
product: 18
product_variation: 7

Security

Secure connection (HTTPS): ✔
Hide errors from visitors: ✔

Active Plugins (1)

WooCommerce: by Automattic – 5.1.0

Inactive Plugins (0)

Settings

API Enabled: –
Force SSL: –
Currency: GBP (£)
Currency Position: left
Thousand Separator:
Decimal Separator: .
Number of Decimals: 0
Taxonomies: Product Types: external (external)
grouped (grouped)
simple (simple)
variable (variable)

Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
exclude-from-search (exclude-from-search)
featured (featured)
outofstock (outofstock)
rated-1 (rated-1)
rated-2 (rated-2)
rated-3 (rated-3)
rated-4 (rated-4)
rated-5 (rated-5)

Connected to WooCommerce.com: –

WC Pages

Shop base: #6 - /index.php/shop/
Cart: #7 - /index.php/cart/
Checkout: #8 - /index.php/checkout/
My account: #9 - /index.php/my-account/
Terms and conditions: ❌ Page not set

Theme

Name: Twenty Twenty-One
Version: 1.2
Author URL: https://wordpress.org/
Child Theme: ❌ – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme
WooCommerce Support: ✔

Templates

Overrides: –

Action Scheduler

Complete: 3
Oldest: 2021-03-24 18:19:55 +0000
Newest: 2021-03-24 18:23:43 +0000

Pending: 2
Oldest: 2021-03-24 18:23:44 +0000
Newest: 2021-03-24 18:23:44 +0000

Status report information

Generated at: 2021-03-24 18:24:33 +00:00
`

Metadata

Metadata

Assignees

Labels

BugThe issue is a confirmed bug.CartIssues related to the cart.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions