Problems, need help? Have a tip or advice? Post it here.
6 posts Page 1 of 1
Hello, here I am again.

So, I'd like to know if there is a way to make a textual "product variant" be displayed as a text area instead a input text.

Thank you.
Please post screenshot :)
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
trendoman wrote: Please post screenshot :)


Sure, I've a product page with a variant, which enable the user to enter whatever he wants:

How it is set on couch dashboard:
Image


How it is displayed on the site:
Image


But, I'd like that it would displayed as a textarea, to make it easier for the user enter a long text. Something like this:
Image
Hi @carl99,

Following is an excerpt for the cart docs http://docs.couchcms.com/concepts/shopp ... g-products
This pp_option_values tag is an interesting one. When used as a self-closing tag (as we did above), it goes ahead and outputs the complete HTML markup for the option-values (which could create a dropdown or radio-buttons etc.). For most cases this should be adequate, requiring only some trivial tweaking of the site's CSS to style the auto-generated elements.

If, however, you need absolute control over every byte of the markup being generated, you can make pp_option_values switch off its 'auto-pilot' mode and hand over the control to you. This can be done by using pp_option_values tag in the opening/closing pair form (instead of a self-closing one). Used in this manner, the tag simply iterates through all the option-values and makes available (as variables) all the information required to render the values manually.

TL;DR - we can use pp_option_values tag in the opening/closing pair form and then render all fields as we wish (in your case, render text as textarea).

The documentation page then goes on to provide a complete sample snippet that does just that i.e. render the fields manually.

May I suggest that you please try tweaking that code to make it output a textarea instead of the text input? Do let us know if you have any trouble doing it.

Thanks.
Understood!

Thanks to you I did it. Thank you! :D
Great! I am glad it helped :)
6 posts Page 1 of 1