VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: lindapowers on May 12, 2015, 13:29:49 PM

Title: Not possible to add new ramifications for Multivariants
Post by: lindapowers on May 12, 2015, 13:29:49 PM
vm 3.0.8 and joomla 3.4.1

Hi

Was testing multi variants for first time while checking the demo also.

The button "new" is not working for new ramifications. Works perfectly in the demo but not in joomla 3.4.1 at least for me,

Regards
Title: Re: Not possible to add new ramifications for Multivariants
Post by: Studio 42 on May 12, 2015, 14:56:20 PM
No javascript bug in browser console?
Title: Re: Not possible to add new ramifications for Multivariants
Post by: lindapowers on May 12, 2015, 15:39:44 PM
Console says 1 error in that page, don't know if this is the one related:

SyntaxError: expected expression, got end of script
index.p...t_id=69 (línea 1, col 79)
GET http://website.com/administrator/index.php?o...virtuemart_product_id=69&type=fields&id=32&row=0
   
200 OK
      420ms   
jquery.min.js (línea 4)
ParámetrosEncabezadosRespuestaJSONCookies

{"table":"customPlugins","value":["\n\t\t\t\t\t<tr class=\"removable\">\n\t\t\t\t\t\t<td>\n\t\t\t\t\t
\t\t<b>Multi variantes<\/b> Multi Variante<\/span><br\/>\n\n\t\t\t\t\t\t\t\t<span class=\"vmicon vmicon-16-default-off
\"><\/span>\n\t\t\t\t\t\t\t\t<span class=\"vmicon vmicon-16-move\"><\/span>\n\t\t\t\t\t\t\t\t<span class
=\"vmicon vmicon-16-remove\"><\/span>\n\n\t\t\t\t\t\t\n\t\t\t<input type=\"hidden\" value=\"C\" name
=\"field[0][field_type]\" \/>\n\t\t\t<input type=\"hidden\" value=\"\" name=\"field[0][custom_element
]\" \/>\n\t\t\t<input type=\"hidden\" value=\"0\" name=\"field[0][custom_jplugin_id]\" \/>\n\t\t\t<input
type=\"hidden\" value=\"32\" name=\"field[0][virtuemart_custom_id]\" \/>\n\t\t\t<input type=\"hidden
\" value=\"69\" name=\"field[0][virtuemart_product_id]\" \/>\n\t\t\t<input type=\"hidden\" value=\"0
\" name=\"field[0][virtuemart_customfield_id]\" \/><input class=\"ordering\" type=\"hidden\" value=\"0
\" name=\"field[0][ordering]\" \/>\n\t\t\t\t\t \t<\/td>\n\t\t\t\t\t\t\t<td colspan=\"2\" ><div style
=\"float:left\"><select id=\"selectoptions0\" name=\"field[0][selectoptions][0][voption]\">\n\t<option
value=\"0\">Por favor seleccione<\/option>\n\t<option value=\"product_name\" selected=\"selected\">Nombre
del producto<\/option>\n\t<option value=\"product_sku\">Ref. del producto<\/option>\n\t<option value
=\"slug\">Alias de Producto<\/option>\n\t<option value=\"product_length\">Longitud de producto<\/option
>\n\t<option value=\"product_width\">Ancho del producto<\/option>\n\t<option value=\"product_height\"
>Altura de producto<\/option>\n\t<option value=\"product_weight\">Peso del producto<\/option>\n\t<option
value=\"clabels\">Usar etiqueta personalizada<\/option>\n<\/select>\n<input type=\"text\" value=\"\"
name=\"field[0][selectoptions][0][clabel]\" style=\"line-height:2em;margin:5px 5px 0;\" \/><textarea
name=\"field[0][selectoptions][0][values]\" rows=\"5\" cols=\"35\" style=\"float:none;margin:5px 5px
0;\" >Naranjas de zumo Baby 10 kg<\/textarea><\/div><div style=\"float:right;max-width:60%;width:45
%;min-width:30%\" >Esto es Multi variantes. Puede crear hasta 5 ramificaciones. Cada l\u00ednea es una
nueva variante. En caso de que haya seleccionado un atributo que existe para el producto, a continuaci
\u00f3n, todas las variantes diferentes de los derivados se enumeran directamente. As\u00ed que en caso
de que intente eliminar una variante utilizada, se a\u00f1ade al final de la lista. <\/br> Los valores
que se muestran en los desplegables son almacenados directamente como valores para el producto.<\/br
> Si utiliza unidades dimensionales, recuerde que las opciones deben tener los mismos decimales que sus
valores almacenados, por ejemplo 40.0000. Puede introducir un n\u00famero en la etiqueta de campo personalizada
para redondear en pantalla.<\/div><div class=\"clear\"><\/div><fieldset style=\"background-color:#b9298b
;\">\n\t\t\t\t\t<legend>Nueva ramificaci\u00f3n<\/legend>\n\t\t\t\t\t<div id=\"new_ramification\"><select
id=\"voption\" name=\"voption\">\n\t<option value=\"0\">Por favor seleccione<\/option>\n\t<option value
=\"product_name\" selected=\"selected\">Nombre del producto<\/option>\n\t<option value=\"product_sku
\">Ref. del producto<\/option>\n\t<option value=\"slug\">Alias de Producto<\/option>\n\t<option value
=\"product_length\">Longitud de producto<\/option>\n\t<option value=\"product_width\">Ancho del producto
<\/option>\n\t<option value=\"product_height\">Altura de producto<\/option>\n\t<option value=\"product_weight
\">Peso del producto<\/option>\n\t<option value=\"clabels\">Usar etiqueta personalizada<\/option>\n<
\/select>\n<input type=\"text\" value=\"\" id=\"vlabel\" name=\"vlabel\" \/><span id=\"new_ramification_bt
\"><span class=\"icon-nofloat vmicon vmicon-16-new\"><\/span>Nuevo<\/span>\n\t\t\t\t\t<\/div>\n\t\t\t
\t<\/fieldset><div class=\"button2-left  btn-wrapper\">\n\t\t\t\t\t\t<div class=\"blank\"><a href=\"
\/administrator\/index.php?option=com_virtuemart&amp;view=product&amp;task=createChild&amp;virtuemart_product_id
=69&amp;a827a6d2e581086473e93aa7412a42df=1&amp;target=parent\" class=\"btn btn-small\">A\u00f1adir producto
derivado<\/a><\/div>\n\t\t\t\t\t<\/div><div class=\"clear\"><\/div><table id=\"syncro\"><tr>\n<th style
=\"text-align: left !important;width:130px;\">#<\/th><th style=\"text-align: left !important;width:90px
;\">Ref. del producto<\/th><th style=\"text-align: left !important;width:80px;\">GTIN (EAN,ISBN)<\/th
>\n<th style=\"text-align: left !important;\" width=\"5%\">Precio de coste<\/th>\n<th style=\"text-align
: left !important;width:30px;\">En Stock<\/th>\n<th style=\"text-align: left !important;width:30px;\"
>Reservado, pedido<\/th><th>Nombre de producto<\/th><\/tr><tr class=\"row1\"><td><a href=\"\/administrator
\/index.php?option=com_virtuemart&amp;view=product&amp;task=edit&amp;virtuemart_product_id=69\" title
=\"Editar naranjas-de-zumo-baby-10-kg\">69->69 naranjas-de-zumo-baby-10-kg<\/a><\/td><td><input readonly
=\"readonly\" class=\"readonly\" type=\"text\" name=\"childs[69][product_sku]\" id=\"child69product_sku
\" size=\"20\" maxlength=\"64\" value=\"narbaby\" \/><\/td><td><input readonly=\"readonly\" class=\"readonly
\" type=\"text\" name=\"childs[69][product_gtin]\" id=\"child69product_gtin\" size=\"13\" maxlength=
\"13\" value=\"\" \/><\/td><td><input readonly=\"readonly\" class=\"readonly\" type=\"text\" name=\"childs
[69][mprices][product_price][]\" size=\"8\" value=\"4.807690\" \/>\n\t\t<input type=\"hidden\" name=
\"childs[69][mprices][virtuemart_product_price_id][]\" value=\"65\"  ><\/td><td>2147483471<\/td><td>44
<\/td><td><select id=\"cvard.69s0\" name=\"childs[69][product_name]\" class=\"cvard\">\n\t<option value
=\"0\">Por favor seleccione<\/option>\n\t<option value=\"Naranjas de zumo Baby 10 kg\" selected=\"selected
\">Naranjas de zumo Baby 10 kg<\/option>\n<\/select>\n<input type=\"hidden\" name=\"field[0][options
][69][0]\" value=\"Naranjas de zumo Baby 10 kg\" \/><\/td><\/tr><tr class=\"row0\"><td><a href=\"\/administrator
\/index.php?option=com_virtuemart&amp;view=product&amp;task=edit&amp;virtuemart_product_id=181\" title
=\"Editar naranjas-de-zumo-baby-10-kg-1\">69->181 naranjas-de-zumo-baby-10-kg-1<\/a><\/td><td><input
  class=\"inputbox\" type=\"text\" name=\"childs[181][product_sku]\" id=\"child181product_sku\" size
