Custom plugin issue – Notice: Trying to get property of non-object in

try use global $post; at the beginning of your function

Note that you’ve to run on a specific hook in order to work. see this post: https://www.ibenic.com/how-to-add-woocommerce-custom-product-fields/

function spinna360_nof() {
$noy=array(
    'id'        => '_select_noi',
    'label'     => __( 'Select number of images: ', 'spinna360' ),
    'selected'  => true,
    'options'   => [
        '24'        => __( '24', 'spinna360' ),
        '36'        => __( '36', 'spinna360' ),
        '48'        => __( '48', 'spinna360' )
        ]
);
woocommerce_wp_select($noy);   
}
add_action( 'woocommerce_product_data_panels', 'spinna360_nof');