Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.
For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email email@example.com.
This should be simple for someone and I need to solve this fast.
I am trying to set a flag $firstOptionLine the first time /template/catalog/product/view/options/type/text.phtml is called.
But get this error:
Notice: Undefined variable: firstOptionLine in /usr/home/stationery/Websites/stationery.retrix.net/app/design/frontend/default/stationery/template/catalog/product/view/options/type/text.phtml on line 29
I declared the variable in /template/catalog/product/view/options.phtml near the bottom of the file here:
@rattler72 Is there a reason you do not use js to do what you intend? Otherwise, I am also interested to know how to pass a variable from one scope to another. I did it the last time using DB, which required settings in config.xml and sql setup and I had to host the variables in a custom Model. You can also investigate Mage::registry, which is not designed for this purpose.
Although I’m fairly new at Magento, getting into the DB code / config seems overkill. I also wanted to stay away from JS only because it seems so logical to put this simple condition with the other rendering code in the template.
I’ve spent a lot of time on osCommerce lately where adding your own code seems fairly easy. Thanks for your suggestions everyone.
Try to mock up a screen shot of how you want it to look so I can see what you want exactly.
Here is what I’m trying to layout (see attached):
There are a set of radio buttons above.
Then a heading below that: “PERSONALIZED TEXT up to 6 lines”.
Then I have 6 lines of text fields below that.
These are all set up as options in my product.
To confirm, you have multiple text field options assigned to a product that you would like to group under the title “PERSONALIZED TEXT up to 6 lines” and then add “16 chars/line, uppercase” to each row under those options? I assume that you would also like to transform the typed characters to uppercase and limit the characters per line to 16 with JS? Do you allow any characters to be entered such as symbols etc. or do you have a specific subset of characters that you allow?
Yes, the main issue is grouping the text fields with a header.
Do not worry about the label “16 chars/line, uppercase” or limiting the number of characters… we took care of the label with css and Magento has settings for the character limit.