=\"20\" maxlength=\"64\" value=\"\" \/><\/td><td><input  class=\"inputbox\" type=\"text\" name=\"childs
[181][product_gtin]\" id=\"child181product_gtin\" size=\"13\" maxlength=\"13\" value=\"\" \/><\/td><td
><input  class=\"inputbox\" type=\"text\" name=\"childs[181][mprices][product_price][]\" size=\"8\" value
=\"\" \/>\n\t\t<input type=\"hidden\" name=\"childs[181][mprices][virtuemart_product_price_id][]\" value
=\"0\"  ><\/td><td>0<\/td><td>0<\/td><td><select id=\"cvard.181s0\" name=\"childs[181][product_name]
\" class=\"cvard\">\n\t<option value=\"0\">Por favor seleccione<\/option>\n\t<option value=\"Naranjas
de zumo Baby 10 kg\" selected=\"selected\">Naranjas de zumo Baby 10 kg<\/option>\n<\/select>\n<input
type=\"hidden\" name=\"field[0][options][181][0]\" value=\"Naranjas de zumo Baby 10 kg\" \/><\/td><
\/tr><\/table><\/td>\n\t\t\t\t\t\t <\/tr>\n\t\t\t\t\t<\/tr>"],"ok":1}
Title: Re: Not possible to add new ramifications for Multivariants
Post by: Studio 42 on May 12, 2015, 17:23:25 PM
The script is not corretly inserted the first time you use multi variant.
YOu have to save the product, then you can add new ramification after.

