Counting words as quantity?

In my store I will be selling vinyl letters based on user text input and I am looking for a way to count the words so that number will be the quantity added to the cart. I charge for each letter individually based on size.



I saw the product customizer add-on but I just need the letter counting function at this point…I will not customize t-shirts, caps, mugs, etc.so I am trying to find a more economical solution…



Is there anything I could use to make this work the way I want?

anyone else did it

You could use a “pre” checkout controller for the modes 'checkout' or 'cart'. You could then adjust the 'amount' based on the non-space letter count. The user could still change the quantity though so it's not a perfect solution.



A better solution would be to have a hiden item you could add to the cart and specify the cost based on the letter count. The quantity would always be 1 for this item and the price “stored” so that it is not overwritten or re-computed other than by your customization. The user could remove the item from the cart, but not reduce the quantity.



I.e.

1ea Custom Setup ($1/letter) - $18.00

[quote name='tbirnseth' timestamp='1355174721' post='150839']

You could use a “pre” checkout controller for the modes 'checkout' or 'cart'. You could then adjust the 'amount' based on the non-space letter count. The user could still change the quantity though so it's not a perfect solution.



A better solution would be to have a hiden item you could add to the cart and specify the cost based on the letter count. The quantity would always be 1 for this item and the price “stored” so that it is not overwritten or re-computed other than by your customization. The user could remove the item from the cart, but not reduce the quantity.



I.e.

1ea Custom Setup ($1/letter) - $18.00

[/quote]



Thank you Tbirnseth

Can you explain to me better what a pre checkout controller is?

also for the second solution you suggested…how would I link the hidden product to the letters?

Let me explain you using a sample from the store maybe I will grasp what you are recommending



I have a product - letters - and for them I have set initial price of $.50 with a drop down menu where the customer can choose different sizes with price increments.



Then I have set a text box option where the customer types the desired text.



how can I link the text they type with the quantity that will be added to the cart?

right now it is always 1…



hope you can help me understand better your suggested solution

thank you

A “pre” controller adjusts/manages data (REQUESTs) submitted before the standard cart controllers do.

So you would look to see if your text has words in it and if so, you would do the calculation and adjust things like $cart]'price'] appropriately.



You can use Google and search for 'cs-cart “PHP Controller”' (PHP Controller in double quotes). You'll find a 6 part tutorial there that should give you everything you need to do what you need to do. Obviously you have to be able to write basic php code and have a basic understanding of how templates are used in cs-cart.

[quote name='tbirnseth' timestamp='1355179616' post='150853']

A “pre” controller adjusts/manages data (REQUESTs) submitted before the standard cart controllers do.

So you would look to see if your text has words in it and if so, you would do the calculation and adjust things like $cart]'price'] appropriately.



You can use Google and search for 'cs-cart “PHP Controller”' (PHP Controller in double quotes). You'll find a 6 part tutorial there that should give you everything you need to do what you need to do. Obviously you have to be able to write basic php code and have a basic understanding of how templates are used in cs-cart.

[/quote]

Thank you I will check this out and post back if I will be able to work it out…it may be useful for others too