PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

Support "fixed price" for custom product types

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

I needed to add support to my custom product type, and wasn't able to do so by adding the product type in a filter, so here is my suggestion:

in the file: 'classes/fixed/fixed_price.php', in the method 'woocommerce_product_options_general_product_data'

public function woocommerce_product_options_general_product_data() {
    global $WOOCS;
    global $post;
    $_product = wc_get_product($post->ID);

    add_action('admin_footer', array($this, 'admin_footer'));
    if ($_product->is_type('simple') OR $_product->is_type('external') OR $_product->is_type('subscription') OR $_product->is_type('composite') OR $_product->is_type('bundle') OR $_product->is_type('box_product')) {
        ...
    }
}

To change to:

public function woocommerce_product_options_general_product_data() {
    global $WOOCS;
    global $post;
    $_product = wc_get_product($post->ID);
    add_action('admin_footer', array($this, 'admin_footer'));
    $product_types = apply_filters('woocs_product_fixed_price_data_simple_types', array('simple', 'external', 'subscription', 'composite', 'bundle', 'box_product'));
    if (in_array($_product->get_type(), $product_types)) {
        ...
    }
}

 

Hello

Thank you  for  cooperation!

I  will pass  it  to developers