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!
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 ...
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?
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 ...
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:
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.
Moderation
Destination thread ID and reason are required when shown.
Report Post
Tell staff why this post should be reviewed.
Manage cookie preferences
Our cookie policy has been updated, so we need you to review your preferences and consent again.