well though i'd continue my ramblings, so i've tracked it down to failing (using the option to add categories for this exmaple) to whats happening in here, in advshipper_method_config.js
Code:
_cba.query( _url,
function()
{
I'm pretty stuck at this point as everything upto this point works, the cba.js is present and working, and still same version as current one. however within the function thats placed into the callback above, i know its not getting so far as to call the advshipperUpdateCategoryList() function, nor is it calling the alert for "already in list" so its failing somewhere inbetween... no idea why, welcome your thoughts.
Full code of above function here:
Code:
_cba.query( _url,
function()
{
_add_categories_return_values = _cba.answer;
if (_add_categories_return_values == '-1') {
// Unable to add categories
} else {
var _categories_info = _add_categories_return_values.split('||');
for (var categories_info_i = 0, num_categories_info = _categories_info.length;
categories_info_i < num_categories_info; categories_info_i++) {
var _category_info = _categories_info[categories_info_i].split('|');
// Make sure this category isn't already in the list
var _category_in_list = false;
for (category_i = 0, num_categories = categories.length;
category_i < num_categories; category_i++) {
if (categories[category_i].category_id ==
_category_info[0]) {
// Category already in list
_categories_already_in_list.push(_category_info[1]);
_category_in_list = true;
break;
}
}
if (!_category_in_list) {
// Add the information for this category to the list of categories
var new_category_i = categories.length;
categories[new_category_i] = new Object();
categories[new_category_i].category_id = _category_info[0];
categories[new_category_i].name = _category_info[1];
advshipperUpdateCategoryList(categories[new_category_i].category_id,
categories[new_category_i].name);
}
}
var _num_categories_already_in_list = _categories_already_in_list.length;
if (_num_categories_already_in_list > 0) {
if (_num_categories_already_in_list == 1) {
if (_num_categories_selected == 1) {
alert('<?php echo JS_TEXT_CATEGORY_IN_LIST_SELECTED; ?>');
} else {
alert('<?php echo JS_TEXT_CATEGORY_IN_LIST_SINGLE; ?>' + '\n\n' +
_categories_already_in_list);
}
} else {
if (_num_categories_already_in_list == _num_categories_selected) {
alert('<?php echo JS_TEXT_CATEGORIES_IN_LIST_ALL; ?>');
} else {
alert('<?php echo JS_TEXT_CATEGORIES_IN_LIST; ?>' + '\n\n' +
_categories_already_in_list.join('\n'));
}
}
}
}
},
false );
}
}
Bookmarks