Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2008
    Posts
    23
    Plugin Contributions
    1

    Default how to calucalate weight basedon the number of letters entered?

    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

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: how to calucalate basedon the number of letters entered?

    A link to your cart and to this item would allow us to see how you have it set up...
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Aug 2008
    Posts
    23
    Plugin Contributions
    1

    Default Re: how to calucalate basedon the number of letters entered?

    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

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: how to calucalate weight basedon the number of letters entered?

    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. #5
    Join Date
    Aug 2008
    Posts
    23
    Plugin Contributions
    1

    Default Re: how to calucalate weight basedon the number of letters entered?

    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

  6. #6
    Join Date
    Aug 2008
    Posts
    23
    Plugin Contributions
    1

    Default Re: how to calucalate weight basedon the number of letters entered?

    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

 

 

Similar Threads

  1. v151 Number of letters in the Product heading
    By Jenvin in forum General Questions
    Replies: 2
    Last Post: 23 Dec 2013, 07:24 AM
  2. v150 How do I change the name used in the closing of letters?
    By Scrapping Nik in forum General Questions
    Replies: 2
    Last Post: 5 Feb 2012, 04:50 AM
  3. ALWAYS: The credit card number entered is invalid. Please check the number...
    By smoochinc in forum Built-in Shipping and Payment Modules
    Replies: 9
    Last Post: 14 Dec 2007, 10:15 PM
  4. How do I insert 2 randomly generated letters before order number?
    By Brent2 in forum Templates, Stylesheets, Page Layout
    Replies: 12
    Last Post: 15 Sep 2007, 01:03 PM
  5. Text input box that times the total by the number entered
    By bradlawson in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 9 Dec 2006, 02:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg