March 2020
Beginner
660 pages
18h 28m
English
Follow these steps to register a new product type with WooCommerce:
add_action( 'plugins_loaded', 'wpccp_chapter9_register_product_type');function wpccp_chapter9_register_product_type() { if(class_exists('WC_Product')){ class WC_Product_Simple_WPCCP_Support_Package extends WC_Product { public function __construct( $product ) { $this->virtual = 'yes'; $this->downloadable = 'yes'; parent::__construct( $product ); } public function get_type( ) { return 'simple_wpccp_support_package'; } } }}// Step 3 code should be placed after this line
Read now
Unlock full access