Created
August 22, 2011 20:12
-
-
Save thefrosty/1163397 to your computer and use it in GitHub Desktop.
Looking for select array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$product = new Cart66Product(); | |
$setting = new Cart66Setting(); | |
$products = $product->getModels( 'where id>0', 'order by name' ); | |
if ( !empty( $products ) ) { | |
foreach( $products as $p ) | |
$select_product = array('name' => $p->name, 'value' => $p->itemNumber); | |
} | |
$meta_boxes[] = array( | |
'id' => 'panier_metabox', | |
'title' => 'Product Settings', | |
'pages' => array('post'), // post type | |
'context' => 'normal', | |
'priority' => 'high', | |
'show_names' => true, // Show field names on the left | |
'fields' => array( | |
array( | |
'name' => 'Select a product', | |
'desc' => 'You must add your product within the Cart66 "Products" menu before you can select a product from the dropdown.', | |
'id' => $prefix . '_item_number', | |
'type' => 'select', | |
'options' => array( | |
$select_product | |
) | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$product = new Cart66Product(); | |
$products = $product->getModels( 'where id>0', 'order by name' ); | |
if ( !empty( $products ) ) { | |
foreach( $products as $p ) | |
$select_product = array('name' => $p->name, 'value' => $p->itemNumber); | |
} | |
$meta_boxes[] = array( | |
'id' => 'panier_metabox', | |
'title' => 'Product Settings', | |
'pages' => array('post'), // post type | |
'context' => 'normal', | |
'priority' => 'high', | |
'show_names' => true, // Show field names on the left | |
'fields' => array( | |
array( | |
'name' => 'Select a product', | |
'desc' => 'You must add your product within the Cart66 "Products" menu before you can select a product from the dropdown.', | |
'id' => $prefix . '_item_number', | |
'type' => 'select', | |
'options' => array( | |
$select_product | |
) | |
), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment