Ocultados campos especiales de los productos (stock, peso, proveedor, etc)
git-svn-id: https://192.168.0.254/svn/Proyectos.OriginalHouse_Web/trunk@57 54e8636e-a86c-764f-903d-b964358a1ae2
This commit is contained in:
parent
32dc63b856
commit
18e8376c8a
@ -53,7 +53,7 @@ class ProductCustomPostType {
|
|||||||
'capability_type' => 'post',
|
'capability_type' => 'post',
|
||||||
'hierarchical' => false, //allways false
|
'hierarchical' => false, //allways false
|
||||||
'query_var' => true,
|
'query_var' => true,
|
||||||
'supports' => array( 'title', 'excerpt', 'editor', 'thumbnail'),
|
'supports' => array( 'title', /*'excerpt',*/ 'editor', 'thumbnail'),
|
||||||
'taxonomies' => array( ProductCustomPostType::$PRODUCT_CATEGORY ), // Permalinks format
|
'taxonomies' => array( ProductCustomPostType::$PRODUCT_CATEGORY ), // Permalinks format
|
||||||
'rewrite' => array( 'slug' => isset( $thecartpress->settings['product_rewrite'] ) ? $thecartpress->settings['product_rewrite'] : 'products' ),
|
'rewrite' => array( 'slug' => isset( $thecartpress->settings['product_rewrite'] ) ? $thecartpress->settings['product_rewrite'] : 'products' ),
|
||||||
'has_archive' => isset( $thecartpress->settings['product_rewrite'] ) && $thecartpress->settings['product_rewrite'] != '' ? $thecartpress->settings['product_rewrite'] : 'products',
|
'has_archive' => isset( $thecartpress->settings['product_rewrite'] ) && $thecartpress->settings['product_rewrite'] != '' ? $thecartpress->settings['product_rewrite'] : 'products',
|
||||||
@ -84,14 +84,14 @@ class ProductCustomPostType {
|
|||||||
'rewrite' => array('slug' => isset( $thecartpress->settings['category_rewrite'] ) ? $thecartpress->settings['category_rewrite'] : 'product_category' ), //false
|
'rewrite' => array('slug' => isset( $thecartpress->settings['category_rewrite'] ) ? $thecartpress->settings['category_rewrite'] : 'product_category' ), //false
|
||||||
);
|
);
|
||||||
register_taxonomy( ProductCustomPostType::$PRODUCT_CATEGORY, ProductCustomPostType::$PRODUCT, $register );
|
register_taxonomy( ProductCustomPostType::$PRODUCT_CATEGORY, ProductCustomPostType::$PRODUCT, $register );
|
||||||
register_taxonomy( ProductCustomPostType::$PRODUCT_TAG, ProductCustomPostType::$PRODUCT, array(
|
/*register_taxonomy( ProductCustomPostType::$PRODUCT_TAG, ProductCustomPostType::$PRODUCT, array(
|
||||||
'public' => true,
|
'public' => true,
|
||||||
'hierarchical' => false,
|
'hierarchical' => false,
|
||||||
'query_var' => true,
|
'query_var' => true,
|
||||||
'rewrite' => array('slug' => isset( $thecartpress->settings['tag_rewrite'] ) ? $thecartpress->settings['tag_rewrite'] : 'product_tag' ), //false
|
'rewrite' => array('slug' => isset( $thecartpress->settings['tag_rewrite'] ) ? $thecartpress->settings['tag_rewrite'] : 'product_tag' ), //false
|
||||||
'label' => __( 'Products Tags', 'tcp' ),
|
'label' => __( 'Products Tags', 'tcp' ),
|
||||||
) );
|
) );*/
|
||||||
register_taxonomy( ProductCustomPostType::$SUPPLIER_TAG, ProductCustomPostType::$PRODUCT, array(
|
/*register_taxonomy( ProductCustomPostType::$SUPPLIER_TAG, ProductCustomPostType::$PRODUCT, array(
|
||||||
'hierarchical' => true,
|
'hierarchical' => true,
|
||||||
'query_var' => true,
|
'query_var' => true,
|
||||||
'rewrite' => array('slug' => isset( $thecartpress->settings['supplier_rewrite'] ) ? $thecartpress->settings['supplier_rewrite'] : 'product_supplier' ), //false
|
'rewrite' => array('slug' => isset( $thecartpress->settings['supplier_rewrite'] ) ? $thecartpress->settings['supplier_rewrite'] : 'product_supplier' ), //false
|
||||||
@ -105,7 +105,7 @@ class ProductCustomPostType {
|
|||||||
'add_new_item' => __( 'Add New Suppliers', 'tcp' ),
|
'add_new_item' => __( 'Add New Suppliers', 'tcp' ),
|
||||||
'new_item_name' => __( 'New Suppliers Name', 'tcp' ),
|
'new_item_name' => __( 'New Suppliers Name', 'tcp' ),
|
||||||
),
|
),
|
||||||
) );
|
) );*/
|
||||||
|
|
||||||
if ( is_admin() ) {
|
if ( is_admin() ) {
|
||||||
add_action( 'manage_posts_custom_column', array( $this, 'managePostCustomColumns' ) );
|
add_action( 'manage_posts_custom_column', array( $this, 'managePostCustomColumns' ) );
|
||||||
@ -114,7 +114,7 @@ class ProductCustomPostType {
|
|||||||
add_filter( 'request', array( $this, 'request' ) ); //TODO 3.1
|
add_filter( 'request', array( $this, 'request' ) ); //TODO 3.1
|
||||||
add_filter( 'posts_orderby', array( $this, 'defaultPostOrder' ) );
|
add_filter( 'posts_orderby', array( $this, 'defaultPostOrder' ) );
|
||||||
//for quick edit
|
//for quick edit
|
||||||
add_action('quick_edit_custom_box', array( $this, 'quickEditCustomBox' ), 10, 2 );
|
//add_action('quick_edit_custom_box', array( $this, 'quickEditCustomBox' ), 10, 2 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -236,12 +236,14 @@ class ProductCustomPostType {
|
|||||||
'show_count' => true,
|
'show_count' => true,
|
||||||
'hide_empty' => true,
|
'hide_empty' => true,
|
||||||
) );?>
|
) );?>
|
||||||
<label for="tcp_product_type"><?php _e( 'type:', 'tcp' );?><label>
|
<?php if (0) { ?>
|
||||||
|
<label for="tcp_product_type"><?php _e( 'type:', 'tcp' );?><label>
|
||||||
<select name="tcp_product_type" id="tcp_product_type">
|
<select name="tcp_product_type" id="tcp_product_type">
|
||||||
<option value="" <?php selected( "", isset( $_REQUEST['tcp_product_type'] ) ? $_REQUEST['tcp_product_type'] : '' );?>><?php _e( 'all', 'tcp' );?></option>
|
<option value="" <?php selected( "", isset( $_REQUEST['tcp_product_type'] ) ? $_REQUEST['tcp_product_type'] : '' );?>><?php _e( 'all', 'tcp' );?></option>
|
||||||
<option value="SIMPLE" <?php selected( "SIMPLE", isset( $_REQUEST['tcp_product_type'] ) ? $_REQUEST['tcp_product_type'] : '' );?>><?php _e( 'Simple', 'tcp' );?></option>
|
<option value="SIMPLE" <?php selected( "SIMPLE", isset( $_REQUEST['tcp_product_type'] ) ? $_REQUEST['tcp_product_type'] : '' );?>><?php _e( 'Simple', 'tcp' );?></option>
|
||||||
<option value="GROUPED" <?php selected( "GROUPED", isset( $_REQUEST['tcp_product_type'] ) ? $_REQUEST['tcp_product_type'] : '' );?>><?php _e( 'Grouped', 'tcp' );?></option>
|
<option value="GROUPED" <?php selected( "GROUPED", isset( $_REQUEST['tcp_product_type'] ) ? $_REQUEST['tcp_product_type'] : '' );?>><?php _e( 'Grouped', 'tcp' );?></option>
|
||||||
</select>
|
</select>
|
||||||
|
<?php } ?>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,49 +47,52 @@ class ProductCustomFieldsMetabox {
|
|||||||
if ( $post_id > 0 )
|
if ( $post_id > 0 )
|
||||||
$tcp_product_parent_id = RelEntities::getParent( $post_id );
|
$tcp_product_parent_id = RelEntities::getParent( $post_id );
|
||||||
}?>
|
}?>
|
||||||
<ul class="subsubsub">
|
<?php if (0) { ?>
|
||||||
<?php
|
<ul class="subsubsub">
|
||||||
$admin_path = 'admin.php?page=' . plugin_basename( dirname( dirname( __FILE__ ) ) ) . '/admin/';
|
<?php
|
||||||
$count = RelEntities::count( $post_id );
|
$admin_path = 'admin.php?page=' . plugin_basename( dirname( dirname( __FILE__ ) ) ) . '/admin/';
|
||||||
if ( $count > 0 ) $count = ' (' . $count . ')';
|
$count = RelEntities::count( $post_id );
|
||||||
else $count = '';
|
if ( $count > 0 ) $count = ' (' . $count . ')';
|
||||||
$product_type = tcp_get_the_product_type( $post_id );
|
else $count = '';
|
||||||
if ( $product_type != '' && $product_type != 'SIMPLE' ) :?>
|
$product_type = tcp_get_the_product_type( $post_id );
|
||||||
<li><a href="<?php echo $admin_path;?>AssignedProductsList.php&post_id=<?php echo $post_id;?>&rel_type=GROUPED"><?php _e( 'assigned products', 'tcp' );?><?php echo $count;?></a></li>
|
if ( $product_type != '' && $product_type != 'SIMPLE' ) :?>
|
||||||
<li>|</li>
|
<li><a href="<?php echo $admin_path;?>AssignedProductsList.php&post_id=<?php echo $post_id;?>&rel_type=GROUPED"><?php _e( 'assigned products', 'tcp' );?><?php echo $count;?></a></li>
|
||||||
<li><a href="post-new.php?post_type=<?php echo ProductCustomPostType::$PRODUCT;?>&tcp_product_parent_id=<?php echo $post_id;?>"><?php _e( 'create new assigned product', 'tcp' );?></a></li>
|
<li>|</li>
|
||||||
<?php endif;
|
<li><a href="post-new.php?post_type=<?php echo ProductCustomPostType::$PRODUCT;?>&tcp_product_parent_id=<?php echo $post_id;?>"><?php _e( 'create new assigned product', 'tcp' );?></a></li>
|
||||||
$count = RelEntities::count( $post_id, 'PROD-PROD' );
|
<?php endif;
|
||||||
if ( $count > 0 ) $count = ' (' . $count . ')';
|
$count = RelEntities::count( $post_id, 'PROD-PROD' );
|
||||||
else $count = '';?>
|
if ( $count > 0 ) $count = ' (' . $count . ')';
|
||||||
<?php if ( $product_type != '' && $product_type != 'SIMPLE' ) : ?>
|
else $count = '';?>
|
||||||
<li>|</li>
|
<?php if ( $product_type != '' && $product_type != 'SIMPLE' ) : ?>
|
||||||
<?php endif;?>
|
<li>|</li>
|
||||||
<li><a href="<?php echo $admin_path;?>AssignedProductsList.php&post_id=<?php echo $post_id;?>&rel_type=PROD-PROD"><?php _e( 'related products', 'tcp' );?> <?php echo $count;?></a></li>
|
<?php endif;?>
|
||||||
<?php $count = RelEntities::count( $post_id, 'PROD-POST' );
|
<li><a href="<?php echo $admin_path;?>AssignedProductsList.php&post_id=<?php echo $post_id;?>&rel_type=PROD-PROD"><?php _e( 'related products', 'tcp' );?> <?php echo $count;?></a></li>
|
||||||
if ( $count > 0 ) $count = ' (' . $count . ')';
|
<?php $count = RelEntities::count( $post_id, 'PROD-POST' );
|
||||||
else $count = '';?>
|
if ( $count > 0 ) $count = ' (' . $count . ')';
|
||||||
<li>|</li>
|
else $count = '';?>
|
||||||
<li><a href="<?php echo $admin_path;?>AssignedProductsList.php&post_id=<?php echo $post_id;?>&post_type_to=post&rel_type=PROD-POST"><?php _e( 'related posts', 'tcp' );?> <?php echo $count;?></a></li>
|
<li>|</li>
|
||||||
<?php if ( $tcp_product_parent_id > 0 ) :?>
|
<li><a href="<?php echo $admin_path;?>AssignedProductsList.php&post_id=<?php echo $post_id;?>&post_type_to=post&rel_type=PROD-POST"><?php _e( 'related posts', 'tcp' );?> <?php echo $count;?></a></li>
|
||||||
<li>|</li>
|
<?php if ( $tcp_product_parent_id > 0 ) :?>
|
||||||
<li><a href="<?php echo $admin_path;?>AssignedProductsList.php&post_id=<?php echo $tcp_product_parent_id;?>&rel_type=GROUPED"><?php _e( 'parent assigned products', 'tcp' );?> <?php echo $count;?></a></li>
|
<li>|</li>
|
||||||
<li>|</li>
|
<li><a href="<?php echo $admin_path;?>AssignedProductsList.php&post_id=<?php echo $tcp_product_parent_id;?>&rel_type=GROUPED"><?php _e( 'parent assigned products', 'tcp' );?> <?php echo $count;?></a></li>
|
||||||
<li><a href="post.php?action=edit&post=<?php echo $tcp_product_parent_id;?>"><?php printf( __( 'edit parent product (%s)', 'tcp' ), get_the_title( $tcp_product_parent_id ) );?></a></li>
|
<li>|</li>
|
||||||
<?php endif;?>
|
<li><a href="post.php?action=edit&post=<?php echo $tcp_product_parent_id;?>"><?php printf( __( 'edit parent product (%s)', 'tcp' ), get_the_title( $tcp_product_parent_id ) );?></a></li>
|
||||||
<?php if ( tcp_is_downloadable( $post_id ) ) :?>
|
<?php endif;?>
|
||||||
<li>|</li>
|
<?php if ( tcp_is_downloadable( $post_id ) ) :?>
|
||||||
<li><a href="<?php echo $admin_path;?>UploadFiles.php&post_id=<?php echo $post_id;?>"><?php echo __( 'file upload', 'tcp' ), $count;?></a></li>
|
<li>|</li>
|
||||||
<?php endif;?>
|
<li><a href="<?php echo $admin_path;?>UploadFiles.php&post_id=<?php echo $post_id;?>"><?php echo __( 'file upload', 'tcp' ), $count;?></a></li>
|
||||||
<?php do_action( 'tcp_product_metabox_toolbar', $post_id );?>
|
<?php endif;?>
|
||||||
</ul>
|
<?php do_action( 'tcp_product_metabox_toolbar', $post_id );?>
|
||||||
|
</ul>
|
||||||
|
<?php } ?>
|
||||||
<?php if ( $create_grouped_relation ): ?>
|
<?php if ( $create_grouped_relation ): ?>
|
||||||
<input type="hidden" name="tcp_product_parent_id" value="<?php echo $tcp_product_parent_id;?>" />
|
<input type="hidden" name="tcp_product_parent_id" value="<?php echo $tcp_product_parent_id;?>" />
|
||||||
<?php endif;?>
|
<?php endif;?>
|
||||||
<div class="form-wrap">
|
<div class="form-wrap">
|
||||||
<?php wp_nonce_field( 'tcp-product-custom-fields', 'tcp-product-custom-fields_wpnonce', false, true );?>
|
<?php wp_nonce_field( 'tcp-product-custom-fields', 'tcp-product-custom-fields_wpnonce', false, true );?>
|
||||||
<table class="form-table"><tbody>
|
<table class="form-table"><tbody>
|
||||||
<tr valign="top">
|
<?php if (0) { ?>
|
||||||
|
<tr valign="top">
|
||||||
<th scope="row"><label for="tcp_type"><?php _e( 'Type', 'tcp' );?>:</label></th>
|
<th scope="row"><label for="tcp_type"><?php _e( 'Type', 'tcp' );?>:</label></th>
|
||||||
<td><select name="tcp_type" id="tcp_type">
|
<td><select name="tcp_type" id="tcp_type">
|
||||||
<option value="SIMPLE" <?php selected( $product_type, 'SIMPLE' );?>><?php _e( 'Simple', 'tcp' );?></option>
|
<option value="SIMPLE" <?php selected( $product_type, 'SIMPLE' );?>><?php _e( 'Simple', 'tcp' );?></option>
|
||||||
@ -97,10 +100,12 @@ class ProductCustomFieldsMetabox {
|
|||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<?php } ?>
|
||||||
<tr valign="top">
|
<tr valign="top">
|
||||||
<th scope="row"><label for="tcp_price"><?php _e( 'Price', 'tcp' );?>:</label></th>
|
<th scope="row"><label for="tcp_price"><?php _e( 'Price', 'tcp' );?>:</label></th>
|
||||||
<td><input name="tcp_price" id="tcp_price" value="<?php echo tcp_number_format( tcp_get_the_price( $post_id ) );?>" class="regular-text" type="text" style="width:12em" /> <?php tcp_the_currency();?></td>
|
<td><input name="tcp_price" id="tcp_price" value="<?php echo tcp_number_format( tcp_get_the_price( $post_id ) );?>" class="regular-text" type="text" style="width:12em" /> <?php tcp_the_currency();?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<?php if (0) { ?>
|
||||||
<tr valign="top">
|
<tr valign="top">
|
||||||
<th scope="row"><label for="tcp_tax_id"><?php _e( 'Tax', 'tcp' );?>:</label></th>
|
<th scope="row"><label for="tcp_tax_id"><?php _e( 'Tax', 'tcp' );?>:</label></th>
|
||||||
<td>
|
<td>
|
||||||
@ -122,7 +127,9 @@ class ProductCustomFieldsMetabox {
|
|||||||
<th scope="row"><label for="tcp_back_end_label"><?php _e( 'Label', 'tcp' );?>:</label></th>
|
<th scope="row"><label for="tcp_back_end_label"><?php _e( 'Label', 'tcp' );?>:</label></th>
|
||||||
<td><input name="tcp_back_end_label" id="tcp_back_end_label" value="<?php echo tcp_get_the_meta( 'tcp_back_end_label', $post_id );?>" class="regular-text" type="text" style="width:25em" /></td>
|
<td><input name="tcp_back_end_label" id="tcp_back_end_label" value="<?php echo tcp_get_the_meta( 'tcp_back_end_label', $post_id );?>" class="regular-text" type="text" style="width:25em" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<?php } ?>
|
||||||
<?php do_action( 'tcp_product_metabox_custom_fields_after_price', $post_id );?>
|
<?php do_action( 'tcp_product_metabox_custom_fields_after_price', $post_id );?>
|
||||||
|
<?php if (0) { ?>
|
||||||
<tr valign="top">
|
<tr valign="top">
|
||||||
<th scope="row"><label for="tcp_is_visible"><?php _e( 'Is visible (in loops/catalogue)', 'tcp' );?>:</label></th>
|
<th scope="row"><label for="tcp_is_visible"><?php _e( 'Is visible (in loops/catalogue)', 'tcp' );?>:</label></th>
|
||||||
<td><?php
|
<td><?php
|
||||||
@ -135,7 +142,8 @@ class ProductCustomFieldsMetabox {
|
|||||||
}
|
}
|
||||||
?><input type="checkbox" name="tcp_is_visible" id="tcp_is_visible" value="yes" <?php checked( $is_visible, true );?> /></td>
|
?><input type="checkbox" name="tcp_is_visible" id="tcp_is_visible" value="yes" <?php checked( $is_visible, true );?> /></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<?php } ?>
|
||||||
|
<?php if (0) { ?>
|
||||||
<tr valign="top">
|
<tr valign="top">
|
||||||
<th scope="row"><label for="tcp_hide_buy_button"><?php _e( 'Hide buy button', 'tcp' );?>:</label></th>
|
<th scope="row"><label for="tcp_hide_buy_button"><?php _e( 'Hide buy button', 'tcp' );?>:</label></th>
|
||||||
<?php $tcp_hide_buy_button = get_post_meta( $post_id, 'tcp_hide_buy_button', true );?>
|
<?php $tcp_hide_buy_button = get_post_meta( $post_id, 'tcp_hide_buy_button', true );?>
|
||||||
@ -198,6 +206,7 @@ class ProductCustomFieldsMetabox {
|
|||||||
<span class="description"><?php _e( 'Days to expire from the buying day. You can use -1 value.', 'tcp' );?></span>
|
<span class="description"><?php _e( 'Days to expire from the buying day. You can use -1 value.', 'tcp' );?></span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<?php } ?>
|
||||||
<?php do_action( 'tcp_product_metabox_custom_fields', $post_id );?>
|
<?php do_action( 'tcp_product_metabox_custom_fields', $post_id );?>
|
||||||
</tbody></table>
|
</tbody></table>
|
||||||
</div> <!-- form-wrap -->
|
</div> <!-- form-wrap -->
|
||||||
|
|||||||
Reference in New Issue
Block a user