# Compare Variants prices

**URL:** <https://forum.oxid-esales.com/t/compare-variants-prices/95687>\
**Category:** English forums\
**Tags:** dev-talk\
**Created:** [September 10, 2019, 1:55pm UTC](https://forum.oxid-esales.com/t/compare-variants-prices/95687 "2019-09-10T13:55:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Triology](https://forum.oxid-esales.com/user_avatar/forum.oxid-esales.com/triology/32/1261_2.png) [@Triology](https://forum.oxid-esales.com/u/Triology)\
**Post date:** [September 10, 2019, 1:55pm UTC](https://forum.oxid-esales.com/t/compare-variants-prices/95687/1 "2019-09-10T13:55:00Z")

</div>

Is there are a way to get all the product variant prices for the current product?I need to compare the prices and if I have different prices to display Price From(price).  
Anyone can give me a hint?

I’m working on oxid 4.6.1, i saw that in 4.9 oxid we have getVarMinPrice and getVarMaxprice…

---

<div class="post-metadata">

**Author:** ![Triology](https://forum.oxid-esales.com/user_avatar/forum.oxid-esales.com/triology/32/1261_2.png) [@Triology](https://forum.oxid-esales.com/u/Triology)\
**Post date:** [September 12, 2019, 12:39pm UTC](https://forum.oxid-esales.com/t/compare-variants-prices/95687/2 "2019-09-12T12:39:22Z")

</div>

Problem has been solved, i used the getVariants() function to take all the variants attributes and took the oxarticles\_\_oxprice values from all variants, place them all in one array, used the min and max functions to find the smallest and the biggest number(price) from all variants placed them in array that i’m using to check if we have two different values in the array then we can display Your Price From, if we have the same value then Your Price.

---

<div class="post-metadata">

**Author:** ![system](https://forum.oxid-esales.com/user_avatar/forum.oxid-esales.com/system/32/4245_2.png) [@system](https://forum.oxid-esales.com/u/system)\
**Post date:** [September 11, 2020, 12:39pm UTC](https://forum.oxid-esales.com/t/compare-variants-prices/95687/3 "2020-09-11T12:39:22Z")

</div>

Closed on September 11, 2020, 12:39pm UTC

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
