Product Price per minimum quantity?

  • Posts: 55
  • Thank you received: 1
12 years 2 months ago #64216

Hi!

I've set up my product page to display this:



but I would like to get it to display this:

0,45 € /gr
3,00 € /10 gr
20,00 € /100 gr

So, instead of price per unit, I want to show the price per X units (X being the number given in the 'minimum quantity' box in the product form.
How would I go about changing the corresponding view or price display method? I searched the forum for similar situations but didn't find any and wouldn't know what view to look for or what to add. I looked into using Variants as an alternative, using 3 different weight types, but that would make it impossible for customers to order, for instance, 750 gr or 1500 grams, so that's not really an option for me.

Thanks in advance!
MF

Last edit: 12 years 2 months ago by many-feathers.

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

  • Posts: 2334
  • Thank you received: 403
12 years 2 months ago #64346

Hi there,

To do this you have to edit the listing_price view (in display>views) and modify the following lines:

echo $this->currencyHelper->format($price->price_value_with_tax,$price->price_currency_id);
By:
echo $this->currencyHelper->format($price->price_value_with_tax*$price->price_min_quantity,$price->price_currency_id);

And
echo $this->currencyHelper->format($price->price_value,$price->price_currency_id);
By:
echo $this->currencyHelper->format($price->price_value*$price->price_min_quantity,$price->price_currency_id);

Last edit: 12 years 2 months ago by Eliot.
The following user(s) said Thank You: many-feathers

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

  • Posts: 55
  • Thank you received: 1
12 years 2 months ago #64399

Thanks for helping!

I changed both lines of code and yes, it seems to work for the values above 1, but not for 1 (which is the minimum quantity of the first value). It seems to be multiplied by 0?

0,00 € por 10 gr
3,00 € > 100 gr
19,50 € > 1000 gr

Could this be caused by this line?

if(isset($price->price_min_quantity) && empty($this->cart_product_price) && $price->price_min_quantity>1){

Last edit: 12 years 2 months ago by many-feathers.

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

  • Posts: 2334
  • Thank you received: 403
12 years 2 months ago #64402

Just add this line before and it should be ok:

if(empty($price->price_min_quantity)) $price->price_min_quantity=1;

Last edit: 12 years 2 months ago by Eliot.
The following user(s) said Thank You: many-feathers

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

  • Posts: 55
  • Thank you received: 1
12 years 2 months ago #64411

And yes it is!

Thank you very much! Great support!

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

  • Posts: 23
  • Thank you received: 0
11 years 10 months ago #83032

Hello!

I'm implementing the same thing on my site and price for the specific quantity (price for the minimum quantity) of item is showing fine in category listing and product page. But when this item added in the cart there is a price mess on the cart page:

While the added quantity of item is lower then "minimum quantity", the summative price of item is getting as "free".

When the added quantity is bigger then "minimum quantity", the summative price and quantity for item is calculating correctly but the total sum for the cart is calculating not correctly: the total price is calculating as per 1 added item but not for "minimum quantity" amount.

For example:

I have item that costs 10 but selling by boxes from 24 items (24 is set as minimum quantity in product properties and price is set 10 for this minimum quantity).
The category and product page showing the price correctly: 10 per 1 item and 240 for the box.
Adding this item to the cart -> open cart and see that the quantity is 1 (thats correct since it shoud be 1 box) but the summative price for this item row is "free".
Increasing the quantity to 24 and see that now the summative price in the row is correct - 5760, but the total price for the cart is showing - 240 (as it is not 24 boxes, but 24 items).

Could you, please, advice how to fix it?

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

  • Posts: 82818
  • Thank you received: 13360
  • MODERATOR
11 years 10 months ago #83202

Hi,

I've never heard of such issue. did you change something in the code ?
Can you do a screenshot of your product edition page and give a link to that product page so that we can see the result ?

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

Time to create page: 0.086 seconds
Powered by Kunena Forum