PHP 7.2.6 zen v 1.56c, alot of plugins
i am trying to merge my admin categories.php changes from v 1.51 into 1.56c and need help, i dont know where this part goes
Code:
// attributes copy to category
case 'update_attributes_copy_to_category':
$copy_attributes_delete_first = ($_POST['copy_attributes'] == 'copy_attributes_delete' ? '1' : '0');
$copy_attributes_duplicates_skipped = ($_POST['copy_attributes'] == 'copy_attributes_ignore' ? '1' : '0');
$copy_attributes_duplicates_overwrite = ($_POST['copy_attributes'] == 'copy_attributes_update' ? '1' : '0');
$copy_to_category = $db->Execute("select products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id='" . (int) $_POST['categories_update_id'] . "'");
while (!$copy_to_category->EOF) {
zen_copy_products_attributes($_POST['products_id'], $copy_to_category->fields['products_id']);
$copy_to_category->MoveNext();
}
// die('CATEGORIES - I would copy Product ID#' . $_POST['products_id'] . ' to a Category ID#' . $_POST['categories_update_id'] . ' - Existing attributes ' . $_POST['copy_attributes'] . ' Total Products ' . $copy_to_category->RecordCount());
$_GET['action'] = '';
zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $_GET['products_id'] . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')));
break;
case 'new_product':
if (isset($_GET['product_type'])) {
// see if this category is restricted
$pieces = explode('_', $_GET['cPath']);
$cat_id = $pieces[sizeof($pieces) - 1];
// echo $cat_id;
$sql = "select product_type_id from " . TABLE_PRODUCT_TYPES_TO_CATEGORY . " where category_id = '" . (int) $cat_id . "'";
$product_type_list = $db->Execute($sql);
$sql = "select product_type_id from " . TABLE_PRODUCT_TYPES_TO_CATEGORY . " where category_id = '" . (int) $cat_id . "' and product_type_id = '" . (int) $_GET['product_type'] . "'";
$product_type_good = $db->Execute($sql);
if ($product_type_list->RecordCount() < 1 || $product_type_good->RecordCount() > 0) {
$url = zen_get_all_get_params();
$sql = "select type_handler from " . TABLE_PRODUCT_TYPES . " where type_id = '" . (int) $_GET['product_type'] . "'";
$handler = $db->Execute($sql);
zen_redirect(zen_href_link($handler->fields['type_handler'] . '.php', zen_get_all_get_params()));
} else {
$messageStack->add(ERROR_CANNOT_ADD_PRODUCT_TYPE, 'error');
}
}
break;
}
if ($action != 'new_category') {
$categery_id = $_GET['cID'];
$cal_sql = "select calculator_mode from " .TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" .$categery_id. "'";
$categ_ar = $db->Execute($cal_sql);
$cal_modes = $categ_ar->fields['calculator_mode'];
$cal_array[] = array('id' => 0, 'text' => 'None');
$cal_array[] = array('id' => 1, 'text' => 'Calculator 1');
$cal_array[] = array('id' => 2, 'text' => 'Calculator 2');
} else {
$cal_array[] = array('id' => 0, 'text' => 'None');
$cal_array[] = array('id' => 1, 'text' => 'Calculator 1');
$cal_array[] = array('id' => 2, 'text' => 'Calculator 2');
}
}
// check
// check if the catalog image directory exists
if (is_dir(DIR_FS_CATALOG_IMAGES)) {
if (!is_writeable(DIR_FS_CATALOG_IMAGES))
$messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error');
} else {
$messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST, 'error');
}
?>
Bookmarks