Ecommerce base with radiobuttons

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
cmsmstest
New Member
New Member
Posts: 6
Joined: Wed Jun 11, 2014 6:55 pm

Ecommerce base with radiobuttons

Post by cmsmstest »

Hi! How I can make attributes view as table with radiobuttons? Not as dropdownlist.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Ecommerce base with radiobuttons

Post by velden »

That is a short description of your problem.
Could you be somewhat more specific?

- Frontpage/backend
- attributes? do you mean 'options'
- do you mean options when adding to cart?
- what relevant modules + versions do you have installed?

Maybe a screenshot or link to page where you want to use it.

Thanks.
cmsmstest
New Member
New Member
Posts: 6
Joined: Wed Jun 11, 2014 6:55 pm

Re: Ecommerce base with radiobuttons

Post by cmsmstest »

I have some attributes for one product with different price for different volume, now user select volume and price from dropdown list (see the screen), but I want make table with lines and radiobutton as
volume1 price1 code1 (*)
volume2 price2 code2 ()
volume3 price3 code3 ()
... etc
Attachments
dropdown.png
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Ecommerce base with radiobuttons

Post by velden »

I guess it comes from AddToCart template of Cart2 module.

Code: Select all

  {* we have multiple options *}
  <select name="{$actionid}cart_options">
    {html_options options=$options}
  </select>
Have a look at the contents of the $options variable. E.g.:

Code: Select all

  {* we have multiple options *}

<!-- {$options|print_r} -->

  <select name="{$actionid}cart_options">
    {html_options options=$options}
  </select>
Have a look at the source code of the webpage and look for the options. Then you can see whether you can build your own form element. Note that the name of that element should be {$actionid}cart_options
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1978
Joined: Mon Jan 29, 2007 4:47 pm

Re: Ecommerce base with radiobuttons

Post by Jo Morg »

This should do the trick:

Code: Select all

{html_radios name="{$actionid}cart_options" options=$options separator='<br />'}
I'm not sure if there is a selected value that you could use to have a preset, but if there is one all the better.
References:
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Post Reply

Return to “Modules/Add-Ons”