How to change pricing bulk discount display?
13 years 4 months ago - 13 years 4 months ago #102679
by Xavier
Replied by Xavier on topic How to change pricing bulk discount display?
Hi,
You will need something like:
To get all the possible quantities, and display the interval.
You will need something like:
Code:
$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 off = ',$price->price_min_quantity,$minQties[$key]);
}
}
}
Last edit: 13 years 4 months ago by Xavier.
The following user(s) said Thank You: lcoombes
Please Log in or Create an account to join the conversation.
13 years 4 months ago #102843
by lcoombes
Replied by lcoombes on topic How to change pricing bulk discount display?
Hi Xavier
This was very helpful. I've changed the code as you suggested, just a couple of little problems. The result I have is in this format:
£ 168.00 ea
3 - 6 off = £ 160.00
6 - 10 off = £ 150.00
10 - off = £ 140.00
Can you advise how to get the first line of prices to say:
1 - 2 off = £ 168.00
And the last line of prices to say
10 + = £ 140.00
Many thanks - Leo
This is the code so far...
This was very helpful. I've changed the code as you suggested, just a couple of little problems. The result I have is in this format:
£ 168.00 ea
3 - 6 off = £ 160.00
6 - 10 off = £ 150.00
10 - off = £ 140.00
Can you advise how to get the first line of prices to say:
1 - 2 off = £ 168.00
And the last line of prices to say
10 + = £ 140.00
Many thanks - Leo
This is the code so far...
Code:
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 off = ',$price->price_min_quantity,$minQties[$key]);
}
}
}
The following user(s) said Thank You: Jerome
Please Log in or Create an account to join the conversation.
13 years 4 months ago #105613
by lcoombes
Replied by lcoombes on topic How to change pricing bulk discount display?
Hi Xavier
Can you advise how to get the first line of prices to say:
1 - 2 off = £ 168.00
And the last line of prices to say
10 + = £ 140.00
Many thanks - Leo
Can you advise how to get the first line of prices to say:
1 - 2 off = £ 168.00
And the last line of prices to say
10 + = £ 140.00
Many thanks - Leo
Please Log in or Create an account to join the conversation.
13 years 4 months ago #105638
by Xavier
Replied by Xavier on topic How to change pricing bulk discount display?
Hi,
You can replace:
By:
You can replace:
Code:
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 off = ',$price->price_min_quantity,$minQties[$key]);
}
}
Code:
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);
}
}
Please Log in or Create an account to join the conversation.
13 years 4 months ago #105641
by lcoombes
Replied by lcoombes on topic How to change pricing bulk discount display?
Thanks Xavier, I've pasted in your code, but this is what I get:
£ 168.00 ea
3 + = 3 - 6 off = 3 + = 3 + = 3 + = £ 160.00
6 + = 6 + = 6 - 10 off = 6 + = 6 + = £ 150.00
10 + = 10 + = 10 + = 10 - 26 off = 10 + = £ 140.00
26 + = 26 + = 26 + = 26 + = 26 - off = £ 130.00
Can you troubleshoot this?
Many thanks - Leo
£ 168.00 ea
3 + = 3 - 6 off = 3 + = 3 + = 3 + = £ 160.00
6 + = 6 + = 6 - 10 off = 6 + = 6 + = £ 150.00
10 + = 10 + = 10 + = 10 - 26 off = 10 + = £ 140.00
26 + = 26 + = 26 + = 26 + = 26 - off = £ 130.00
Can you troubleshoot this?
Many thanks - Leo
Please Log in or Create an account to join the conversation.
13 years 4 months ago #105811
by nicolas
Replied by nicolas on topic How to change pricing bulk discount display?
I'm sorry but we're way off normal support here. We're already provided you a lot of code modifications without asking for anything but these modifications start to get out of hand and it's not anymore one or two lines of code to add...
If you want custom coding like these please use our contact form to request a quote on the job :
www.hikashop.com/en/contact-us.html
If you want custom coding like these please use our contact form to request a quote on the job :
www.hikashop.com/en/contact-us.html
Please Log in or Create an account to join the conversation.
13 years 4 months ago #105880
by lcoombes
Replied by lcoombes on topic How to change pricing bulk discount display?
OK - thanks for letting me know Nicolas. I actually thought it would be an easy change, but I can see it's a lot more complicated than I though.
Please Log in or Create an account to join the conversation.
Time to create page: 0.247 seconds