Author Topic: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]  (Read 61494 times)

SteP[IT]

  • Jr. Member
  • **
  • Posts: 198
  • Independent Websites Builder
    • MMC Edizioni - Italian Publisher (First Class PaperBooks)
  • VirtueMart Version: 3.2.6
Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
« Reply #30 on: February 11, 2018, 11:49:30 am »
I can't find where I'm wrong.
I have set this in default.php to get different API outputs:
Code: [Select]
$html = JHTML::_('select.genericlist', $selects,'customProductData['.$product->virtuemart_product_id.']['.$params->virtuemart_custom_id.']['.$params->virtuemart_customfield_id .'][custom_qvariant]','class=customqvariant','value','text',$selects[0],false,true);
$html .= JHTML::_('select.radiolist', $selects, 'customProductData['.$product->virtuemart_product_id.']['.$params->virtuemart_custom_id.']['.$params->virtuemart_customfield_id .'][custom_qvariant]',false,'value','text',$selects[0],false,true);
$html .= JHTML::_('select.suggestionlist', $selects, 'value','text',$selects[0],false,true);

The only one not working is the radiolist, this is the html I'm getting:
Code: [Select]
<span class="product-field-display">
<select id="customProductData11902412105custom_qvariant" name="customProductData[1190][24][12105][custom_qvariant]" class=customqvariant>
<option value="1" selected="selected">1</option>
<option value="2">2</option>
</select>
<div class="controls">
<label for="customProductData[1190][24][12105][custom_qvariant]" id="customProductData[1190][24][12105][custom_qvariant]-lbl" class="radio">

<input type="radio" name="customProductData[1190][24][12105][custom_qvariant]" id="customProductData[1190][24][12105][custom_qvariant]" value=""  />
</label>
<label for="customProductData[1190][24][12105][custom_qvariant]" id="customProductData[1190][24][12105][custom_qvariant]-lbl" class="radio">

<input type="radio" name="customProductData[1190][24][12105][custom_qvariant]" id="customProductData[1190][24][12105][custom_qvariant]" value=""  />
</label>
</div>
<datalist id="Array">
<option value="1">1</option>
<option value="2">2</option>
</datalist>
</span>

I shows that also datalist data are correctly generated, but not the radiolist ones.
Any hint?
Thank you in advance.
J 3.8.5 - VM 3.2.6

MMC EDIZIONI - Italian High-Quality PaperBooks Publisher
Site: https://www.mmcedizioni.it

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2699
  • VirtueMart Version: 3.2.14
Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
« Reply #31 on: February 11, 2018, 15:01:30 pm »
Radiolist should be what you are aiming to create.

If you cannot get it to work with a radiolist you may need to look at the data being created prior to the display.

I do not provide support or development for the plugin - it was created to meet my needs and the needs of another forum member.



regards
A

Joomla 3.8.7
php 5.6 + php 7

SteP[IT]

  • Jr. Member
  • **
  • Posts: 198
  • Independent Websites Builder
    • MMC Edizioni - Italian Publisher (First Class PaperBooks)
  • VirtueMart Version: 3.2.6
Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
« Reply #32 on: February 18, 2018, 17:53:17 pm »
I have sorted it, having spare time to do it.
I have made a simple change, and now you can specify if output has to be rendered as radio, giving the expected radio buttonlist  instead of the original dropdown one.
Are you interested to share with others my mod?

Radiolist should be what you are aiming to create.

If you cannot get it to work with a radiolist you may need to look at the data being created prior to the display.

I do not provide support or development for the plugin - it was created to meet my needs and the needs of another forum member.

J 3.8.5 - VM 3.2.6

MMC EDIZIONI - Italian High-Quality PaperBooks Publisher
Site: https://www.mmcedizioni.it

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2699
  • VirtueMart Version: 3.2.14
Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
« Reply #33 on: February 18, 2018, 19:15:54 pm »
StepIT

Great you got it working  :)

By all means share what you have done and I can consider if I will add it to base code.

Radios are unusual in the context of options - but if you only have a few it could be good to show as a radio option.
regards
A

Joomla 3.8.7
php 5.6 + php 7

SteP[IT]

  • Jr. Member
  • **
  • Posts: 198
  • Independent Websites Builder
    • MMC Edizioni - Italian Publisher (First Class PaperBooks)
  • VirtueMart Version: 3.2.6
Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
« Reply #34 on: February 18, 2018, 19:30:44 pm »
Attached here the file I have changed, you can sort the changes by comparing them with originals.
I found this useful when using few field values, allowing you to have a better global view in mobile viewport.
You have also to add the new admin strings to the .ini language file.

btw, you can see it working here:
https://www.toolware.it/it/prodotti-per-categoria/recupero-posta-elettronica/stellar-ost-to-pst-converter/stellar-phoenix-ost-to-pst-converter
J 3.8.5 - VM 3.2.6

MMC EDIZIONI - Italian High-Quality PaperBooks Publisher
Site: https://www.mmcedizioni.it

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2699
  • VirtueMart Version: 3.2.14
Re: Simple VM3 Product Cart Variant Custom Field / Attribute Plugin [ FREE ]
« Reply #35 on: February 23, 2018, 16:50:46 pm »
StepIT

Nice implementation - looks good

I will take a look and see what I can do with the code you have kindly provided.   :)
regards
A

Joomla 3.8.7
php 5.6 + php 7