Author Topic: decimal quantity  (Read 29738 times)

Linholen974

  • Beginner
  • *
  • Posts: 9
Re: decimal quantity
« Reply #15 on: April 05, 2009, 15:36:41 pm »
Here you have all files with their dir/

Ps_cart : administrator\components\com_virtuemart\classes\ps_cart.php
ps_product : administrator\components\com_virtuemart\classes\ps_product.php[/color]
ps_checkout : administrator\components\com_virtuemart\classes\ps_checkout.php

In database modify

Quote
product_quantity to decimal(10,2) in jos_vm_orders
price_quantity_start to decimal(10,2) in jos_vm_product_price         
price_quantity_end to decimal(10,2) in jos_vm_product_price
product_sales to decimal(10,2) in jos_vm_product

Download file : http://www.netdev974.com/decimalqty.zip

oscarbci

  • Beginner
  • *
  • Posts: 3
Re: decimal quantity
« Reply #16 on: April 13, 2009, 19:13:25 pm »
I also really need to get a solution for the decimal issue on my web team. Please some help!

Linholen974

  • Beginner
  • *
  • Posts: 9
Re: decimal quantity
« Reply #17 on: April 22, 2009, 06:33:50 am »
the solution is before your post

marcosartore

  • Beginner
  • *
  • Posts: 6
Re: decimal quantity
« Reply #18 on: April 28, 2009, 09:18:11 am »
Hello,
when I try to download http://www.netdev974.com/decimalqty.zip I get a 404 error.
Could you please fix the problem and tell us where the file can be downloaded ?
Does it contain fixes for the php files or what ?
Many thanks for your help,
bye,
Marco

Linholen974

  • Beginner
  • *
  • Posts: 9
Re: decimal quantity
« Reply #19 on: May 11, 2009, 09:24:07 am »
Hi

Thank for you message i will fix the problem soon !!

it fixed now

Linholen974

  • Beginner
  • *
  • Posts: 9
Re: decimal quantity
« Reply #20 on: May 11, 2009, 09:31:53 am »
i have solve my problem

Phelan

  • Beginner
  • *
  • Posts: 30
Re: decimal quantity
« Reply #21 on: May 11, 2009, 11:39:27 am »
GREAT,

it works,

is it possible to use  "," instead of "."   e.g 1,5  /  1.5 ?

sac5735

  • Beginner
  • *
  • Posts: 4
Re: decimal quantity
« Reply #22 on: September 25, 2009, 06:15:47 am »
hey, this works great, but I need to use a drop down box instead of a text..I noticed the quantity_begin, quantity_end, and quantity_step are stored in a column called quantity_options. This column is a varchar and also holds the list type...can anyone help me out?!

Toclafane

  • Beginner
  • *
  • Posts: 1
Re: decimal quantity
« Reply #23 on: February 13, 2010, 14:40:19 pm »
Hello everyone,

this solution is working fine but I have two problems:
First the customers still have to type 0.5 instead of 0,5 (my shop is located in Germany aswell) and second how can i change the minimum order quantity in the product administration for example into 0,5 or 0.5?

saintanger

  • Beginner
  • *
  • Posts: 2
Re: decimal quantity
« Reply #24 on: September 11, 2010, 19:18:26 pm »
May I ask something? why I am missing the ./classes/ directory where i need to instert these files?

Rickus

  • Beginner
  • *
  • Posts: 2
Re: decimal quantity
« Reply #25 on: September 28, 2010, 07:51:11 am »
This is awesome, many thanks to Linholen974 for putting in the effort.

For those of us new to MySQL can you someone please tell us how to change the types in the database? I've tried many other sites but my queries don't work and I don't understand why or know enough to solve it.

I'm using phpMyAdmin.

In the table 'jos_vm_orders' I don't actually have a 'product_quantity', I can find the others but just have no idea how to change them from 'int' to 'decimal'.

Here you have all files with their dir/

Ps_cart : administrator\components\com_virtuemart\classes\ps_cart.php
ps_product : administrator\components\com_virtuemart\classes\ps_product.php[/color]
ps_checkout : administrator\components\com_virtuemart\classes\ps_checkout.php

In database modify

Quote
product_quantity to decimal(10,2) in jos_vm_orders
price_quantity_start to decimal(10,2) in jos_vm_product_price         
price_quantity_end to decimal(10,2) in jos_vm_product_price
product_sales to decimal(10,2) in jos_vm_product

Download file : http://www.netdev974.com/decimalqty.zip

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28300
  • Always on vacation
    • Jenkin Hill Internet
Re: decimal quantity
« Reply #26 on: September 28, 2010, 09:27:36 am »
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VirtueMart 3.8.9.10473 on Joomla 3.9.28 PHP 7.4.14

Rickus

  • Beginner
  • *
  • Posts: 2
Re: decimal quantity
« Reply #27 on: September 30, 2010, 04:44:50 am »
Thanks Kelvyn, you are a stallion.

jantabak

  • Beginner
  • *
  • Posts: 13
Re: decimal quantity
« Reply #28 on: October 07, 2010, 13:30:13 pm »
This helped me a lot, thank you!

shmade

  • Beginner
  • *
  • Posts: 1
Re: decimal quantity
« Reply #29 on: November 14, 2010, 01:43:57 am »
Hello,
sorry for reopening, but I spent about ten hours searching how to allow customers to put "," instead of "." when buying decimal quantity.

I found at one forum, that $value = str_replace(',', '.', $value); may be a solution, but I can't manage in which file(s?) i should put it into.
I need to get it working so please point me what to do with it. (if it could be solution)? Please help me.


I have 2 more minor issues with decimal quantities, now I can sell products in decimals ( with "." as decimal point), but :

1. Update of product stock amount is working well, but when the stock gets under 1, shop displays that product is no more availiable. I want to display it until stock reaches real 0. But even this, I can still add product in cart if I want to buy amount smaller or equal to current stock. (e.g. if current stock is 0.7 (product not availiable) and I put 0.4 the product is added to cart normaly)

2. If I am adding new product I cant set primal amount at stock as decimal. I need tu put start stock amount e.g. 23.2, if it can handle 23,2 would be nice, but here it is not needed as much as in customer area. Now it takes just int. or rounds it somehow... I supose that I need to change some value type in database, and maybe some files, but which?


Thanks for response. Sebastian