Guest User

Untitled

a guest
Jan 23rd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. $product = new Cart66Product();
  2. $setting = new Cart66Setting();
  3. $products = $product->getModels( 'where id>0', 'order by name' );
  4.  
  5. if ( !empty( $products ) ) {
  6. foreach( $products as $p )
  7. $select_product = array('name' => $p->name, 'value' => $p->itemNumber);
  8. }
  9.  
  10. $meta_boxes[] = array(
  11. 'id' => 'panier_metabox',
  12. 'title' => 'Product Settings',
  13. 'pages' => array('post'), // post type
  14. 'context' => 'normal',
  15. 'priority' => 'high',
  16. 'show_names' => true, // Show field names on the left
  17. 'fields' => array(
  18. array(
  19. 'name' => 'Select a product',
  20. 'desc' => 'You must add your product within the Cart66 "Products" menu before you can select a product from the dropdown.',
  21. 'id' => $prefix . '_item_number',
  22. 'type' => 'select',
  23. 'options' => array(
  24. $select_product
  25. )
  26. ),
Add Comment
Please, Sign In to add comment