..
if ($this->_mAction == 'update_val')
{
$attribute_value = $_POST['value'];
if ($attribute_value == null)
$this->mErrorMessage = 'Attribute value is empty';
CHAPTER 11 ?– CATALOG ADMINISTRATION: PRODUCTS AND ATTRIBUTES 313
if ($this->mErrorMessage == null)
{
Catalog::UpdateAttributeValue(
$this->_mActionedAttributeValueId, $attribute_value);
header('Location: ' .
htmlspecialchars_decode(
$this->mLinkToAttributeValuesAdmin));
}
}
// If deleting an attribute value ...
if ($this->_mAction == 'delete_val')
{
$status =
Catalog::DeleteAttributeValue($this->_mActionedAttributeValueId);
if ($status < 0)
$this->mErrorMessage = 'Cannot delete this attribute value. ' .
'One or more products are using it!';
else
header('Location: ' .
htmlspecialchars_decode(
$this->mLinkToAttributeValuesAdmin));
}
// Load the list of attribute values
$this->mAttributeValues =
Catalog::GetAttributeValues($this->mAttributeId);
$this->mAttributeValuesCount = count($this->mAttributeValues);
}
}
?>
5. Open the presentation/templates/admin_menu.tpl file, and add the following highlighted code to
add a link to the attributes admin page:
|
CATALOG ADMIN |
PRODUCTS ATTRIBUTES ADMIN |
STOREFRONT |
LOGOUT |
6.
Pages:
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431