I've created a group product with two simple products.Each simple product has tier pricing.For example,
Simple product -1: tier pricing : Qty Price
2 100
3 75
5 60
Simple product -2: tier pricing: Qty Price
2 110
3 80
<?php if ($_hasAssociatedProducts): ?>
<?php foreach ($_associatedProducts as $_items): ?>
<?php $_items->setData('tier_price',null); ?>
<?php $_tierPrices = $this->getTierPrices($_items); ?>
<?php foreach ($_tierPrices as $key => $value): ?>
<th><?php echo $value['price_qty']; ?></th>
<?php endforeach; ?>
<?php endforeach; ?>
<?php endif; ?>
The above code returns all the qty 2 3 5 2 3
.How do I remove the repeated "qty" values and show only unique values?
array_unique()
function should do the trick. php.net/manual/en/function.array-unique.php . Alternativelyarray_count_values()
could be used. php.net/manual/en/function.array-count-values.php