Forums / Built-in Shipping and Payment Modules / Allow Text When Entering Weight

Allow Text When Entering Weight

Locked
Results 1 to 6 of 6
This thread is locked. New replies are disabled.
13 Oct 2009, 16:41
#1
bluewire avatar

bluewire

New Zenner

Join Date:
Oct 2009
Posts:
13
Plugin Contributions:
0

Allow Text When Entering Weight

I am working on a site that I need to be able to use the Weight function differently then normal. The site sells seeds and the shipping is based on the price in the cart and not the weight. What i'd like to use the weight feature for would be to type out different types of amounts (100 Seeds, 5g, 1 Ounce). And then simply replace the "lbs" in the language file to be "Per Package".

The problem i'm having is i'm not sure how to change the weight function to allow text. If I type in 5g it comes out to just 5.

I've been stuck on this for a few days and haven't found any threads already going on it so I apologize if there already is one. I just want it working! Any help is appreciated, Thanks!
13 Oct 2009, 23:47
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Posts:
62,757
Plugin Contributions:
1

Re: Allow Text When Entering Weight

weight is used in calculations some 300-400+ times in the code ... :eek:

It might be better to create a new field in the products table or products_attributes table, depending on how you need to use this ... and be able to use your new field in this manner vs a field used throughout the code as a numeric value ...
13 Oct 2009, 23:54
#3
bluewire avatar

bluewire

New Zenner

Join Date:
Oct 2009
Posts:
13
Plugin Contributions:
0

Re: Allow Text When Entering Weight

Thanks for the reply, I was afraid that might be the case.
Any suggestions on adding it to the product edit page and product listings after I create a new field for it in the database?
14 Oct 2009, 00:12
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Posts:
62,757
Plugin Contributions:
1

Re: Allow Text When Entering Weight

Do a search in the Tools ... Developers Tool Kit ... for the word:
weight

you will see an overwhelming 450+ places that this word is used ...

The good news is, you don't need to customize the code in that many places ... :smile:

The bad news is, you need to figure out which places apply to what you are trying to do ...

I don't know if you want to control it at the Products level or Products Attributes level ...

Both use weight, but you did not specify how your Products are set up ...

Doing the search on the Developers Tool Kit can give you an idea of places to check to see if you need to address the new field you are making in those same areas of the code ...
14 Oct 2009, 19:11
#5
bluewire avatar

bluewire

New Zenner

Join Date:
Oct 2009
Posts:
13
Plugin Contributions:
0

Re: Allow Text When Entering Weight

I should of specified how i'm doing it completely.

The no products have attributes they all are simply seed packages. Different seeds have different amounts of seeds in each package (5g, 100 Seeds, 1 Ounce).
Id like to show how many seeds per package on the product listing but not mandatory.
So the main function would be to allow text in the weight edit box, the weight isn't used or calculated any where else. The shipping is determined on the price in cart.

I'm still a little new to this so i'm not sure where or how the function would be typed out or where to start looking. After trying to look for it through the developers tool kit I was afraid I might apply it to the wrong code.

Here is the URL to the site i'm working on if that helps:

www.hometownseeds.com

Thanks Alot!
15 Oct 2009, 05:05
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Posts:
62,757
Plugin Contributions:
1

Re: Allow Text When Entering Weight

Do you only need that on the product_info page or also in the Listings?

If only on the product_info page, there are also Read Only Attributes that can be used that display as text only and do not make the Product "act" like it has attributes nor appear in the cart etc.