Skip to content

ItemZone on product detail is not set correctly when chaning products via related/upsell products list #9562

Closed
@juhanix

Description

@juhanix

Preconditions

  1. Magento 2.1.5
  2. PHP7

Steps to reproduce

  1. change file vendor/magento/module-catalog/view/base/templates/product/price/final_price.phtml
    1.1. add echo $block->getZone(); on line 25 (or some other line, as you like)
  2. having Product A with Product B listed/marked as related or upsell.
    2.1. Product B also has Product A listed/marked as related or upsell product
  3. visiting Product A detail page
    3.1. main product: product A item_zone = "item_view"
    3.2. upsell/related product: product B item_zone = "item_list"
    3.3. everything is fine, this is how it should be
  4. visiting Product B detail page
    4.1. main product: product B item_zone = "item_list"
    4.2. upsell/related product: product A item_zone = "item_view"
    4.3. this is not how it should be
  5. clearing cache and now the other way around: visiting Product B detail page
    5.1. main product: product B item_zone = "item_view"
    5.2. upsell/related product: product A item_zone = "item_list"
    5.3. everything is fine, this is how it should be
    5.4. visiting Product A detail page and everything is wrong again

Expected result

  1. item_zone from the current product should always be "item_view" so the schema.org meta information for the price is set correctly

Actual result

  1. Already described in "steps to reproduce" section

UPDATE

so I checked if currently registered ProductID is the same productID as file vendor/magento/module-catalog/view/base/templates/product/price/final_price.phtml outouts in line 14
$this->_coreRegistry->registry('current_product'); gives me always the productID from the first product page I visit.
so I added following to vendor/magento/module-catalog/Pricing/Render/FinalPriceBox.php
public function getCacheLifetime() { return null; }
seems to work fine after this

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentbug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions