Display Product Dimensions Data

add_action( ‘woocommerce_single_product_summary’, ‘display_product_formated_dimensions_table’, 25 ); function display_product_formated_dimensions_table(){ global $product; if ( $product->has_dimensions() ) { echo ‘ ‘ . __( ‘Dimensions’, ‘woocommerce’ ) . ‘ ‘ . esc_html( wc_format_dimensions( $product->get_dimensions( false ) ) ) . ‘ ‘; } }Continue reading

Automatically Delete Woocommerce Images After Deleting a Product

// Automatically Delete Woocommerce Images After Deleting a Product add_action( ‘before_delete_post’, ‘delete_product_images’, 10, 1 ); function delete_product_images( $post_id ) { $product = wc_get_product( $post_id ); if ( !$product ) { return; } $featured_image_id = $product->get_image_id(); $image_galleries_id = $product->get_gallery_image_ids(); if( !empty(…Continue reading