THis is because:
<script id="new_ramification_js" type="text/javascript">//<![CDATA[
jQuery( function($) {
$('#new_ramification_bt').click(function() {
var Prod = $('.new_ramification');//obsolete?

var voption = jQuery('#voption').val();
var label = jQuery('#vlabel').val();
//console.log ('my label '+label);
form = document.getElementById('adminForm');
var newdiv = document.createElement('div');
newdiv.innerHTML = '<input type="text" value="'+voption+'" name="field[0][selectoptions][1][voption]" /><input type="text" value="'+label+'" name="field[0][selectoptions][1][clabel]" />';
form.appendChild(newdiv);

form.task.value = 'apply';
form.submit();
return false;
});
}); //]]>
</script>


jQuery( function($) { is not needed here and using it so shoud work, but is you now only max can update this.
<script id="new_ramification_js" type="text/javascript">//<![CDATA[
$('#new_ramification_bt').click(function() {
var Prod = $('.new_ramification');//obsolete?

var voption = jQuery('#voption').val();
var label = jQuery('#vlabel').val();
//console.log ('my label '+label);
form = document.getElementById('adminForm');
var newdiv = document.createElement('div');
newdiv.innerHTML = '<input type="text" value="'+voption+'" name="field[0][selectoptions][1][voption]" /><input type="text" value="'+label+'" name="field[0][selectoptions][1][clabel]" />';
form.appendChild(newdiv);

form.task.value = 'apply';
form.submit();
return false;
});
//]]>
</script>


I don't have tested it, but in all case currently script cannot work
Title: Re: Not possible to add new ramifications for Multivariants
Post by: lindapowers on May 13, 2015, 12:59:41 PM
We don't really need Multivariants, was just testing them, but good to know there seems to be a little conflict there...
Title: Re: Not possible to add new ramifications for Multivariants
Post by: crn on June 24, 2015, 17:20:01 PM
I DO need multivariants...has anyone had any success with this feature?
Title: Re: Not possible to add new ramifications for Multivariants
Post by: Milbo on June 24, 2015, 20:01:24 PM
yes a lot, the post is very old. We have vm3.0.9.4 now
Title: Re: Not possible to add new ramifications for Multivariants
Post by: crn on June 24, 2015, 21:19:55 PM
I am using VirtueMart 3.0.6.2.  Is there any type of updated procedure for creating multivariant products with the new release?  I create the custom field, add ramifications and only blank drop downs appear.
Title: Re: Not possible to add new ramifications for Multivariants
Post by: jenkinhill on June 24, 2015, 23:49:10 PM
@crn you should be using a least VM3.0.8 now http://virtuemart.net/news/latest-news/469-security-release-vm3-0-8  (there are reasons why updates are released).

Current latest is VM3.0.9.4  available on http://dev.virtuemart.net/projects/virtuemart/files
Title: Re: Not possible to add new ramifications for Multivariants
Post by: lindapowers on October 03, 2015, 05:51:34 AM
Just to let you know, this still happens in vm 3.0.10 the button "new" in multivariants is not working for new ramifications.
Title: Re: Not possible to add new ramifications for Multivariants
Post by: Milbo on October 04, 2015, 21:38:09 PM
I am sure it works on our demo.virtuemart.net
Title: Re: Not possible to add new ramifications for Multivariants
Post by: lindapowers on October 06, 2015, 02:55:10 AM
Quote from: Milbo on October 04, 2015, 21:38:09 PM
I am sure it works on our demo.virtuemart.net

Yes it works in the demo for joomla 2.5 it doesnt work in joomla 3.4.4

Would be nice if you guys updated the demo to 3.5 series, 2.5 doesn't act the same in many features.


Regards
Title: Re: Not possible to add new ramifications for Multivariants
Post by: Milbo on October 09, 2015, 08:51:11 AM
Maybe the reason is simpler: http://docs.virtuemart.net/tutorials/product-creation/221-multivariant.html

"Remind to store the product always, after adding new rambifications."
Title: Re: Not possible to add new ramifications for Multivariants
Post by: stawebnice on February 07, 2016, 00:27:41 AM
Hi Max,

I finally got to creating the video tutorial how to use multivariant with virtuemart 3.0.12. I know I promissed it  long time ago :)
The video is with Czech commentary, but the backend is in English, so everybody can see how to set it up and use it.

http://www.stawebnice.com/virtuemart-3-video-navod-pouziti-multivarianty (http://www.stawebnice.com/virtuemart-3-video-navod-pouziti-multivarianty)
Title: Re: Not possible to add new ramifications for Multivariants
Post by: Milbo on February 07, 2016, 15:26:56 PM
Nice, :-)