X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Limiting Product Name Field (https://forum.x-cart.com/showthread.php?t=60941)

R3NOIR 09-20-2011 08:36 AM

Limiting Product Name Field
 
Where can I limit the number of characters a Provider can enter in as a Product name?

Also I would like a line break in product name after 30 characters, but allow a total of 60 characters (2 lines) for Product Name.

So a Provider could enter up to 60 characters for a product name but it would be on 2 lines with a line break after the first 30 characters.
Thx.

totaltec 09-20-2011 11:13 AM

Re: Limiting Product Name Field
 
1. Limit characters in product name
There are many ways you could do this, one would be to simply limit the number of characters that the database field for product name can accept. To provide feedback about this to the provider, you could use javascript validation on the product form.

2. To provide your line break is a little more tricky, you will need to write some logic that counts the characters in the product name variable and seperates it into two new variable which you could then display.
http://www.smarty.net/docsv2/en/language.modifier.count.characters.tpl

If you need more info on either of these solutions just ask.


All times are GMT -8. The time now is 08:23 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.