Skip to content

Wrong price amount in opengraph #20010

Closed
@jcourtei

Description

@jcourtei

Preconditions (*)

Version 2.2.6 (Community Edition).

Steps to reproduce (*)

  1. Several store views with several currency rates.
  2. View source code of a simple product in a store view with a currency (USD) different from the base currency (EUR).

Expected result (*)

Meta tag "product:price:amount" should contain the price converted in USD.

Actual result (*)

Meta tag "product:price:amount" contains the price in EUR.
Meta tag "product:price:currency" on the other hand is correct (USD).

In module-catalog/view/frontend/templates/product/view/opengraph/general.phtml the following line is wrong :
<?php if ($priceAmount = $block->getProduct()->getFinalPrice()):?>
It should be :
<?php if ($priceAmount = $block->getProduct()->getPriceInfo()->getPrice('final_price')->getValue()):?>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: CatalogFixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentProgress: PR CreatedIndicates that Pull Request has been created to fix issueReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions