Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Setting Up Your Zen Cart Products / Setting Up Categories, Products, Attributes / how to calucalate weight basedon the number of letters entered?

how to calucalate weight basedon the number of letters entered?

Locked
This thread is locked. New replies are disabled.
27 Oct 2009, 8:20 PM
#1
staft avatar

staft

New Zenner

Join Date:
Aug 2008
Posts:
23
Plugin Contributions:
1

Post #1 by staft

I sell items based on the number of letters entered into the text input. I have the pricing figured out, but cannot get the weight to calculate correctly. It only shows the weight of a single item.

Currently:
AAAAAA = .5 lbs

I need:

A = .5 lbs
AA = 1 lbs
Abc = 1.5 lbs

Is this even possible with this cart? It is the only thing I am lacking thus far!

Thanks,
Sean

27 Oct 2009, 9:42 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Post #2 by kobra

A link to your cart and to this item would allow us to see how you have it set up...

Zen-Venom Get Bitten

31 Oct 2009, 2:54 PM
#3
staft avatar

staft

New Zenner

Join Date:
Aug 2008
Posts:
23
Plugin Contributions:
1

Post #3 by staft

My ideal situation is this (each letter has a weight of .5):
A - .5
AA - 1.0
Zen Cart - 3.5

My current situation is this:
A - .5
AA - .5
Zen Cart - .5

Does that make sense? When someone buys a name, letters cannot set up as a multiplier for weight, but it can be setup for pricing.

My cart doesn't show the weight anywhere so it wouldn't help to see it.

Thanks,
Sean

31 Oct 2009, 3:52 PM
#4
ajeh avatar

ajeh

Oba-san

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

Post #4 by ajeh

This would have to be customized to base the weight on the number of letters in an attribute ...

The function zen_get_letters_count can count the number of letters passed to it ...

You might be able to use that to help count the letters to compute the weight total for an attribute of text ...

This function will calculate a "price" from a string of text:
zen_get_letters_count_price

You might look at those two functions in the functions_prices.php and see if you can utilize those for what you need ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

5 Nov 2009, 3:58 AM
#5
staft avatar

staft

New Zenner

Join Date:
Aug 2008
Posts:
23
Plugin Contributions:
1

Post #5 by staft

Ok, now I am clueless about where to add this to the weight of the product. I understand basics of PHP, but I am clueless looking at and trying to figure the file to add the zen_get_letters_count function to. lol Seems like there would be a place that the attribute would send the weight to the cart to tally it up, but where?

Sean

5 Nov 2009, 4:17 AM
#6
staft avatar

staft

New Zenner

Join Date:
Aug 2008
Posts:
23
Plugin Contributions:
1

Post #6 by staft

The closest I can get is by adding weight to the option for the text, but it only adds it one time, it doesn't multiply it by the number of letters entered. Is there an easy fix for this?
Sean