Want To Add Extra Images Per Product Variation? Download This Free Plugin

Error deleting products

Good I hope you are well.

I am writing to you because within my website I find a fatal error when trying to permanently delete products from the trash. Currently I have my site in wordpress with Woocommerce and I use its plugin to display the palettes.

I attach an image where said error is displayed and additionally I place the text of the same.

I look forward to your prompt cooperation.

Thank you!

Captura desde 2022-11-23 21-12-12.png

 

Fatal error: Uncaught Error: Call to a member function get_parent_id() on bool in /home/customer/www/faride.com.co/public_html/wp-content/plugins/woo-variation-swatches/includes/class-woo-variation-swatches-manage-cache.php:148 Stack trace: #0 /home/customer/www/faride.com.co/public_html/wp-includes/class-wp-hook.php(308): Woo_Variation_Swatches_Manage_Cache->clear_cache_on_product_modify(9077) #1 /home/customer/www/faride.com.co/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(”, Array) #2 /home/customer/www/faride.com.co/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #3 /home/customer/www/faride.com.co/public_html/wp-content/plugins/woocommerce/includes/data-stores/class-wc-product-variable-data-store-cpt.php(676): do_action(‘woocommerce_del…’, 9077) #4 /home/customer/www/faride.com.co/public_html/wp-content/plugins/woocommerce/includes/class-wc-data-store.php(224): WC_Product_Variable_Data_Store_CPT->delete_variations(9072, true) #5 /home/customer/www/faride.com.co/public_ht in /home/customer/www/faride.com.co/public_html/wp-content/plugins/woo-variation-swatches/includes/class-woo-variation-swatches-manage-cache.php on line 148
Ha habido un error crítico en esta web. Por favor, comprueba la bandeja de entrada del correo electrónico del administrador de tu sitio para obtener instrucciones.

 

Alex - Support Engineer

.

Alex - Support Engineer

Hi Fernando,

Thanks for reaching out to us. We are sorry for the inconvenience.

Please add the below snippet using the Code Snippets plugin. I have already informed the issue to our development team. They are working on this issue. Once I get an update I will let know here. Till then use the below snippet:

add_action('woo_variation_swatches_manage_cache_loaded', function( $woo_variation_swatches_manage_cache_loaded ){
remove_action( 'woocommerce_delete_product_variation', array( $woo_variation_swatches_manage_cache_loaded, 'clear_cache_on_product_modify' ) );
}, 10, 1);

Thanks in advance for your patience.

I have applied the submitted settings in the fuctions.php but still getting the same error. I am attaching a screenshot of the code entered in the functions and additional error that appears on the screen when deleting. Remember that the process is to delete permanently from the trash.

Thanks