Description
Allows to add or change completely the list of product types in the eCommerce. By default TheCartPress supports Simple and Grouped products.
Parameters
- $types
- (Array) List of product types with the next format: array( ‘TYPE-ID’ => ‘title’, ).
Example
Adding more status
<?php function my_tcp_get_product_types( $types ) { $types['NEW_TYPE'] = array( 'label' => __( 'New type', 'tcp' ) ); return $types; } add_filter( 'tcp_get_product_types', 'my_tcp_get_product_types' ); ?>
If new type should support product options or dynamic options the function must be:
For Dynamic Options
__( ‘New type’, ‘tcp’ ),
‘tcp_dynamic_options_supported’ => true
);
return $types;
}
[/php]
For Product Options
__( ‘New type’, ‘tcp’ ),
‘tcp_product_options_supported’ => true
);
return $types;
}
[/php]
Adding more status, previous 1.2.0
<?php function my_tcp_get_product_types( $types ) { $types['NEW_TYPE'] = __( 'New type', 'tcp' ); return $types; } add_filter( 'tcp_get_product_types', 'my_tcp_get_product_types' ); ?>
Related
Change Log
Updated 1.2.0
Since 1.1.2