Skip to content

[BUG] [COMPOSABLES] isListPrice calculation is wrong #2311

@bylmzio

Description

i came across this isListPrice computed property while i was implementing discounts.

Listprice from my understanding should be true if there is no discount.
This means either listprice is not set or if lets say if listprice equals unitprice then percentage is 0
Bug lies here:

packages/composables/src/useProductPrice/useProductPrice.ts

  const isListPrice: ComputedRef<boolean> = computed(() => {
    return !!_price.value?.listPrice?.percentage;
  });

My suggested bugfix would be.

  const isListPrice: ComputedRef<boolean> = computed(() => {
    return !_price.value?.listPrice?.percentage;
  });

But this opens alot of questions for the currents tests.

Metadata

Metadata

Labels

No labels
No labels

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions