2.0.11c (and 2.0.10 also) Error in jQuery product_edit_custom.php

Started by DanijelM73, September 19, 2012, 00:17:33 AM

Previous topic - Next topic

DanijelM73

I am using 2.0.10 and have a problem with adding multiple related categories in custom fields tab:
Example - lets say that I have categories A, B, C,... and products 1, 2, 3....
autocomplete in related categories field is working fine for the first instance - listing categories A, B, C. After adding first related category, autocomplete (for the same field) is listing products 1, 2 3... instead of listing categories..
First workaround is to save afer adding every related category - it works but it is slow..
The problem was here (in product_edit_custom.php):
jQuery('input#relatedproductsSearch').autocomplete({

source: 'index.php?option=com_virtuemart&view=product&task=getData&format=json&type=relatedproducts&row='+nextCustom,
select: function(event, ui){
jQuery("#custom_products").append(ui.item.label);
nextCustom++;
jQuery(this).autocomplete( "option" , 'source' , 'index.php?option=com_virtuemart&view=product&task=getData&format=json&type=relatedproducts&row='+nextCustom )
jQuery('input#relatedcategoriesSearch').autocomplete( "option" , 'source' , 'index.php?option=com_virtuemart&view=product&task=getData&format=json&type=relatedcategories&row='+nextCustom )
},
minLength:1,
html: true
});
jQuery('input#relatedcategoriesSearch').autocomplete({

source: 'index.php?option=com_virtuemart&view=product&task=getData&format=json&type=relatedcategories&row='+nextCustom,
select: function(event, ui){
jQuery("#custom_categories").append(ui.item.label);
nextCustom++;
jQuery(this).autocomplete( "option" , 'source' , 'index.php?option=com_virtuemart&view=product&task=getData&format=json&type=relatedcategories&row='+nextCustom )
jQuery('input#relatedcategoriesSearch').autocomplete( "option" , 'source' , 'index.php?option=com_virtuemart&view=product&task=getData&format=json&type=relatedproducts&row='+nextCustom )
},
minLength:1,
html: true
});


and if you change it to:

jQuery('input#relatedproductsSearch').autocomplete({

source: 'index.php?option=com_virtuemart&view=product&task=getData&format=json&type=relatedproducts&row='+nextCustom,
select: function(event, ui){
jQuery("#custom_products").append(ui.item.label);
nextCustom++;
jQuery(this).autocomplete( "option" , 'source' , 'index.php?option=com_virtuemart&view=product&task=getData&format=json&type=relatedproducts&row='+nextCustom )
jQuery('input#relatedproductsSearch').autocomplete( "option" , 'source' , 'index.php?option=com_virtuemart&view=product&task=getData&format=json&type=relatedproducts&row='+nextCustom )
},
minLength:1,
html: true
});
jQuery('input#relatedcategoriesSearch').autocomplete({

source: 'index.php?option=com_virtuemart&view=product&task=getData&format=json&type=relatedcategories&row='+nextCustom,
select: function(event, ui){
jQuery("#custom_categories").append(ui.item.label);
nextCustom++;
jQuery(this).autocomplete( "option" , 'source' , 'index.php?option=com_virtuemart&view=product&task=getData&format=json&type=relatedcategories&row='+nextCustom )
jQuery('input#relatedcategoriesSearch').autocomplete( "option" , 'source' , 'index.php?option=com_virtuemart&view=product&task=getData&format=json&type=relatedcategories&row='+nextCustom )
},
minLength:1,
html: true
});


Then it works as it should be - listing categories for every time
Sorry bor my bad English...

Keep up the good work

alatak

Hello,

Txs i have fixed. :)
will be available in the next version