Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if product has tier pricing

Tags:

php

magento

I am not that knowledgable with the Magento API yet, so I don't know where to search. I found in the docs getTierPriceHtml($product) but that doesn't really help me.

So, is there a function that I can call on my $product object (in a template) and check if the product has tier pricing? If there is no a direct function in existence, then a short workaround will also be helpful.

I tried if (getTierPriceHtml($product) != null).... but that didn't work and is quite an ugly approach anyway.

like image 332
Syspect Avatar asked Dec 09 '25 23:12

Syspect


1 Answers

Try it with $product->getTierPrices(). If that returns an empty array it means that it doesn't have any tier prices at all.

like image 134
Marius Avatar answered Dec 12 '25 13:12

Marius



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!