Skip to main content

Volume Price Range

More
13 years 11 months ago #78084 by sambob
Volume Price Range was created by sambob
Hi, I am using the Business and am wondering about displaying volume price ranges.

I have attached an image to explain:

Can I get the price ranges to display as:

AUD5.00 1 to 5
AUD3.00 6 to 9
AUD2.00 10 to 99
AUD0.95 100 to 999
AUD0.25 9999 +

Instead of:

AUD5.00 each
AUD3.00 per unit for buying at least 9
AUD2.00 per unit for buying at least 99
AUD0.95 per unit for buying at least 999

Thanks in advance (Great product BTY)

Don't look at what is and ask 'why?'; look at what isn't and ask 'Why Not!'

Please Log in or Create an account to join the conversation.

More
13 years 11 months ago #78100 by Xavier
Replied by Xavier on topic Volume Price Range
Hi,

Yes it's possible, you have to replace the lines:
Code:
if(isset($price->price_min_quantity) && empty($this->cart_product_price) && $this->params->get('per_unit',1)){ if($price->price_min_quantity>1){ echo JText::sprintf('PER_UNIT_AT_LEAST_X_BOUGHT',$price->price_min_quantity); }else{ echo JText::_('PER_UNIT'); } }
By:
Code:
if(isset($price->price_min_quantity) && empty($this->cart_product_price) && $this->params->get('per_unit',1)){ $nextMin = $k + 1; if($price->price_min_quantity>1){ if(isset($this->row->prices[$nextMin])) $price->price_max_quantity = $this->row->prices[$nextMin]->price_min_quantity; else $price->price_max_quantity = '999'; echo $price->price_min_quantity." to ".$price->price_max_quantity; //echo JText::sprintf('PER_UNIT_AT_LEAST_X_BOUGHT',$price->price_min_quantity); }else{ if(isset($this->row->prices[$nextMin])){ $price->price_max_quantity = $this->row->prices[$nextMin]->price_min_quantity; echo "1 to ".$price->price_max_quantity; }else echo JText::_('PER_UNIT'); } }
And replace the foreach: "foreach($this->row->prices as $price){" by "foreach($this->row->prices as $k => $price){"

In the view "product / listing_price" in HikaShop > Display > Views
The following user(s) said Thank You: sambob

Please Log in or Create an account to join the conversation.

More
13 years 11 months ago #78103 by sambob
Replied by sambob on topic Volume Price Range
Hi Xavier,

thanks for that. Greatly appreciated.

Am i right in guessing the $price->price_max_quantity = '999'; will be standard across all products?

Is there a way to have that set to 1+ to whatever the last increment is?

See attachement:


In that example... the last one is 999, but what is I wanted the last one to be 500? (would that code render the last one as 999?)

Don't look at what is and ask 'why?'; look at what isn't and ask 'Why Not!'

Please Log in or Create an account to join the conversation.

More
13 years 11 months ago #78118 by Xavier
Replied by Xavier on topic Volume Price Range
In the code given, the value 999 is to set the max product quantity, I think that it's better to replace it by "..." or just display
Code:
echo "From ".$price->price_min_quantity;
The following user(s) said Thank You: sambob

Please Log in or Create an account to join the conversation.

More
13 years 11 months ago #78243 by sambob
Replied by sambob on topic Volume Price Range
Brilliant... it works.

I changed the 999 to a ~

But.. Is there a way to code it so that if there is no higher price increment, the echo could return the following

echo $price->price_min_quantity." + "

Thereby rendering
AUD5.00 1 to 9
AUD3.00 10 to 99
AUD2.00 99 to 999
AUD0.95 999+

Not a coder, but can you have two echos, with the second one being used if the first condition is not met?

Don't look at what is and ask 'why?'; look at what isn't and ask 'Why Not!'

Please Log in or Create an account to join the conversation.

More
13 years 11 months ago #78265 by Jerome
Replied by Jerome on topic Volume Price Range
Hi,
Code:
if(isset($price->price_min_quantity) && empty($this->cart_product_price) && $this->params->get('per_unit',1)){ $nextMin = $k + 1; if($price->price_min_quantity>1){ if(isset($this->row->prices[$nextMin])) { echo $price->price_min_quantity." to ".$this->row->prices[$nextMin]->price_min_quantity; } else { echo $price->price_min_quantity."+"; } }else{ if(isset($this->row->prices[$nextMin])){ $price->price_max_quantity = $this->row->prices[$nextMin]->price_min_quantity; echo "1 to ".$price->price_max_quantity; }else echo JText::_('PER_UNIT'); } }

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
The following user(s) said Thank You: sambob

Please Log in or Create an account to join the conversation.

More
13 years 11 months ago #78293 by sambob
Replied by sambob on topic Volume Price Range
Bingo

Thanks Jerome, (appreciated)

Is there a way not to have AUD0.95 750+ at the cat display level? (see image)




Don't look at what is and ask 'why?'; look at what isn't and ask 'Why Not!'

Please Log in or Create an account to join the conversation.

More
13 years 11 months ago #78310 by Xavier
Replied by Xavier on topic Volume Price Range
Hi,

Yes it's possible, you just have to disable the option "Display price" in HikaShop > Display > Content menus or modules configuration.
The following user(s) said Thank You: sambob

Please Log in or Create an account to join the conversation.

More
13 years 11 months ago #78315 by sambob
Replied by sambob on topic Volume Price Range
Thanks Xavier & Jerome,

A Great help (as always with Hikashop)

There are a few other things I am trying to do with this tier pricing but I will give it a go and see how I get on before posting the Q.

Don't look at what is and ask 'why?'; look at what isn't and ask 'Why Not!'

Please Log in or Create an account to join the conversation.

More
13 years 11 months ago #78509 by sambob
Replied by sambob on topic Volume Price Range
Hi Xavier & Jerome,

ok... I have tried to achieve something by coding myself but cannot work it out.



In the attached image you will see the ranges are:
1 to 10
10 to 100
100+

Which is almost right... but there is an overlap 10 and 100

Is it possible to get it to display:
1 to 10
11 to 100
101+

i.e. The next increment up adds 1 to the next increment.

Don't look at what is and ask 'why?'; look at what isn't and ask 'Why Not!'

Please Log in or Create an account to join the conversation.

More
13 years 11 months ago #78519 by Jerome
Replied by Jerome on topic Volume Price Range
Hi

echo ($price->price_min_quantity+1)."+";


Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
The following user(s) said Thank You: sambob

Please Log in or Create an account to join the conversation.

More
13 years 11 months ago #78606 by sambob
Replied by sambob on topic Volume Price Range
Brilliant Jerome!

Thanks you so much.

Don't look at what is and ask 'why?'; look at what isn't and ask 'Why Not!'

Please Log in or Create an account to join the conversation.

More
13 years 10 months ago #80331 by sambob
Replied by sambob on topic Volume Price Range
Hi again Jerome & Xavier,

I am now trying to get this volume pricing to work on the Product Table display:



I hunted around for similar code in listing_table, but could not find it.

Which view do I need to edit?

Don't look at what is and ask 'why?'; look at what isn't and ask 'Why Not!'

Please Log in or Create an account to join the conversation.

More
13 years 10 months ago #80401 by Xavier
Replied by Xavier on topic Volume Price Range
Hi,

This is the same view which is used for the listing or the product page "product / listing_price".

Please Log in or Create an account to join the conversation.

More
13 years 10 months ago - 13 years 10 months ago #80514 by sambob
Replied by sambob on topic Volume Price Range
Morning Xavier,

There are displaying differently:

Here is the link to the Ferrite Disc 5x3 (the one highlighted in the image provided)
geneva.directrouter.com/~magnetgr/index....discs-5x3&Itemid=230


Don't look at what is and ask 'why?'; look at what isn't and ask 'Why Not!'
Last edit: 13 years 10 months ago by sambob.

Please Log in or Create an account to join the conversation.

More
13 years 10 months ago #80576 by nicolas
Replied by nicolas on topic Volume Price Range
I confirm that the same product/listing_price file is used for both the table listing and the product page.

If you don't get the same display, I can only think that it comes from a variable in the code of that listing_price file which is not the same on both pages.

Please Log in or Create an account to join the conversation.

More
13 years 10 months ago #80581 by sambob
Replied by sambob on topic Volume Price Range
Hi Nicolas,

Thanks for your reply.

If I remove the custom code (as given) from the listing_price file, they both display correctly.

But using the code that was supplied, means they display differently (as you correctly say)

Any idea what is missing from the code that is not adjusting the table display prices correctly?

Don't look at what is and ask 'why?'; look at what isn't and ask 'Why Not!'

Please Log in or Create an account to join the conversation.

More
13 years 10 months ago #80605 by nicolas
Replied by nicolas on topic Volume Price Range
I would say that it comes from that code:
if(isset($price->price_min_quantity) && empty($this->cart_product_price) && $this->params->get('per_unit',1)){

try to have that instead:
if(isset($price->price_min_quantity) && empty($this->cart_product_price)){

Please Log in or Create an account to join the conversation.

More
13 years 10 months ago #80615 by sambob
Replied by sambob on topic Volume Price Range
Hi Nicolas,

that gives a Parse error: syntax error, unexpected '-', expecting ',' or ')'

Don't look at what is and ask 'why?'; look at what isn't and ask 'Why Not!'

Please Log in or Create an account to join the conversation.

More
13 years 10 months ago #80643 by Xavier
Replied by Xavier on topic Volume Price Range
Hi,

I think that you forgot a ")" in the line or something else.
The following user(s) said Thank You: sambob

Please Log in or Create an account to join the conversation.

Time to create page: 0.132 seconds
Powered by Kunena Forum