product_id = pa.product_id
WHERE pa.attribute_value_id = inAttributeValueId
INTO productAttributeRowsCount;
IF productAttributeRowsCount = 0 THEN
DELETE FROM attribute_value WHERE attribute_value_id = inAttributeValueId;
SELECT 1;
ELSE
SELECT -1;
END IF;
END$$
11. Load the TShirtShop administration page, and ensure that the attributes administrative features (shown in
Figures 11-1 and 11-2) function correctly.
How It Works: Attributes Administration
Admittedly, writing catalog administration code can become a little bit boring, as it??™s not particularly challenging
but involves writing a lot of code. Nevertheless, a functional control panel is necessary for the well-being of such
a web site (since you??™re reading this book, you can always use its code download if you want).
The important tasks you went through in this exercise follow:
??? Creating the admin_attributes componentized template, which is made of admin_attributes.tpl
and admin_attributes.php. This is the template that implements the page shown in Figure 11-1.
??? Creating the admin_attribute_values componentized template, which is made of admin_attribute_
values.tpl and admin_attribute_values.php. This is the template that implements the attribute values
management feature presented in Figure 11-2.
??? Coding the necessary housekeeping, such as adding links to the new feature in the admin_menu template
(which contains links to all the administrative parts of the site), and the new link building functions in the
Link class.
Pages:
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434