Handle bundle pricing on separate page
This commit is contained in:
@@ -11,6 +11,8 @@ class Wiaas_Admin_Package_Pricing {
|
||||
|
||||
public static function init() {
|
||||
|
||||
add_action( 'admin_menu', array(__CLASS__, 'add_package_pricing_editor_page') );
|
||||
|
||||
add_action( 'woocommerce_product_data_tabs', array( __CLASS__, 'package_data_tabs' ) );
|
||||
add_action( 'woocommerce_product_data_panels', array( __CLASS__, 'package_data_panel' ) );
|
||||
|
||||
@@ -19,6 +21,18 @@ class Wiaas_Admin_Package_Pricing {
|
||||
add_action( 'woocommerce_process_product_meta', array( __CLASS__, 'process_meta_box' ), 1, 2 );
|
||||
}
|
||||
|
||||
public static function add_package_pricing_editor_page() {
|
||||
|
||||
add_submenu_page(
|
||||
'edit.php?post_type=product',
|
||||
__( 'Products', 'wiaas' ),
|
||||
null,
|
||||
'create_products',
|
||||
'wiaas-package_price_editor',
|
||||
array(__CLASS__, 'package_data_panel')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates and renders new empty package pricing rule
|
||||
*/
|
||||
@@ -54,8 +68,8 @@ class Wiaas_Admin_Package_Pricing {
|
||||
*/
|
||||
public static function package_data_panel() {
|
||||
|
||||
global $post;
|
||||
$package = wc_get_product( $post->ID );
|
||||
$package_id = absint($_GET['id']);
|
||||
$package = wc_get_product( $package_id );
|
||||
$pricing_rules = Wiaas_Package_Pricing::get_package_prices($package);
|
||||
$commission = Wiaas_Package_Pricing::get_package_pricing_commission($package);
|
||||
$max_cost_margin = Wiaas_Package_Pricing::get_package_max_cost_margin($package);
|
||||
|
||||
Reference in New Issue
Block a user