Hi Nicolas
So I am getting closer to what i want.
This is the code I have so far
echo '<span class="'.implode(' ',$classes).'">';
if(isset($price->price_min_quantity) && empty($this->cart_product_price) && $this->params->get('per_unit',1)){
if($price->price_min_quantity>1){
$minQties = array();
foreach($this->row->prices as $priceBis){
$minQties[] = $priceBis->price_min_quantity;
}
foreach($minQties as $key => $minQty){
if(isset($price->price_min_quantity) && empty($this->cart_product_price) && $this->params->get('per_unit',1)){
if($price->price_min_quantity == $minQty){
$key++;
echo sprintf('%s - %s = ',$price->price_min_quantity,$minQties[$key]);
}
}
}
}
}
if($this->params->get('price_with_tax')){
echo $this->currencyHelper->format(@$price->price_value_with_tax,$price->price_currency_id);
}
if($this->params->get('price_with_tax')==2){
echo JText::_('PRICE_BEFORE_TAX');
}
if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax')){
echo $this->currencyHelper->format(@$price->price_value,$price->price_currency_id);
}
if($this->params->get('price_with_tax')==2){
echo JText::_('PRICE_AFTER_TAX');
}
if($this->params->get('show_original_price') && !empty($price->price_orig_value)){
echo JText::_('PRICE_BEFORE_ORIG');
if($this->params->get('price_with_tax')){
echo $this->currencyHelper->format($price->price_orig_value_with_tax,$price->price_orig_currency_id);
}
if($this->params->get('price_with_tax')==2){
echo JText::_('PRICE_BEFORE_TAX');
}
if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax')){
echo $this->currencyHelper->format($price->price_orig_value,$price->price_orig_currency_id);
}
if($this->params->get('price_with_tax')==2){
echo JText::_('PRICE_AFTER_TAX');
}
echo JText::_('PRICE_AFTER_ORIG');
}
echo '</span> ';
if(isset($price->price_min_quantity) && empty($this->cart_product_price) && $this->params->get('per_unit',1)){
if($price->price_min_quantity>1){
echo '<span class="hikashop_product_price_per_unit_x">'.JText::sprintf('PER_UNIT').'</span>';
}else{
echo '<span class="hikashop_product_price_per_unit">'.JText::_('PER_UNIT').'</span>';
}
}
Which gives me:
$76.89 per unit incl. GST
4 - 50= $72.05 per unit incl. GST
50 - = $65.45 per unit incl. GST
I have been playing around with the code and looked in old forums but can't get it to say:
1-4 = $76.89 per unit incl. GST
4 - 50= $72.05 per unit incl. GST
50 + = $65.45 per unit incl. GST
The code I tried replaced a section with:
if(count($minQties) >= 1 && empty($this->cart_product_price) && $this->params->get('per_unit',1)){
if($price->price_min_quantity == 0){
$key++;
echo sprintf('%s - %s off = ','1',$minQties[$key]);
}
elseif($price->price_min_quantity == $minQty || $price->price_min_quantity == 0){
$key++;
echo sprintf('%s - %s off = ',$price->price_min_quantity,$minQties[$key]);
}else{
echo sprintf('%s + = ',$price->price_min_quantity);
}
}
But that gave me
$76.89 per unit Incl. GST
4 + = 4-50 off = 4 + = $72.05 per unit Incl. GST
50 + = 50 + = 50 - off $65.45 per unit Incl. GST
What am I doing wrong here?