Author Topic: 2.0.11c (and 2.0.10 also) Error in jQuery product_edit_custom.php  (Read 2546 times)

DanijelM73

  • Beginner
  • *
  • Posts: 1
2.0.11c (and 2.0.10 also) Error in jQuery product_edit_custom.php
« on: September 19, 2012, 00:17:33 am »
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):
Code: [Select]
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:

Code: [Select]
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

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2047
    • alatak.net
Re: 2.0.11c (and 2.0.10 also) Error in jQuery product_edit_custom.php
« Reply #1 on: September 19, 2012, 10:39:31 am »
Hello,

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