cancel
Showing results for
Did you mean:

## Decimal Place in QTY Field

Tourist
4 0 1

Hi guys,

Found an old post on this from 4 years ago. With technology having moved so far on this has got to be possible?

I have a client that deals in 1kg - 100kg of feed and all decimals in between and needs to be able to order decimal quanitities.

Clients are not going to do it based on 45000 grams. just will not work. So need decimals to work.

1. Is there a cheaky way around this?

2. Is someone able to develop an app that would solve this?

Shopify Expert
10010 116 1849

If you want to show it as kg, just do the math in the theme files and adjust according what's shown. In your example the customer could just enter in 45 into the kg input field and you calculate the grams from that to work out the price. If you don't need the decimals (such as 12.12kg) and just sold in full kg units you'd make things far easier to handle.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
Tourist
4 0 1

The killer and where we get stuck is in decimals. Client needs Decimals for it to work. E.g. Choose 4.5 KG which = 4500 grams. but the customer would type in 4.5 not 4500 (as this is "too confusing" for older customers)

Shopify Expert
10010 116 1849

but the customer would type in 4.5 not 4500

So let them type 4.5. On your end, use JavaScript to set a hidden value to 4500 - being the actual quantity. Basic math will do the job. You could even send what they added in (4.5) as a line item for order checking. They see kg on the front end, you see grams on yours. At some point they'll see grams on the order, but does that matter?

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
Tourist
4 0 1

Thanks Jason.

What I keep getting told is that Shopify does not allow decimals at all. if that makes sense. If you try and type .5 it pops up with a must be 0 or 1 or is that what you are saying can be overcome with Javascript? Do you know anyone who could write that adjustment in the code? Happy to pay if it can be done.

Shopify Expert
4320 35 446

Quantity is an integer. You cannot buy 0.333 of a t-shirt. You cannot by 1.875 of a dog collar. You cannot buy 99.99 of a box of pretzels.

Your quantity must be a 1, 2, or ... a 99. How you achieve that is through the greater glory of script code. There are as many ways to do this as there are muppets. Many many muppets.

It is all in impedance matching. If your backend works in grams, but your front end is in kilograms, just multiply or divide by 1000 where necessary. Do Not Play with decimals.

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
Shopify Expert
10010 116 1849

What I keep getting told is that Shopify does not allow decimals at all.

That is true info.

I could be over simplifying things but all I am reading is that you want to be able to show the customer a field that they can enter kg into. As long as you can mathematically adjust what they enter to match the whole units in the store you'll be fine. Rather than per gram I'd be tempted to sell the product per 100g - so one unit = 100g of feed.

4.5 kg = 45 units
3.25kg = 32.5 units (uh oh! can't do that, let customer know and auto adjust adjust the kg value to 3.3 for 33 units)

Is that what you're talking about?

Selling by the gram will be an issue if you are getting into percentages of a cent, so 100 may be easier. Theory works either way. There would be plenty of developers / experts that can help out with this. You can either make a post on the job board, or find someone via the experts pages

 beaten to the post by hunkybills speedy typing! [/edit]

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
Navigator
1137 0 125

Jason, don't feel bad. HunkyBill has a "muppet" script that effortlessly shoots muppet references into posts. :-)

http://www.StandoutDesigns.com ::: Solid Wood TV Furniture for Enthusiasts. Made in USA.
Tourist
4 0 1

As I referenced would be happy for someone to show me a smart solution. Let me explain the outcome I am looking for.

This shop sells bulk buy products. all include decimals. a Client will buy 4.5 KG of this and 4.7 KG of that for example.

Rules from the client is they must be able to use a decimal for fractions of KG's. They do not want to type in 4700 Grams or 47 and it works out the grams in a secret coding area.

These clients are used to typing 4.7 on the old shopping cart and this needs to move with the upgrade. Does that make sense are we on the same page?

New Member
2 0 0

so has anyone been able to do this yet? I sell malts and grains and have set up a store but not launched yet as need to sell these in different weights so if someone wants to buy 2.250 kgs of malts they can and then the price reflects the amount purchased. I have hired an expert but they dont seem to be able to do this.....can anyone help me out here?

Latest Topics

Latest Posts

• ## Testing Credit cards for Visa and MC not working

Most Liked Authors