Prev | Current Page 413 | Next

Emilian Balanescu and Cristian Darie

"Beginning PHP and MySQL E-Commerce: From Novice to Professional, Second Edition"


Clicking the Edit Attribute Values link for an attribute takes you to a page where you can manage
the possible values for that attribute, as shown in Figure 11-2.
Figure 11-2. Editing product attribute values
CHAPTER 11 ?–  CATALOG ADMINISTRATION: PRODUCTS AND ATTRIBUTES 306
Let??™s implement these features through an exercise, and we??™ll discuss the details afterward.
Exercise: Implementing admin_products
1. Create a new template file named admin_attributes.tpl in the presentation/templates folder
file, and add the following code to it:
{* admin_attributes.tpl *}
{load_presentation_object filename="admin_attributes" assign="obj"}
action="{$obj->mLinkToAttributesAdmin}">

Edit the TShirtShop product attributes:


{if $obj->mErrorMessage}

{$obj->mErrorMessage}

{/if}
{if $obj->mAttributesCount eq 0}


There are no products attributes in your database!


{else}





{section name=i loop=$obj->mAttributes}
{if $obj->mEditItem == $obj->mAttributes[i].attribute_id}


Attribute Name 

value="{$obj->mAttributes[i].name}" size="30" />

name="submit_edit_attr_val_{$obj->mAttributes[i].attribute_id}"
value="Edit Attribute Values" />
name="submit_update_attr_{$obj->mAttributes[i].


Pages:
401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425
hitro projektanci wnętrz Dotyk kadencja5 Edyta Górniak