This Function Has Been Available Since:
(AFCommerce v 2.1, Functions v 1.1)
Organizes and constructs drop down menus from the database for product attributes.
Description
array = afc_get_product_attributes (pid, langid, mode)
This function complete manages the product attributes feature for this software. Based on the settings you create in the admin area, this function will create all the drop down menus for each product, and this function will return an array with each drop down menu, completely formatted to work with the "add to cart" form on your pages, as a string for each menu. So if you have 3 menus for a product, this function will return an array with 3 elements, and all 3 will contain a string for each menu.
Parameters
pid (integer) - The product id number of the current product.
langid (integer) - The language id number that the customer is viewing your website in.
mode (string) - The mode determines what kind of array is returned by this function. if mode == edit, then the returned array will contain the id numbers of each attribute in sorted order, so they can be managed by the admin area. You do NOT need to do anything with this mode, it's already done for you. Normally, you can just leave mode blank, or add any value to it other than "edit", and it will return an array of strings with the html code for each drop down menu. The "edit" mode is not discussed on this page, except for this message. You should only be concerned with the normal mode, which is when this function creates the drop down menus for you to be displayed on your website.
Return Values
Returns an array of strings with the html code for each entire drop down menu. If you have 3 drop down menus for the product you are calling this function for, then the array returned will have 3 strings in it, which should be accessed by using the number of each element, starting with 0, then 1, then 2, ect. Each string has the entire drop down ("select") menu with all the options you set for it inside the admin area. You do not need to add any additional code to each menu box to make them work correctly, but you may edit the design of them on the getproduct.php page (or your own custom pages that use these menus).
Open Source: NoPaul's Examples There are currently no examples for this function.
|
Back to Functions List
|