Price per cm2

  • Posts: 57
  • Thank you received: 1
4 years 3 months ago #327449

Hi Guys,

I've downloaded, installed and activated the plugin www.hikashop.com/marketplace/product/151...h-length-plugin.html

Created the two required fields



Set both fields to be used on one particular product:


Set the price per cm2 on the product:


I can see the fields in the front end:


But the price is not being calculated.

What am I forgetting to do?
If I put in a price with the + sign and save it, it removes it.

You have the latest stable version of HikaShop Business: 4.4.0

Attachments:

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

  • Posts: 57
  • Thank you received: 1
4 years 3 months ago #327451

Apparently I can't enter:

€0.0045 for one product
€0.0040 for 5 or more
€0.0035 for 10 or more

Where can I change the number of decimals?

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

  • Posts: 57
  • Thank you received: 1
4 years 3 months ago #327462



Retail price is (and keeps) displaying the correct number of decimals, so it's stored in the backend correctly, but for this particular product, I want to show 5 decimals AND have Hikashop calculate with it in the frontend.

Attachments:

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

  • Posts: 12953
  • Thank you received: 1778
4 years 2 months ago #327472

Hello,

What do you exactly mean by the price is not being calculated ? Did you tried to add the product to your cart and see if the price was correct ?

Kind regards,
Mohamed.

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

  • Posts: 57
  • Thank you received: 1
4 years 2 months ago #327648

Yes I did.
The price was 0.00.

Only when I edit the currency for EUR to have 4 decimals it will calculate a price, but that means all prices everywhere will have 4 decimals.
Created a second Euro currency especially for this product, but can't set select the currency created on a specific product :(

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

  • Posts: 83404
  • Thank you received: 13498
  • MODERATOR
4 years 2 months ago #327651

Hi,

Note that there are several things here:
- first the number of decimals the price is stored in the database. It should support 5 decimals without a problem here.
- the calculations made on the price. Here, if you have the "round prices during calculations" setting activated and you only have 2 decimals configured for the currency, the price from the database will be rounded to 2 decimals before starting the calculations. So in your example, it will always be 0. So in your case, you need to make sure that setting is turned off.
- then, the display of the price. It uses the number of decimals of the currency and the current currency has to be the same for all the products. You can have one product with a EUR currency, and a second one with another "EUR 2" currency. That would lead to the system not being able to sum the prices for the total amount calculation.

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

  • Posts: 57
  • Thank you received: 1
4 years 2 months ago #327669

I'm at total loss here :(




Attachments:

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

  • Posts: 83404
  • Thank you received: 13498
  • MODERATOR
4 years 2 months ago #327672

Hi,

You set a price for a minimum quantity of 5 and a price for a minimum quantity of 10.
But in your example, you're using a quantity of 2. So the system doesn't find any price at all and that's why it's 0 regardless of what you enter.
If you want to allow people to purchase the product with a quantity of 2 then you should have a price with at least a minimum quantity of 2.

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

  • Posts: 57
  • Thank you received: 1
4 years 2 months ago #327705

Uch, staring myself blind :(

Ok, it works now. Is here any way to show 4 or 5 decimals above the dimensions for just this product?

Attachments:

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

  • Posts: 83404
  • Thank you received: 13498
  • MODERATOR
4 years 2 months ago #327707

Hi,

It's possible.
What you can do is create another currency with the number of decimals you want for these products (but don't change the currency for the product's prices).
And then you need to add the code:

if($this->row->product_id == XX) {
 $price->price_currency_id = YY;
}
after the line:
foreach($this->row->prices as $k => $price) {
in the file product / listing_price.php via the menu Display>Views (where XX is the id of the product and YY is the id of the currency with more decimals).

Last edit: 4 years 2 months ago by nicolas.

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

  • Posts: 57
  • Thank you received: 1
4 years 2 months ago #327757

Thanks for your patience !!

The edit in the file listing_price doesn't work :( see attached.

Attachments:

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

  • Posts: 83404
  • Thank you received: 13498
  • MODERATOR
4 years 2 months ago #327759

Hi,

Sorry I made a typo in the code I gave. I've updated it in my previous message.

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

  • Posts: 57
  • Thank you received: 1
4 years 2 months ago #327768

Can't really spot the change you've made, but turns out I found a little gem in the software that will do the trick just fine.

With the second currency (4 decimals) on the prices, it will display good enough to the customer to see the differences





Again, thanks for your patience with me :D

Attachments:

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

  • Posts: 83404
  • Thank you received: 13498
  • MODERATOR
4 years 2 months ago #327773

Hi,

I've changed == to = on the line:
$price->price_currency_id = YY;

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

Time to create page: 0.138 seconds
Powered by Kunena Forum