How to add a product link using php?

There is such piece of code:
<?php
$overlay = WFG_Settings_Helper::get( 'popup_overlay', true, 'global_options' );
if ( $overlay ):
?>
 <div class="wfg-overlay" style="display:none"></div>
<?php endif; ?>
<div class='wfg-popup' style="display:none">
 <h2 class="wfg-title">
<?php
 $heading = WFG_Settings_Helper::get( 'popup_heading', false, 'global_options' );
 if ( false !== $heading ) {
 echo $heading;
 } else {
 echo WFG_Common_Helper::translate( 'Choose your free gift' );
}
?>
</h2>
 <div class="wfg-gifts">
 <form action="<?php echo admin_url( 'admin-ajax.php' ); ?>" method="post">
 <input type="hidden" name="action" value="wfg_add_gifts"/>
<?php
 wp_nonce_field( 'wfg_add_free_gifts', '_wfg_nonce' );
 if ( ! empty( $wfg_free_products ) ):
 foreach ( $wfg_free_products as $product ):
 if ( empty( $product->detail ) ) {
continue;
}
?>
 <div class="wfg-gift-item">
 <div class="wfg-heading">
 <input type="checkbox" class="wfg-checkbox" name="wfg_free_items[]"
 id="wfg-item-<?php echo $product->detail->ID ?>"
 value="<?php echo $product->detail->ID ?>"/>
 <label for="wfg-item-<?php echo $product->detail->ID ?>" class="wfg-title">
 <img src="<?php echo $product->image ?>" style="width:150px; height:150px;" alt=""/>
</label>

 <h3><?php echo $product->detail->post_title ?></h3>
</div>
</div>
 <?php endforeach; ?>
 <div class="wfg-actions">
 <button class="button wfg-wfg button-add-gifts">
<?php
 $add_gift_text = WFG_Settings_Helper::get( 'popup_add_gift_text', false, 'global_options' );
 if ( false !== $add_gift_text ) {
 echo $add_gift_text;
 } else {
 echo WFG_Common_Helper::translate( 'Add Gifts' );
}
?>
</button>
 <button class="button wfg-wfg button-no-thanks" type="button">
<?php
 $cancel_text = WFG_Settings_Helper::get( 'popup_cancel_text', false, 'global_options' );
 if ( false !== $cancel_text ) {
 echo $cancel_text;
 } else {
 echo WFG_Common_Helper::translate( 'No Thanks' );
}
?>
</button>
</div>
 <?php endif; ?>
</form>
</div>
</div>

That is, load image item, load item name. But the name is not clickable. Can you please tell me what to add to by clicking on the description, i.e. here apparently
<h3><?php echo $product->detail->post_title ?></h3>
opened a new window with the product page? Thank you in advance!
March 19th 20 at 08:50
2 answers
March 19th 20 at 08:52
Solution
The solution was found! var_dump($product->detail); helped to see how everything has loaded, the link to the product. So thank you and leni_m
The decision itself is:
<h3><a href="<?php echo $product->detail->guid ?>" target="_blank">
<?php echo $product->detail->post_title ?></a></h3>
March 19th 20 at 08:54
To put a title inside the a tag detail->post_title ?>
This piece of code gives a popup with the 4th goods, so title is taken, but as text, and I need it along with a link as href - alejandra commented on March 19th 20 at 08:57

Find more questions by tags PHP