Is there a particular reason why you would like to “store” them? If not, you can simply do it like this:
<h3><?php echo esc_html( $product->get_name() ); ?></h3>
Is there a particular reason why you would like to “store” them? If not, you can simply do it like this:
<h3><?php echo esc_html( $product->get_name() ); ?></h3>