': ' .
$catalog_attributes[$i]['attribute_value'];
if (count($product_categories) == 1)
$this->mRemoveFromCategoryButtonDisabled = true;
// Show the categories the product belongs to
for ($i = 0; $i < count($product_categories); $i++)
$temp1[$product_categories[$i]['category_id']] =
$product_categories[$i]['name'];
$this->mRemoveFromCategories = $temp1;
$this->mProductCategoriesString = implode(', ', $temp1);
$all_categories = Catalog::GetCategories();
for ($i = 0; $i < count($all_categories); $i++)
$temp2[$all_categories[$i]['category_id']] =
$all_categories[$i]['name'];
$this->mAssignOrMoveTo = array_diff($temp2, $temp1);
}
}
?>
5. Open the presentation/link.php file, and add the following method at the end of the Link class:
// Create link to product details administration page
public static function ToProductAdmin($departmentId, $categoryId, $productId)
{
$link = 'Page=ProductDetails&DepartmentId=' . $departmentId .
'&CategoryId=' . $categoryId . '&ProductId=' . $productId;
CHAPTER 11 ?– CATALOG ADMINISTRATION: PRODUCTS AND ATTRIBUTES 338
return self::ToAdmin($link);
}
6. Modify the init() method in StoreAdmin class in store_admin.php to load the
admin_product_details componentized template:
// Choose what admin page to load ...
if ($admin_page == 'Departments')
$this->mContentsCell = 'admin_departments.tpl';
elseif ($admin_page == 'Categories')
$this->mContentsCell = 'admin_categories.
Pages:
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451