Skip to content

getLastViewedUrl() doesn't work with caches enabled #6047

Closed
@alexander-kozlyuk-ism

Description

@alexander-kozlyuk-ism

Unable to retrieve last viewed URL using getLastViewedUrl() method (vendor/magento/module-catalog/Helper/Data.php)

Preconditions

  1. Magento CE 2.1.0 without sample data is installed.
  2. Custom plugin created for \Magento\Checkout\Block\Cart > getContinueShoppingUrl()
  3. getLastViewedUrl() used in this plugin to improve "Continue Shopping URL" functionality
    selection_018

Steps to reproduce

  1. Enable caches
  2. Add something to cart
  3. Visit some product page
  4. Refresh cart page
  5. Check "Continue Shopping" URL

Actual result

"Continue Shopping" URL leads to homepage

Expected result

"Continue Shopping" URL should lead to the last visited product page

Note

it works fine if caches disabled

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions