• Hi I used your plugin before without any issue, I now using it on a development website without any other plugin installed or any template, just very basic and the plugin crash the website all the time I’m saving the product.

    This is the error

    WordPress version 6.1.1
    Active theme: Hello Elementor (version 2.6.1)
    Current plugin: Weight Based Pricing for WooCommerce (version 1.1.4)
    PHP version 8.1.16 Error Details
    =============
    An error of type E_ERROR was caused in line 128 of the file /var/www/vhosts/artikelandswint.net/development.artikelandswint.net/wesco/wp-content/plugins/weight-based-pricing-for-woocommerce/App/Controllers/Admin/VariableProducts.php. Error message: Uncaught TypeError: array_keys(): Argument #1 ($array) must be of type array, null given in /var/www/vhosts/artikelandswint.net/development.artikelandswint.net/wesco/wp-content/plugins/weight-based-pricing-for-woocommerce/App/Controllers/Admin/VariableProducts.php:128
    Stack trace:
    #0 /var/www/vhosts/artikelandswint.net/development.artikelandswint.net/wesco/wp-content/plugins/weight-based-pricing-for-woocommerce/App/Controllers/Admin/VariableProducts.php(128): array_keys()
    #1 /var/www/vhosts/artikelandswint.net/development.artikelandswint.net/wesco/wp-includes/class-wp-hook.php(308): WWBP\App\Controllers\Admin\VariableProducts::recursivelySaveValues()
    #2 /var/www/vhosts/artikelandswint.net/development.artikelandswint.net/wesco/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
    #3 /var/www/vhosts/artikelandswint.net/development.artikelandswint.net/wesco/wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 /var/www/vhosts/artikelandswint.net/development.artikelandswint.net/wesco/wp-content/plugins/woocommerce/includes/admin/meta-boxes/class-wc-meta-box-product-data.php(438): do_action()
    #5 /var/www/vhosts/artikelandswint.net/development.artikelandswint.net/wesco/wp-includes/class-wp-hook.php(308): WC_Meta_Box_Product_Data::save()
    #6 /var/www/vhosts/artikelandswint.net/development.artikelandswint.net/wesco/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
    #7 /var/www/vhosts/artikelandswint.net/development.artikelandswint.net/wesco/wp-includes/plugin.php(517): WP_Hook->do_action()
    #8 /var/www/vhosts/artikelandswint.net/development.artikelandswint.net/wesco/wp-content/plugins/woocommerce/includes/admin/class-wc-admin-meta-boxes.php(268): do_action()
    #9 /var/www/vhosts/artikelandswint.net/development.artikelandswint.net/wesco/wp-includes/class-wp-hook.php(310): WC_Admin_Meta_Boxes->save_meta_boxes()
    #10 /var/www/vhosts/artikelandswint.net/development.artikelandswint.net/wesco/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
    #11 /var/www/vhosts/artikelandswint.net/development.artikelandswint.net/wesco/wp-includes/plugin.php(517): WP_Hook->do_action()
    #12 /var/www/vhosts/artikelandswint.net/development.artikelandswint.net/wesco/wp-includes/post.php(4717): do_action()
    #13 /var/www/vhosts/artikelandswint.net/development.artikelandswint.net/wesco/wp-includes/post.php(4819): wp_insert_post()
    #14 /var/www/vhosts/artikelandswint.net/development.artikelandswint.net/wesco/wp-admin/includes/post.php(426): wp_update_post()
    #15 /var/www/vhosts/artikelandswint.net/development.artikelandswint.net/wesco/wp-admin/post.php(227): edit_post()
    #16 {main}
      thrown

Viewing 3 replies - 1 through 3 (of 3 total)
  • I’m getting the same problem. Is there any fix for it?

    I am also getting the same error. There is an issue with variable products using the weight based pricing feature of the plugin.

    You can fix this issue by changing the code in file wp-content/plugins/weight-based-pricing-for-woocommerce/App/Controllers/Admin/VariableProducts.php at line 122, until the plugin gets an update :

    /**
    * Variable Product Save All.
    */
    public static function recursivelySaveValues($post_id) {
    if (isset($_POST[‘variable_post_id’])) {
    $var_ids = ParseInput::id($_POST[‘variable_post_id’]); if (is_array($var_ids)) {
    $var_ids_loop = max(array_keys($var_ids)); for ($i = 0; $i <= $var_ids_loop; $i++) { $variation_id = $var_ids[$i]; self::saveValues($variation_id, $i); } }
    }
    }

    Thread Starter squaladesign

    (@squaladesign)

    Hi @pierrethenot thank you for the reply but it’s not working for me ??
    I still have the same problem.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Website in crash all the time I save a product’ is closed to new replies.