Skip to content

Wishlist: product with price 0 will break "My wishlist"  #21949

Closed
@jakwinkler

Description

@jakwinkler

Preconditions (*)

  1. Magento 2.2.7

Steps to reproduce (*)

  1. Create a simple product with price = 0
  2. Create user account on frontend
  3. Add created product to wishlist
  4. Visit My Wishlist page

Expected result (*)

  1. Wishlist page visible without any issues

Actual result (*)

  1. Broken styling
  2. Error in server files: "PHP Fatal error: Uncaught TypeError: Argument 1 passed to Magento\\Catalog\\Pricing\\Price\\ConfiguredOptions::getItemOptionsValue() must be of the type float, boolean given"

The problem is this file vendor/magento/module-catalog/Pricing/Price/RegularPrice.php in getValue method

It should return 0, not false, because this class vendor/magento/module-catalog/Pricing/Price/ConfiguredOptions.php

requires FLOAT parameter, not BOOLEAN
public function getItemOptionsValue(float $basePrice, ItemInterface $item): float

Simple and easy to fix :-)

Metadata

Metadata

Assignees

Labels

Issue: Format is validGate 1 Passed. Automatic verification of issue format passed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions